A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/convert__selected__gaps_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/packages/pkg_sequence_edit/convert_selected_gaps.cpp Source File

58 #include <wx/textdlg.h> 66  bool

create_xref_map =

true

;

68

create_xref_map =

false

;

69  return apply_impl

(

objects

, to_known, adjust_features, old_to_new, create_xref_map);

77  bool

create_general_only =

false

;

83  const CGapEdit

* gap_edit =

dynamic_cast<const CGapEdit

*

>

((*it).object.GetPointer());

92

bsh = scope->GetBioseqHandle(feat->

GetLocation

());

97  if

(bsh_to_inst.

find

(bsh) != bsh_to_inst.

end

())

114

bsh_to_inst[bsh] = make_pair(new_inst,

false

);

124  const CGapEdit

* gap_edit =

dynamic_cast<const CGapEdit

*

>

((*it).object.GetPointer());

130  const CSeq_feat

* feat =

dynamic_cast<const CSeq_feat

*

>

((*it).object.GetPointer());

140  for

(

const auto

& d : diffs[bsh])

150  if

(delta_i->Empty())

159  else if

(seg.

IsLoc

())

176

diffs[bsh][start] = diff;

178

new_inst->

SetLength

(old_length + diff);

182

NRawToDeltaSeq::SGap gap;

184

gap.length = delta_len;

185

gap.is_known =

false

;

186

gap.is_replace =

true

;

187

gaps[bsh].push_back(gap);

190

bsh_to_inst[bsh].second =

true

;

220  if

(!bsh_to_inst[bsh].second && new_inst->

IsSetLength

())

222

diffs[bsh][start] = diff;

224

new_inst->

SetLength

(old_length + diff);

226

NRawToDeltaSeq::SGap gap;

228

gap.length = delta_len;

229

gap.is_known =

false

;

230

gap.is_replace =

true

;

231

gaps[bsh].push_back(gap);

233

bsh_to_inst[bsh].second =

true

;

261  for

(

const auto

& it : bsh_to_inst)

265  bool

modified = it.second.second;

285

wxTextEntryDialog dlg(

NULL

,

_

(

"Convert gaps longer or equal to"

),

_

(

"Convert Known Length Gaps to Unknown"

),

_

(

"100"

));

286

dlg.SetTextValidator(wxFILTER_NUMERIC);

287  if

(dlg.ShowModal() == wxID_OK)

289

wxString

val

= dlg.GetValue();

291  if

(

val

.ToLong(&min_size))

293  CScope

&scope = seh.GetScope();

308  bool

has_loc(

false

);

311  if

( (*iter)->IsLoc() )

326  if

(delta_i->Empty())

330  if

(sv.

IsInGap

(pos) && (

long

)delta_len >= min_size &&

343

}

catch

(

CException

) {}

catch

(std::exception ) {}

359  bool

create_xref_map =

true

;

361

create_xref_map =

false

;

369

wxTextEntryDialog dlg(

NULL

,

_

(

"Change length to"

),

_

(

"Change length of selected gaps"

),

_

(

"100"

));

370

dlg.SetTextValidator(wxFILTER_NUMERIC);

371  if

(dlg.ShowModal() == wxID_OK)

373

wxString

val

= dlg.GetValue();

375  if

(

val

.ToLong(&new_size))

380  bool

create_general_only =

false

;

386  const CGapEdit

* gap_edit =

dynamic_cast<const CGapEdit

*

>

((*it).object.GetPointer());

391  const CSeq_feat

* feat =

dynamic_cast<const CSeq_feat

*

>

((*it).object.GetPointer());

395

bsh = scope->GetBioseqHandle(feat->

GetLocation

());

400  if

(bsh_to_inst.

find

(bsh) != bsh_to_inst.

end

())

414  bool

has_loc(

false

);

417  if

( (*iter)->IsLoc() )

428

bsh_to_inst[bsh] = make_pair(new_inst,

false

);

438  const CGapEdit

* gap_edit =

dynamic_cast<const CGapEdit

*

>

((*it).object.GetPointer());

444  const CSeq_feat

* feat =

dynamic_cast<const CSeq_feat

*

>

((*it).object.GetPointer());

454  for

(

const auto

& d : diffs[bsh])

464  if

(delta_i->Empty())

473  int

diff =

static_cast<int>

(new_size);

477

diffs[bsh][start] = diff;

479

new_inst->

SetLength

(old_length + diff);

483

NRawToDeltaSeq::SGap gap;

485

gap.length =

static_cast<int>

(new_size - delta_len);

486

gap.is_known =

true

;

487

gap.is_replace =

false

;

488

gaps[bsh].push_back(gap);

491

bsh_to_inst[bsh].second =

true

;

510

diff =

static_cast<int>

(new_size);

516  if

(!bsh_to_inst[bsh].second && new_inst->

IsSetLength

())

518

diffs[bsh][start] = diff;

520

new_inst->

SetLength

(old_length + diff);

522

NRawToDeltaSeq::SGap gap;

524

gap.length =

static_cast<int>

(new_size - delta_len);

525

gap.is_known =

true

;

526

gap.is_replace =

false

;

527

gaps[bsh].push_back(gap);

529

bsh_to_inst[bsh].second =

true

;

558  for

(

const auto

& it : bsh_to_inst)

562  bool

modified = it.second.second;

574  if

(!diffs.

empty

())

577  for

(objects::CAlign_CI align_ci(tse); align_ci; ++ align_ci)

579  const

objects::CSeq_align& align = *align_ci;

581  int

num_rows = align.CheckNumRows();

584  if

(!align.IsSetSegs() || !align.GetSegs().IsDenseg() ||

585

!align.GetSegs().GetDenseg().IsSetStarts() || !align.GetSegs().GetDenseg().IsSetLens())

588

vector< TSignedSeqPos > starts(align.GetSegs().GetDenseg().GetStarts());

589  size_t

num_segs = align.GetSegs().GetDenseg().GetLens().size();

590  for

(

size_t

s = 0; s < num_segs; s++)

591  for

(

auto row

= 0;

row

< num_rows;

row

++)

600  for

(

const auto

& d : diffs[bsh])

605

starts[num_rows * s +

row

] = from;

609

new_align->

Assign

(align);

610

new_align->

SetSegs

().SetDenseg().SetStarts() = starts;

611

new_align->

SetSegs

().SetDenseg().TrimEndGaps();

612

new_align->

SetSegs

().SetDenseg().RemovePureGapSegs();

613

new_align->

SetSegs

().SetDenseg().Compact();

626  bool

create_xref_map =

true

;

627  apply_impl

(seh, old_to_new, create_xref_map);

628

create_xref_map =

false

;

629  return apply_impl

(seh, old_to_new, create_xref_map);

635  bool

any_modified =

false

;

641  bool

bsh_modified =

false

;

652  bool

has_loc(

false

);

655  if

( (*iter)->IsLoc() )

668

vector<pair<int, bool> > gap_len;

673  if

(delta_i->Empty())

680

gap_len.push_back(pair<int, bool> (delta_len, unknown));

684

gap_len.push_back(pair<int, bool> (0,

false

));

691

CDelta_ext::Tdata::iterator delta_i = new_inst->

SetExt

().SetDelta().Set().begin();

692  while

(delta_i != new_inst->

SetExt

().SetDelta().Set().end())

694  if

(delta_i->Empty())

701  int

delta_len = gap_len[

i

].first;

704

delta_i = new_inst->

SetExt

().SetDelta().Set().erase(delta_i);

712  bool

unknown = gap_len[

i

].second;

713  bool

modified =

false

;

714  for

(

size_t

j =

i

+ 1; j < gap_len.size(); j++)

716  if

(gap_len[j].

first

<= 0)

718

delta_len += gap_len[j].first;

719

unknown |= gap_len[j].second;

720

gap_len[j].first = -1;

735

new_inst->

SetLength

(old_length + diff);

738

NRawToDeltaSeq::SGap gap;

741

gap.is_known =

true

;

742

gap.is_replace =

false

;

743

gaps[bsh].push_back(gap);

745

bsh_modified =

true

;

753

}

catch

(

CException

) {}

catch

(std::exception ) {}

759

any_modified =

true

;

764  auto

local_cmd = composite;

767

local_cmd->Unexecute();

User-defined methods of the data storage class.

User-defined methods of the data storage class.

User-defined methods of the data storage class.

@ eExtreme_Positional

numerical value

User-defined methods of the data storage class.

User-defined methods of the data storage class.

bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)

void AddCommand(IEditCommand &command)

virtual void Unexecute()

Undo (opposite to Execute())

virtual void Execute()

Do the editing action.

static CRef< CCmdComposite > apply(objects::CSeq_entry_Handle seh)

static CRef< CCmdComposite > apply_impl(objects::CSeq_entry_Handle seh, map< objects::CObject_id::TId, objects::CObject_id::TId > &old_to_new, bool create_xref_map)

static CRef< CCmdComposite > apply(objects::CSeq_entry_Handle seh)

static CRef< CCmdComposite > apply_impl(const TConstScopedObjects &objects, bool to_known, bool adjust_features, map< objects::CObject_id::TId, objects::CObject_id::TId > &old_to_new, bool create_xref_map)

static CRef< CCmdComposite > apply(const TConstScopedObjects &objects, bool to_known, bool adjust_features=false)

static CRef< CCmdComposite > apply(const TConstScopedObjects &objects)

static CRef< CCmdComposite > apply_impl(const TConstScopedObjects &objects, map< objects::CObject_id::TId, objects::CObject_id::TId > &old_to_new, bool create_xref_map)

static TId s_FindHighestFeatureId(const objects::CSeq_entry_Handle &entry)

TSeqPos GetFrom(void) const

CBioseq_Handle GetBioseq_Handle() const

namespace ncbi::objects::

void AddOrReplaceQualifier(const string &qual_name, const string &qual_val)

Add a qualifier to this feature, or replace the value for the first one if it already exists.

const_iterator begin() const

const_iterator end() const

const_iterator find(const key_type &key) const

void AdjustFeatureLocations(const map< objects::CBioseq_Handle, vector< SGap >> &map_gaps, CRef< CCmdComposite > composite, bool split_gene_locations, bool break_features, bool keep_gap_length, bool create_general_only, objects::CObject_id::TId &max_feat_id, map< objects::CObject_id::TId, objects::CObject_id::TId > &old_to_new, bool create_xref_map)

USING_SCOPE(ncbi::objects)

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

unsigned int TSeqPos

Type for sequence locations and lengths.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

int TSignedSeqPos

Type for signed sequence position.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

vector< SConstScopedObject > TConstScopedObjects

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Set object to copy of another one.

TRange GetTotalRange(void) const

TSeqPos GetStart(ESeqLocExtremes ext) const

Return start and stop positions of the seq-loc.

TSeqPos GetLength(const CSeq_id &id, CScope *scope)

Get sequence length if scope not null, else return max possible TSeqPos.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

CScope & GetScope(void) const

Get scope this handle belongs to.

TSeqPos GetBioseqLength(void) const

bool IsSetInst(void) const

CSeq_entry_Handle GetTopLevelEntry(void) const

Get top level Seq-entry handle.

CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const

Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.

const TInst & GetInst(void) const

@ eCoding_Iupac

Set coding to printable coding (Iupacna or Iupacaa)

bool IsInGap(TSeqPos pos) const

true if sequence at 0-based position 'pos' has gap Note: this method is not MT-safe,...

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

position_type GetLength(void) const

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static string LongToString(long value, TNumToStringFlags flags=0, int base=10)

Convert Int to string.

static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)

Convert UInt to string.

bool IsLim(void) const

Check if variant Lim is selected.

TLim GetLim(void) const

Get the variant data.

void SetSegs(TSegs &value)

Assign a value to Segs data member.

const TKey & GetKey(void) const

Get the Key member data.

bool IsSetData(void) const

the specific data Check if a value has been assigned to Data data member.

void SetLocation(TLocation &value)

Assign a value to Location data member.

bool IsImp(void) const

Check if variant Imp is selected.

bool IsSetKey(void) const

Check if a value has been assigned to Key data member.

const TLocation & GetLocation(void) const

Get the Location member data.

const TData & GetData(void) const

Get the Data member data.

const TImp & GetImp(void) const

Get the variant data.

bool IsSetLocation(void) const

feature made from Check if a value has been assigned to Location data member.

TFrom GetFrom(void) const

Get the From member data.

TTo GetTo(void) const

Get the To member data.

bool IsInt(void) const

Check if variant Int is selected.

const TInt & GetInt(void) const

Get the variant data.

TLiteral & SetLiteral(void)

Select the variant.

void SetLength(TLength value)

Assign a value to Length data member.

void SetExt(TExt &value)

Assign a value to Ext data member.

const TLiteral & GetLiteral(void) const

Get the variant data.

bool IsLoc(void) const

Check if variant Loc is selected.

bool IsSetExt(void) const

extensions for special types Check if a value has been assigned to Ext data member.

TLength GetLength(void) const

Get the Length member data.

TLength GetLength(void) const

Get the Length member data.

const TFuzz & GetFuzz(void) const

Get the Fuzz member data.

bool IsSetFuzz(void) const

could be unsure Check if a value has been assigned to Fuzz data member.

bool IsDelta(void) const

Check if variant Delta is selected.

void SetFuzz(TFuzz &value)

Assign a value to Fuzz data member.

bool IsSetLength(void) const

length of sequence in residues Check if a value has been assigned to Length data member.

const TExt & GetExt(void) const

Get the Ext member data.

const TDelta & GetDelta(void) const

Get the variant data.

const TLoc & GetLoc(void) const

Get the variant data.

const Tdata & Get(void) const

Get the member data.

bool IsLiteral(void) const

Check if variant Literal is selected.

void SetLength(TLength value)

Assign a value to Length data member.

list< CRef< CDelta_seq > > Tdata

void ResetFuzz(void)

Reset Fuzz data member.

@ eMol_na

just a nucleic acid

where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig

#define row(bind, expected)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4