76 else best_id = sid.AsFastaString();
101 from = seq_int.
GetTo();
104 f_from.
GetLabel(&lab_from, from,
false);
114 to = seq_int.
GetTo();
118 f_from.
GetLabel(&lab_from, from,
false);
127 location += lab_from +
"-" + lab_to;
137 if (seq_loc.
IsPnt()) {
156 if (seq_loc.
IsInt()) {
161 const list <CRef <CSeq_loc> >* seq_loc_ls;
162 if (seq_loc.
IsMix()) {
169 if (it == seq_loc.
GetMix().
Get().begin()) {
199 else if (seq_loc.
IsBond()) {
278 size_t num_intervals = last_l.
GetSize();
279 last_l.
SetPos(num_intervals - 1);
303 bool& do_set_5_partial,
304 bool& do_clear_5_partial)
const
306 do_set_5_partial =
false;
307 do_clear_5_partial =
false;
316 do_set_5_partial =
true;
318 bool confident =
false;
320 if (confident && !at_5) {
321 do_set_5_partial =
true;
327 bool confident =
false;
329 do_set_5_partial =
true;
337 bool confident =
true;
347 do_set_5_partial =
true;
357 do_set_5_partial =
true;
362 do_clear_5_partial =
true;
367 bool confident =
false;
369 do_clear_5_partial =
true;
380 bool confident =
true;
390 do_clear_5_partial =
true;
395 return do_set_5_partial || do_clear_5_partial;
402 bool& do_set_3_partial,
403 bool& do_clear_3_partial)
const
405 do_set_3_partial =
false;
406 do_clear_3_partial =
false;
415 do_set_3_partial =
true;
417 bool confident =
false;
419 if (confident && !at_3) {
420 do_set_3_partial =
true;
426 bool confident =
false;
428 if (at_3 && confident) {
429 do_set_3_partial =
true;
437 bool confident =
true;
447 do_set_3_partial =
true;
456 do_clear_3_partial =
true;
461 bool confident =
false;
463 if (!at_3 && confident) {
464 do_clear_3_partial =
true;
472 bool confident =
true;
482 do_clear_3_partial =
true;
487 return do_set_3_partial || do_clear_3_partial;
520 size_t num_intervals = last_l.
GetSize();
521 last_l.
SetPos(num_intervals - 1);
555 if (pos < loc_start) {
557 id->Assign(*(loc.
GetId()));
563 }
else if (pos > loc_stop) {
565 id->Assign(*(loc.
GetId()));
567 *
id, loc_stop + 1,
static_cast<TSeqPos>(pos), strand));
584 bool any_change =
false;
587 bool do_set_5_partial =
false;
588 bool do_clear_5_partial =
false;
589 any_change |=
Interpret5Policy(feat, scope, do_set_5_partial, do_clear_5_partial);
590 if (do_set_5_partial) {
596 }
else if (do_clear_5_partial) {
601 bool do_set_3_partial =
false;
602 bool do_clear_3_partial =
false;
603 any_change |=
Interpret3Policy(feat, scope, do_set_3_partial, do_clear_3_partial);
604 if (do_set_3_partial) {
610 }
else if (do_clear_3_partial) {
619 bool changed =
false;
630 bool changed =
false;
661 if ((*it)->IsNull()) {
675 new_loc->
Assign(orig_loc);
681 if (subloc && !subloc->
IsNull()) {
684 new_loc->
SetMix().Set().push_back(add);
699 new_loc->
Assign(orig_loc);
702 switch(orig_loc.
Which()) {
712 new_loc->
Assign(orig_loc);
727 new_loc->
SetMix().Set().push_back(null_loc);
730 new_loc->
SetMix().Set().push_back(add);
754 switch ((orig_frame + diff % 3) % 3) {
765 feat.
SetData().SetCdregion().SetFrame(new_frame);
774 bool confident =
false;
809 bool confident =
false;
812 size_t num_intervals = last_l.
GetSize();
813 last_l.
SetPos(num_intervals - 1);
836 CScope& scope,
bool adjust_gene,
bool retranslate_cds)
839 new_feat->
Assign(orig_feat);
856 new_gene->
Assign(*old_gene);
857 bool gene_change =
false;
915 interval.
SetTo(from);
916 }
else if (interval.
IsSetTo()) {
977 vector<int> new_pnts;
982 ITERATE(vector<int>, it, new_pnts) {
993 switch (loc.
Which()) {
1052 if ((*it)->IsSetLoc()) {
1126 switch (loc.
Which()) {
1129 CSeq_loc::TEquiv::Tdata::iterator it = loc.
SetEquiv().Set().begin();
1130 while (it != loc.
SetEquiv().Set().end()) {
1133 it = loc.
SetEquiv().Set().erase(it);
1152 CSeq_loc::TMix::Tdata::iterator it = loc.
SetMix().Set().begin();
1153 while (it != loc.
SetMix().Set().end()) {
1156 it = loc.
SetMix().Set().erase(it);
1167 }
else if (loc.
GetMix().
Get().size() == 0) {
1179 loc.
SetInt().Assign(*sub);
1197 loc.
SetPnt().Assign(*sub);
1229 TSeqPos cut_size = cut_to - cut_from + 1;
1232 if (feat_to < cut_from)
1239 if (feat_from >= cut_from && feat_to <= cut_to)
1242 bCompleteCut =
true;
1243 trim5 += feat_from - feat_to + 1;
1248 if (feat_from > cut_to)
1251 feat_from -= cut_size;
1252 feat_to -= cut_size;
1254 interval.
SetTo(feat_to);
1269 if (feat_to > cut_to) {
1271 feat_to -= cut_size;
1276 TSeqPos diff = cut_from - 1 - feat_to;
1279 feat_to = cut_from - 1;
1283 if (feat_from >= cut_from) {
1285 TSeqPos diff = cut_to + 1 - feat_from;
1288 feat_from = cut_to + 1;
1289 feat_from -= cut_size;
1293 interval.
SetTo(feat_to);
1305 if (packint.
IsSet()) {
1308 CPacked_seqint::Tdata::iterator it;
1309 for (it = packint.
Set().begin();
1310 it != packint.
Set().end(); )
1312 bool bDeleted =
false;
1315 bDeleted, this_trim, bAdjusted);
1322 it = packint.
Set().erase(it);
1329 if (packint.
Get().empty()) {
1333 if (!packint.
IsSet()) {
1334 bCompleteCut =
true;
1349 CSeq_loc_mix::Tdata::iterator it;
1350 for (it = mix.
Set().begin();
1351 it != mix.
Set().end(); )
1353 bool bDeleted =
false;
1362 it = mix.
Set().erase(it);
1370 if (!mix.
IsSet() || mix.
Set().empty()) {
1371 bCompleteCut =
true;
1388 auto diff = to - from + 1;
1391 }
else if (from < pnt.
GetPoint()) {
1392 bCompleteCut =
true;
1401 bool& bCompleteCut,
TSeqPos& trim5,
bool& bAdjusted)
1407 if (
pack.IsSetPoints()) {
1409 auto it =
pack.SetPoints().begin();
1410 while (it !=
pack.SetPoints().end()) {
1412 auto diff = to - from + 1;
1417 }
else if (from < *it) {
1418 it =
pack.SetPoints().erase(it);
1429 if (
pack.SetPoints().empty()) {
1430 bCompleteCut =
true;
1442 bool cutA =
false, cutB =
false;
1455 bCompleteCut =
true;
1468 CSeq_loc_equiv::Tdata::iterator it = equiv.
Set().begin();
1469 while (it != equiv.
Set().end()) {
1473 if (this_trim5 > max_trim5) {
1474 max_trim5 = this_trim5;
1477 it = equiv.
Set().erase(it);
1482 if (equiv.
Set().empty()) {
1483 bCompleteCut =
true;
1493 TSeqPos& trim5,
bool& bAdjusted)
1502 bCompleteCut, trim5, bAdjusted);
1534 if (!bCompleteCut) {
1559 TSeqPos insert_size = insert_to - insert_from + 1;
1562 if (feat_to < insert_from)
1569 if (feat_from > insert_from) {
1570 feat_from += insert_size;
1571 feat_to += insert_size;
1573 interval.
SetTo(feat_to);
1578 if (feat_from <= insert_from && feat_to >= insert_from)
1580 feat_to += insert_size;
1581 interval.
SetTo(feat_to);
1591 if (packint.
IsSet()) {
1593 CPacked_seqint::Tdata::iterator it;
1594 for (it = packint.
Set().begin();
1595 it != packint.
Set().end(); it++)
1609 CSeq_loc_mix::Tdata::iterator it;
1610 for (it = mix.
Set().begin();
1611 it != mix.
Set().end(); it++)
1630 if (insert_from < pnt.
GetPoint()) {
1631 auto diff = insert_to - insert_from + 1;
1646 while (it != packpnt.
SetPoints().end()) {
1648 auto diff = to - from + 1;
1674 CSeq_loc_equiv::Tdata::iterator it = equiv.
Set().begin();
1675 while (it != equiv.
Set().end()) {
1730 const CSeq_id* seqid,
bool& cut,
1731 unsigned int options)
1747 if (feat_to < start) {
1758 if (feat_from < start && feat_to > stop) {
1765 if (feat_to > stop) {
1768 if (stop + 1 > feat_from) {
1775 if (feat_from < start) {
1776 before.
SetTo(start - 1);
1790 const CSeq_id* seqid,
unsigned int options)
1792 if (before_intervals.
IsSet()) {
1794 reverse(before_intervals.
Set().begin(), before_intervals.
Set().end());
1797 auto it = before_intervals.
Set().begin();
1798 while (it != before_intervals.
Set().end()) {
1802 if (int_from > stop && after_intervals.
IsSet() && !after_intervals.
Get().empty()) {
1803 after_intervals.
Set().push_back(
Ref(&sub_interval));
1804 it = before_intervals.
Set().erase(it);
1812 it = before_intervals.
Set().erase(it);
1818 after_intervals.
Set().push_back(after);
1824 reverse(after_intervals.
Set().begin(), after_intervals.
Set().end());
1827 reverse(before_intervals.
Set().begin(), before_intervals.
Set().end());
1834 size_t start,
size_t stop,
1835 const CSeq_id* seqid,
unsigned int options)
1840 switch(loc1.
Which())
1848 seqid, cut, options);
1886 if (before_intervals.
Set().empty()) {
1889 if (!after_intervals->Set().empty()) {
1906 if (before_mix.
IsSet()) {
1908 reverse(before_mix.
Set().begin(), before_mix.
Set().end());
1910 auto it = before_mix.
Set().begin();
1911 while (it != before_mix.
Set().end()) {
1915 if (from > stop && after_mix->IsSet() && !after_mix->Get().empty()) {
1916 after_mix->Set().push_back(
Ref(&sub_loc));
1917 it = before_mix.
Set().erase(it);
1924 it = before_mix.
Set().erase(it);
1930 after_mix->Set().push_back(after);
1935 if (after_mix->IsReverseStrand()) {
1936 reverse(after_mix->Set().begin(), after_mix->Set().end());
1939 reverse(before_mix.
Set().begin(), before_mix.
Set().end());
1943 if (before_mix.
Set().empty()) {
1946 if (!after_mix->Set().empty()) {
1948 loc2.
SetMix().Assign(*after_mix);
1952 add->
SetMix().Assign(*after_mix);
1963 if (before_equiv.
IsSet()) {
1965 CSeq_loc_equiv::Tdata::iterator it;
1966 for (it = before_equiv.
Set().begin();
1967 it != before_equiv.
Set().end(); )
1973 it = before_equiv.
Set().erase(it);
1979 after_equiv->Set().push_back(after);
1984 if (before_equiv.
Set().empty()) {
1987 if (!after_equiv->Set().empty()) {
1989 loc2.
SetMix().Assign(*after_equiv);
1992 add->
SetMix().Assign(*after_equiv);
2003 CPacked_seqpnt::TPoints::iterator it = loc1.
SetPacked_pnt().SetPoints().begin();
2006 after_points.push_back(*it);
2009 it = before_points.erase(it);
2014 if (!after_points.empty()) {
2017 after->SetPoints().assign(after_points.begin(), after_points.end());
2026 if (before_points.empty()) {
2049 CCdregion::TCode_break::iterator it = cdr.
SetCode_break().begin();
2051 if ((*it)->IsSetLoc()) {
2053 bool adjusted =
false;
2077 bool trimmed =
false;
2118 CCdregion::TCode_break::iterator it = cdr.
SetCode_break().begin();
2120 if ((*it)->IsSetLoc()) {
2212 if (pint.
Get().size() < 2) {
2215 bool any_change =
false;
2217 bool this_change =
true;
2218 while (this_change) {
2219 this_change =
false;
2222 CPacked_seqint::Tdata::iterator
a = pint.
Set().begin();
2223 CPacked_seqint::Tdata::iterator
b =
a;
2225 while (
b != pint.
Set().end()) {
2226 if ((*a)->IsSetId() && (*b)->IsSetId() &&
2227 (*a)->GetId().Equals((*b)->GetId()) &&
2228 (*a)->IsSetFrom() && (*a)->IsSetTo() && (*a)->GetFrom() < (*a)->GetTo() &&
2229 (*b)->IsSetFrom() && (*b)->IsSetTo() && (*b)->GetFrom() < (*b)->GetTo() &&
2232 if ((*b)->GetTo() > (*a)->GetFrom()) {
2234 a->Reset(
b->GetPointer());
2240 if ((*b)->GetTo() < (*a)->GetFrom()) {
2242 a->Reset(
b->GetPointer());
2278 if (this_strand != strand) {
2292 bool any_change =
false;
2296 if (mix.size() < 2) {
2299 bool this_change =
true;
2300 while (this_change) {
2301 this_change =
false;
2304 CSeq_loc::TMix::Tdata::iterator
a = mix.begin();
2305 CSeq_loc::TMix::Tdata::iterator
b =
a;
2307 while (
b != mix.end()) {
2316 a_strand == b_strand) {
2320 a->Reset(
b->GetPointer());
2328 a->Reset(
b->GetPointer());
2348 bool any_change =
false;
2349 switch (loc.
Which()) {
2388 if ((*it)->IsLiteral()) {
2389 offset += (*it)->GetLiteral().GetLength();
2390 if (!(*it)->GetLiteral().IsSetSeq_data()) {
2392 }
else if ((*it)->GetLiteral().GetSeq_data().IsGap()) {
2395 }
else if ((*it)->IsLoc()) {
2402 if (left >= last_gap_stop && left - last_gap_stop <= 3) {
2404 extend_len = left - last_gap_stop;
2416 extend_len = seq.
GetLength() - right - 1;
2424 if ((*it)->IsLiteral()) {
2425 if (!(*it)->GetLiteral().IsSetSeq_data()) {
2427 }
else if ((*it)->GetLiteral().GetSeq_data().IsGap()) {
2430 offset += (*it)->GetLiteral().GetLength();
2431 }
else if ((*it)->IsLoc()) {
2434 if (
offset > right + 4) {
2438 if (next_gap_start > right && next_gap_start - right - 1 <= 3) {
2440 extend_len = next_gap_start - right - 1;
2462 bool extendable =
false;
2468 new_start = start - extend_len;
2471 if (start < seq->GetInst().
GetLength() - 1) {
2473 new_start = start + extend_len;
2479 for (
auto it : related_features) {
2483 it->SetLocation().Assign(*related_loc);
2484 if (it->IsSetData() && it->GetData().IsCdregion()) {
2512 size_t num_intervals = last_l.
GetSize();
2513 last_l.
SetPos(num_intervals - 1);
2521 bool extendable =
false;
2525 if (stop < seq->GetInst().
GetLength() - 1) {
2527 new_stop = stop + extend_len;
2532 new_stop = stop - extend_len;
2538 for (
auto it : related_features) {
2542 it->SetLocation().Assign(*related_loc);
2569 size_t num_intervals = last_l.
GetSize();
2570 last_l.
SetPos(num_intervals - 1);
2587 bool any_change =
false;
2591 if (
f->GetData().IsCdregion()) {
2594 vector<CRef<CSeq_feat> > related_features;
2598 related_features.push_back(new_gene);
2603 related_features.push_back(new_mRNA);
2606 new_cds->
Assign(*(
f->GetOriginalSeq_feat()));
2611 if (adjusted_5prime || adjusted_3prime) {
2617 geh.
Replace(*(related_features.front()));
2621 meh.
Replace(*(related_features.back()));
User-defined methods of the data storage class.
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
@ eExtreme_Biological
5' and 3'
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
TSeqPos GetLength(void) const
void GetLabel(string *label, TSeqPos pos, bool right=true) const
static CRef< CSeq_loc > ConvertToOrder(const CSeq_loc &orig_loc, bool &changed)
bool Interpret5Policy(const CSeq_feat &orig_feat, CScope &scope, bool &do_set_5_partial, bool &do_clear_5_partial) const
@ eMergePolicy_SingleInterval
static bool HasNulls(const CSeq_loc &orig_loc)
static bool Extend3(CSeq_feat &feat, CScope &scope)
static bool Extend5(CSeq_feat &feat, CScope &scope)
static CRef< CSeq_loc > ConvertToJoin(const CSeq_loc &orig_loc, bool &changed)
EPartialPolicy m_PartialPolicy3
static bool Is3AtEndOfSeq(const CSeq_loc &loc, CBioseq_Handle bsh)
static bool Is5AtEndOfSeq(const CSeq_loc &loc, CBioseq_Handle bsh)
EPartialPolicy m_PartialPolicy5
@ ePartialPolicy_eSetForFrame
@ ePartialPolicy_eSetAtEnd
@ ePartialPolicy_eNoChange
@ ePartialPolicy_eSetForBadEnd
@ ePartialPolicy_eClearForGoodEnd
@ ePartialPolicy_eClearNotAtEnd
EMergePolicy m_MergePolicy
bool Interpret3Policy(const CSeq_feat &orig_feat, CScope &scope, bool &do_set_3_partial, bool &do_clear_3_partial) const
bool ApplyPolicyToFeature(CSeq_feat &feat, CScope &scope) const
bool IsReverseStrand(void) const
ESubtype GetSubtype(void) const
CSeq_feat_EditHandle –.
namespace ncbi::objects::
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
bool IsReverseStrand(void) const
static const char location[]
Include a standard set of the NCBI C++ Toolkit most basic headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static const char * pack(const char *fmt,...)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
const string AsFastaString(void) const
CConstRef< CSeq_id > GetSeqId(void) const
E_SIC Compare(const CSeq_id &sid2) const
Compare() - more general.
@ e_YES
SeqIds compared, but are different.
void SetPacked_int(TPacked_int &v)
void InvalidateCache(void) const
Combine invalidation of all cached values.
void SetPacked_pnt(TPacked_pnt &v)
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
CConstRef< CSeq_loc > GetRangeAsSeq_loc(void) const
Get seq-loc for the current iterator position.
bool IsSetStrand(void) const
Get strand.
void Add(const CSeq_loc &other)
Simple adding of seq-locs.
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
void SetPos(size_t pos)
Set iterator's position.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
size_t GetSize(void) const
Get number of ranges.
TRange GetRange(void) const
Get the range.
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
ENa_strand GetStrand(void) const
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
void SetPartialStop(bool val, ESeqLocExtremes ext)
void SetNull(void)
Override all setters to incorporate cache invalidation.
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
bool RetranslateCDS(const CSeq_feat &cds, CScope &scope)
RetranslateCDS A function to replace the protein Bioseq pointed to by cds.product with the current tr...
bool AdjustFeaturePartialFlagForLocation(CSeq_feat &new_feat)
AdjustFeaturePartialFlagForLocation A function to ensure that Seq-feat.partial is set if either end o...
bool AdjustForCDSPartials(const CSeq_feat &cds, CSeq_entry_Handle seh)
AdjustForCDSPartials A function to make all of the necessary related changes to a Seq-entry after the...
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
CRef< CSeq_loc > Seq_loc_Add(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Add two seq-locs.
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eSame
CSeq_locs contain each other.
CConstRef< CSeq_feat > GetOverlappingGene(const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing=eTransSplicing_Auto)
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
TSeqPos GetBioseqLength(void) const
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
TInst_Length GetInst_Length(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
const TInst & GetInst(void) const
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
@ eNocase
Case insensitive compare.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
bool IsSetAnticodon(void) const
location of anticodon Check if a value has been assigned to Anticodon data member.
void SetAnticodon(TAnticodon &value)
Assign a value to Anticodon data member.
void ResetAnticodon(void)
Reset Anticodon data member.
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 IsCdregion(void) const
Check if variant Cdregion is selected.
void ResetCode_break(void)
Reset Code_break data member.
const TLocation & GetLocation(void) const
Get the Location member data.
list< CRef< CCode_break > > TCode_break
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
TCode_break & SetCode_break(void)
Assign a value to Code_break data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
const TCode_break & GetCode_break(void) const
Get the Code_break member data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsSetCode_break(void) const
individual exceptions Check if a value has been assigned to Code_break data member.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
@ eFrame_not_set
not set, code uses one
@ eFrame_three
reading frame
bool IsSet(void) const
Check if a value has been assigned to data member.
void SetTo(TTo value)
Assign a value to To data member.
const TFuzz_from & GetFuzz_from(void) const
Get the Fuzz_from member data.
void SetPoint(TPoint value)
Assign a value to Point data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetA(TA &value)
Assign a value to A data member.
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
void ResetFuzz_to(void)
Reset Fuzz_to data member.
bool IsMix(void) const
Check if variant Mix is selected.
bool CanGetFuzz_to(void) const
Check if it is safe to call GetFuzz_to method.
const TB & GetB(void) const
Get the B member data.
list< CRef< CSeq_interval > > Tdata
ENa_strand
strand of nucleic acid
const Tdata & Get(void) const
Get the member data.
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
void ResetPoints(void)
Reset Points data member.
TStrand GetStrand(void) const
Get the Strand member data.
const TId & GetId(void) const
Get the Id member data.
bool IsSetPoint(void) const
Check if a value has been assigned to Point data member.
bool IsSetPoints(void) const
Check if a value has been assigned to Points data member.
bool IsPacked_pnt(void) const
Check if variant Packed_pnt is selected.
Tdata & Set(void)
Assign a value to data member.
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
const TFuzz_to & GetFuzz_to(void) const
Get the Fuzz_to member data.
bool IsSetA(void) const
connection to a least one residue Check if a value has been assigned to A data member.
void SetStrand(TStrand value)
Assign a value to Strand data member.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
TFrom GetFrom(void) const
Get the From member data.
bool CanGetTo(void) const
Check if it is safe to call GetTo method.
void SetFuzz(TFuzz &value)
Assign a value to Fuzz data member.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
list< CRef< CSeq_loc > > Tdata
bool IsEquiv(void) const
Check if variant Equiv is selected.
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
const TId & GetId(void) const
Get the Id member data.
bool IsSet(void) const
Check if a value has been assigned to data member.
void SetFrom(TFrom value)
Assign a value to From data member.
bool IsBond(void) const
Check if variant Bond is selected.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
const Tdata & Get(void) const
Get the member data.
const TPacked_pnt & GetPacked_pnt(void) const
Get the variant data.
void SetFuzz(TFuzz &value)
Assign a value to Fuzz data member.
const Tdata & Get(void) const
Get the member data.
void ResetFuzz_from(void)
Reset Fuzz_from data member.
const TEquiv & GetEquiv(void) const
Get the variant data.
TPoints & SetPoints(void)
Assign a value to Points data member.
list< CRef< CSeq_loc > > Tdata
vector< TSeqPos > TPoints
virtual void Reset(void)
Reset the whole object.
void SetFuzz_to(TFuzz_to &value)
Assign a value to Fuzz_to data member.
void SetFuzz_from(TFuzz_from &value)
Assign a value to Fuzz_from data member.
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
const TA & GetA(void) const
Get the A member data.
bool IsSetTo(void) const
Check if a value has been assigned to To data member.
bool IsSet(void) const
Check if a value has been assigned to data member.
bool CanGetB(void) const
Check if it is safe to call GetB method.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
Tdata & Set(void)
Assign a value to data member.
bool IsSetFuzz_to(void) const
Check if a value has been assigned to Fuzz_to data member.
void Reset(void)
Reset data member.
Tdata & Set(void)
Assign a value to data member.
void ResetFrom(void)
Reset From data member.
const TPoints & GetPoints(void) const
Get the Points member data.
TStrand GetStrand(void) const
Get the Strand member data.
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
TTo GetTo(void) const
Get the To member data.
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsNull(void) const
Check if variant Null is selected.
void SetB(TB &value)
Assign a value to B data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
bool IsSetFuzz_from(void) const
Check if a value has been assigned to Fuzz_from data member.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
const TMix & GetMix(void) const
Get the variant data.
void ResetTo(void)
Reset To data member.
bool IsPnt(void) const
Check if variant Pnt is selected.
bool IsSetB(void) const
other end may not be available Check if a value has been assigned to B data member.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
const TBond & GetBond(void) const
Get the variant data.
bool CanGetFrom(void) const
Check if it is safe to call GetFrom method.
bool CanGetFuzz_from(void) const
Check if it is safe to call GetFuzz_from method.
@ eNa_strand_both_rev
in reverse orientation
@ e_not_set
No variant selected.
@ e_Equiv
equivalent sets of locations
@ e_Empty
to NULL one Seq-id in a collection
@ e_Feat
indirect, through a Seq-feat
TRepr GetRepr(void) const
Get the Repr member data.
const TInst & GetInst(void) const
Get the Inst member data.
bool IsSetRepr(void) const
Check if a value has been assigned to Repr data member.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
TLength GetLength(void) const
Get the Length member data.
bool IsDelta(void) const
Check if variant Delta is selected.
const TExt & GetExt(void) const
Get the Ext member data.
const TDelta & GetDelta(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
list< CRef< CDelta_seq > > Tdata
@ eRepr_delta
sequence made by changes (delta) to others
unsigned int
A callback function used to compare two keys in a database.
CRef< CSeq_loc > SeqLocExtend5(const CSeq_loc &loc, TSeqPos pos, CScope *scope)
bool IsExtendableRight(TSeqPos right, const CBioseq &seq, CScope *scope, TSeqPos &extend_len)
bool IsExtendableLeft(TSeqPos left, const CBioseq &seq, CScope *scope, TSeqPos &extend_len)
void AdjustFrameFor5Extension(CSeq_feat &feat, size_t diff)
bool OkToAdjustLoc(const CSeq_interval &interval, const CSeq_id *seqid)
void SeqLocAdjustForInsert(CSeq_interval &interval, TSeqPos insert_from, TSeqPos insert_to, const CSeq_id *seqid)
void CdregionAdjustForTrim(CCdregion &cdr, TSeqPos from, TSeqPos to, const CSeq_id *seqid)
void ReverseComplementCDRegion(CCdregion &cdr, CScope &scope)
bool AdjustFeatureEnd3(CSeq_feat &cds, vector< CRef< CSeq_feat > > related_features, CScope &scope)
void FeatureAdjustForInsert(CSeq_feat &feat, TSeqPos from, TSeqPos to, const CSeq_id *seqid)
bool ExtendPartialFeatureEnds(CBioseq_Handle bsh)
bool s_StrandsConsistent(const CSeq_interval &a, const CSeq_interval &b)
void ReverseComplementFeature(CSeq_feat &feat, CScope &scope)
bool s_PPntCompareMinus(const TSeqPos &p1, const TSeqPos &p2)
string PrintSeqIntUseBestID(const CSeq_interval &seq_int, CScope &scope, bool range_only)
void TrnaAdjustForTrim(CTrna_ext &trna, TSeqPos from, TSeqPos to, const CSeq_id *seqid)
void SeqLocAdjustForTrim(CSeq_interval &interval, TSeqPos cut_from, TSeqPos cut_to, const CSeq_id *seqid, bool &bCompleteCut, TSeqPos &trim5, bool &bAdjusted)
void NormalizeLoc(CSeq_loc &loc)
bool CorrectIntervalOrder(CPacked_seqpnt &ppnt)
bool AdjustFeatureEnd5(CSeq_feat &cds, vector< CRef< CSeq_feat > > related_features, CScope &scope)
string PrintBestSeqId(const CSeq_id &sid, CScope &scope)
void TrnaAdjustForInsert(CTrna_ext &trna, TSeqPos from, TSeqPos to, const CSeq_id *seqid)
bool OneIdOneStrand(const CSeq_loc &loc, const CSeq_id **id, ENa_strand &strand)
void ReverseComplementLocation(CSeq_interval &interval, CScope &scope)
bool ApplyPolicyToFeature(const CLocationEditPolicy &policy, const CSeq_feat &orig_feat, CScope &scope, bool adjust_gene, bool retranslate_cds)
bool IsExtendable(const CSeq_feat &cds, CScope &scope)
string SeqLocPrintUseBestID(const CSeq_loc &seq_loc, CScope &scope, bool range_only)
CRef< CSeq_loc > SeqLocExtend3(const CSeq_loc &loc, TSeqPos pos, CScope *scope)
string PrintPntAndPntsUseBestID(const CSeq_loc &seq_loc, CScope &scope, bool range_only)
bool s_PPntComparePlus(const TSeqPos &p1, const TSeqPos &p2)
void FeatureAdjustForTrim(CSeq_feat &feat, TSeqPos from, TSeqPos to, const CSeq_id *seqid, bool &bCompleteCut, bool &bTrimmed)
void CdregionAdjustForInsert(CCdregion &cdr, TSeqPos from, TSeqPos to, const CSeq_id *seqid)
static const string strand_symbol[]
void ReverseComplementTrna(CTrna_ext &trna, CScope &scope)
CRef< CSeq_interval > SplitLocationForGap(CSeq_interval &before, TSeqPos start, TSeqPos stop, const CSeq_id *seqid, bool &cut, unsigned int options)
CRef< CSeq_loc > SeqLocExtend(const CSeq_loc &loc, size_t pos, CScope *scope)
@ eSplitLocOption_split_in_intron
@ eSplitLocOption_make_partial
@ eSplitLocOption_split_in_exon
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
double f(double x_, const double &y_)
Generic utility macros and templates for exploring NCBI objects.
bool seq_mac_is_sorted(Iter first, Iter last, Comp comp)