82 if (
si->GetClass() == clss ) {
133 gi = scope->
GetGi (idh);
135 }
catch (std::exception &) {
151 id_list = scope->
GetIds(tmp_id);
154 }
catch (std::exception &) {
187 const CSeq_loc& part = citer.GetEmbeddingSeq_loc();
305 if (pSubEntry->IsSeq()) {
306 const auto& inst = pSubEntry->GetSeq().GetInst();
308 return &(pSubEntry->GetSeq());
316 if (pSubEntry->IsSeq() && pSubEntry->GetSeq().IsNa()) {
317 return &pSubEntry->GetSeq();
318 }
else if (pSubEntry->IsSet() &&
319 pSubEntry->GetSet().IsSetClass() &&
326 if (pSubEntry->IsSeq()) {
327 return &pSubEntry->GetSeq();
333 if (pSubEntry->IsSeq()) {
334 return &pSubEntry->GetSeq();
355 const auto& descs = entry.
GetDescr();
356 for (
auto& it : descs.Get()) {
357 if (it->Equals(desc)) {
371 }
else if (seh.
IsSeq()) {
392 for (
CAlign_CI align_it(seh); align_it; ++align_it) {
393 if (&(*align_it) == &align) {
409 for (
int i = 0;
i < align.
GetDim(); ++
i) {
462 }
else if (
ctx->IsSet()) {
485 }
else if (entry.
IsSet()) {
498 }
else if (seh.
IsSet()) {
544 }
else if (!parent.
IsSet()) {
563 }
else if (!parent.
IsSet()) {
631 }
else if (accession.length() >= 16) {
633 }
else if (accession.length() < 3
634 || !
isalpha (accession.c_str()[0])
635 || !
isupper (accession.c_str()[0])) {
639 string str = accession;
644 const char *cp =
str.c_str();
665 if ((*cp !=
'\0' && *cp !=
' ' && *cp !=
'.') || numUndersc > 1) {
669 if (require_version) {
679 if (numVersion < 1) {
681 }
else if (*cp !=
'\0' && *cp !=
' ') {
687 if (numUndersc == 0) {
688 if ((numAlpha == 1 && numDigits == 5)
689 || (numAlpha == 2 && numDigits == 6)
690 || (numAlpha == 3 && numDigits == 5)
691 || (numAlpha == 4 && numDigits == 8)
692 || (numAlpha == 5 && numDigits == 7)) {
696 if (numAlpha != 2 || (numDigits != 6 && numDigits != 8 && numDigits != 9)) {
699 char first_letter = accession.c_str()[0];
700 char second_letter = accession.c_str()[1];
701 if (first_letter ==
'N' || first_letter ==
'X' || first_letter ==
'Z') {
702 if (second_letter ==
'M' || second_letter ==
'C'
703 || second_letter ==
'T' || second_letter ==
'P'
704 || second_letter ==
'G' || second_letter ==
'R'
705 || second_letter ==
'S' || second_letter ==
'W'
706 || second_letter ==
'Z') {
710 if ((first_letter ==
'A' || first_letter ==
'Y')
711 && second_letter ==
'P') {
737 if (pos == string::npos) {
741 const char *ptr =
str.c_str() + pos + 6;
742 unsigned int numdigits = 0;
743 while (*ptr != 0 && *ptr !=
')') {
750 if (*ptr ==
')' && numdigits > 0) {
791 }
else if (date.
IsStd()) {
792 const auto& sdate = date.
GetStd();
793 if (!sdate.IsSetYear() || sdate.GetYear() < 1000) {
796 if (sdate.IsSetMonth() && sdate.GetMonth() > 12) {
799 if (sdate.IsSetDay() && sdate.GetDay() > 31) {
802 if (require_full_date) {
803 if (!sdate.IsSetMonth() || sdate.GetMonth() == 0) {
806 if (!sdate.IsSetDay() || sdate.GetDay() == 0) {
810 if (sdate.IsSetSeason() && !
NStr::IsBlank (sdate.GetSeason())) {
811 const char * cp = sdate.GetSeason().c_str();
813 if (
isalpha (*cp) || *cp ==
'-') {
836 bool in_past =
false;
840 const auto & sdate = date.
GetStd();
841 if (sdate.GetYear() < tm->tm_year + 1900) {
843 }
else if (sdate.GetYear() == tm->tm_year + 1900
844 && sdate.IsSetMonth()) {
845 if (sdate.GetMonth() < tm->tm_mon + 1) {
847 }
else if (sdate.GetMonth() == tm->tm_mon + 1
848 && sdate.IsSetDay()) {
849 if (sdate.GetDay() < tm->tm_mday) {
863 reasons +=
"EMPTY_DATE ";
866 reasons +=
"BAD_STR ";
869 reasons +=
"BAD_YEAR ";
872 reasons +=
"BAD_MONTH ";
875 reasons +=
"BAD_DAY ";
878 reasons +=
"BAD_SEASON ";
881 reasons +=
"BAD_OTHER ";
896 while (desc_ci && !is_tsa) {
909 bool IsNCBIFILESeqId (
const CSeq_id&
id)
911 if (!
id.IsGeneral() || !
id.GetGeneral().IsSetDb()
912 || !
NStr::Equal(
id.GetGeneral().GetDb(),
"NCBIFILE")) {
923 if (
id.GetTextseq_Id()) {
933 bool any_change =
false;
942 for (
auto& id_it : ids) {
988 int num_ids_found = 0;
989 bool id_found =
false;
991 const auto& id_list = sq.
GetId();
994 for (
auto id_it : id_list) {
997 id_it->WriteAsFasta(os);
1005 for (
auto id_it : id_list) {
1006 if (id_it->IsGenbank()
1009 || id_it->IsSwissprot()
1013 || id_it->IsTpg()) {
1014 if (num_ids_found > 0) {
1018 id_it->WriteAsFasta(os);
1026 if (num_ids_found == 0) {
1028 for (
auto id_it : id_list) {
1029 if (id_it->IsGeneral()) {
1030 if (num_ids_found > 0) {
1034 id_it->WriteAsFasta(os);
1043 if (num_ids_found == 0) {
1044 bool found_local =
false;
1045 for (
auto id_it : id_list) {
1046 if (id_it->IsLocal()) {
1057 id_it->WriteAsFasta(os);
1074 if (!supress_context) {
1075 if (!content.empty()) {
1080 tv = CSeq_inst::GetTypeInfo_enum_ERepr();
1083 tv = CSeq_inst::GetTypeInfo_enum_EMol();
1099 bool is_ambig =
false;
1104 string::const_iterator sit =
str.begin();
1105 while (sit !=
str.end() && !rval) {
1113 }
else if (*sit ==
'-') {
1116 }
else if (*sit ==
'n') {
1119 }
else if (*sit ==
'.') {
1121 if (numdigits > 0 && numdashes > 0) {
1124 }
else if (numdigits == 0 && numdashes == 0) {
1127 }
else if (numdashes > 1) {
1134 if (numperiods == 3) {
1135 if (numdigits > 0 && numdashes > 0) {
1137 }
else if (numdigits > 0 || numdashes == 1) {
1148 if (numperiods == 3) {
1149 if (numdigits > 0 && numdashes > 0) {
1151 }
else if (numdigits > 0 || numdashes == 1) {
1161 bool is_patent =
false;
1165 if ((*id_it)->IsPatent()) {
1193 for (
CSeq_loc_CI sl_iter(loc); sl_iter; ++sl_iter ) {
1200 if (
first.GetStrand() !=
last.GetStrand() ) {
1232 swap(acceptor, donor);
1233 stop =
len - donor - 1;
1234 start =
len - acceptor - 1;
1245 }
catch ( exception& ) {
1261 }
catch ( exception& ) {
1272 }
catch ( exception& ) {
1286 const CSeq_id&
id = citer.GetSeq_id();
1299 if (pos >= vec.
size()) {
1301 }
else if (vec[pos] !=
'N' && vec[pos] !=
'n') {
1303 }
else if (vec.
IsInGap(pos)) {
1334 begin_ambig =
false;
1337 if (vec.
size() < 10) {
1346 for (
int i = 0;
i < 10;
i++) {
1357 for (
unsigned int i = vec.
size() - 11;
i < vec.
size();
i++) {
1369 for (
unsigned int i = 0;
i < 10;
i++) {
1380 for (
unsigned int i = vec.
size() - 10;
i < vec.
size();
i++) {
1389 size_t check_len = 50;
1390 if (vec.
size() < 50) {
1391 check_len = vec.
size();
1394 for (
size_t i = 0;
i < check_len;
i++) {
1395 if (vec[
i] ==
'N') {
1397 if (num_ns >= 5 &&
i < 10) {
1400 }
else if (num_ns >= 15) {
1407 for (
size_t i = 0;
i < check_len;
i++) {
1408 if (vec[vec.
size() -
i - 1] ==
'N') {
1410 if (num_ns >= 5 &&
i < 10) {
1413 }
else if (num_ns >= 15) {
1420 }
catch (exception&) {
1439 begin_ambig =
false;
1449 }
catch ( exception& ) {
1469 bool loc1_partial_start =
1471 bool loc1_partial_stop =
1473 bool loc2_partial_start =
1475 bool loc2_partial_stop =
1477 if (loc1_partial_start == loc2_partial_start &&
1478 loc1_partial_stop == loc2_partial_stop) {
1505 const auto& annot1 = f1.
GetAnnot();
1506 const auto& annot2 = f2.
GetAnnot();
1507 bool rval = annot1 == annot2;
1508 diff_descriptions =
false;
1510 if ((!annot1.Seq_annot_IsSetDesc() || annot1.Seq_annot_GetDesc().Get().empty()) &&
1511 (!annot2.Seq_annot_IsSetDesc() || annot2.Seq_annot_GetDesc().Get().empty())) {
1513 diff_descriptions =
false;
1514 }
else if (annot1.Seq_annot_IsSetDesc() && annot2.Seq_annot_IsSetDesc()) {
1517 const auto d2 = annot2.Seq_annot_GetDesc().Get().front();
1518 if (d1->Which() != d2->Which()) {
1519 diff_descriptions =
true;
1523 diff_descriptions =
false;
1524 }
else if (d1->IsTitle()
1526 diff_descriptions =
false;
1528 diff_descriptions =
true;
1532 diff_descriptions =
true;
1547 CSeq_feat::TQual::const_iterator gb1 = feat1.
GetQual().begin();
1548 CSeq_feat::TQual::const_iterator gb1_end = feat1.
GetQual().end();
1549 CSeq_feat::TQual::const_iterator gb2 = feat2.
GetQual().begin();
1550 CSeq_feat::TQual::const_iterator gb2_end = feat2.
GetQual().end();
1552 while ((gb1 != gb1_end) && (gb2 != gb2_end) && rval) {
1553 if (!(*gb1)->IsSetQual()) {
1554 if ((*gb2)->IsSetQual()) {
1557 }
else if (!(*gb2)->IsSetQual()) {
1559 }
else if (!
NStr::Equal ((*gb1)->GetQual(), (*gb2)->GetQual())) {
1563 string v1 = (*gb1)->IsSetVal() ? (*gb1)->GetVal() :
"";
1564 string v2 = (*gb2)->IsSetVal() ? (*gb2)->GetVal() :
"";
1572 if (gb1 != gb1_end || gb2 != gb2_end) {
1587 bool same_label =
true;
1588 const string& curr_comment =
1590 const string& prev_comment =
1603 if (!comments_same || !labels_same) {
1614 if (list1.empty() || list2.empty()) {
1616 }
else if (list1.size() != list2.size()) {
1620 TDbtags::const_iterator it1 = list1.begin();
1621 TDbtags::const_iterator it2 = list2.begin();
1622 for (; it1 != list1.end(); ++it1, ++it2) {
1627 (*it1)->GetTag().IsStr() ? (*it1)->GetTag().GetStr() :
"";
1629 (*it2)->GetTag().IsStr() ? (*it2)->GetTag().GetStr() :
"";
1630 if ( str1.empty() && str2.empty() ) {
1631 if (!(*it1)->GetTag().IsId() && !(*it2)->GetTag().IsId()) {
1633 }
else if ((*it1)->GetTag().IsId() && (*it2)->GetTag().IsId()) {
1634 if ((*it1)->GetTag().GetId() != (*it2)->GetTag().GetId()) {
1650 const auto & f1data = f1.
GetData();
1651 const auto & f2data = f2.
GetData();
1652 if (!f1data.IsCdregion() || !f2data.IsCdregion()) {
1656 const auto & cd2 = f2data.GetCdregion();
1658 int frame1 = 1, frame2 = 1;
1659 if (cd1.IsSetFrame()) {
1665 if (cd2.IsSetFrame()) {
1666 frame2 = cd2.GetFrame();
1671 if (frame1 == frame2) {
1694 if ((*q)->IsSetQual() &&
NStr::Equal((*q)->GetQual(),
"replace") && (*q)->IsSetVal()) {
1698 replace += (*q)->GetVal();
1741 list<CSeq_feat_Handle> mrna1;
1742 list<CSeq_feat_Handle> mrna2;
1745 if ((*itx)->IsSetId() && (*itx)->GetId().IsLocal()) {
1748 ITERATE( vector<CSeq_feat_Handle>, feat_it, handles ) {
1749 if (feat_it->IsSetData()
1750 && feat_it->GetData().GetSubtype() == s2) {
1751 mrna1.push_back(*feat_it);
1753 mrna1_id.push_back (
f);
1760 if ((*itx)->IsSetId() && (*itx)->GetId().IsLocal()) {
1763 ITERATE( vector<CSeq_feat_Handle>, feat_it, handles ) {
1764 if (feat_it->IsSetData()
1765 && feat_it->GetData().GetSubtype() == s2) {
1766 mrna2.push_back(*feat_it);
1768 mrna2_id.push_back (
f);
1774 if (mrna1_id.size() > 0 && mrna2_id.size() > 0) {
1776 for (
auto i1 = mrna1_id.begin(); i1 != mrna1_id.end(); ++i1) {
1777 for (
auto i2 = mrna2_id.begin(); i2 != mrna2_id.end(); ++i2) {
1778 if ((*i1)->Equals(**i2)) {
1833 if (!
f.IsSetExcept())
return false;
1834 if (!
f.IsSetExcept_text())
return false;
1836 const string& except_text =
f.GetExcept_text();
1847 bool check_partials,
1848 bool case_sensitive)
1858 if (feat1_subtype != feat2_subtype) {
1874 bool diff_annot_desc =
false;
1877 if (diff_annot_desc) {
1894 bool full_length_coding_regions_with_different_frames =
1896 if (!same_label && full_length_coding_regions_with_different_frames) {
1925 bool partials_ok = (!check_partials ||
PartialsSame(feat1_loc, feat2_loc));
1952 bool is_common =
false;
1956 if ((*status_it)->IsSetProperty()
1958 if ((*status_it)->IsSetValue() && (*status_it)->GetValue().IsStr()) {
1959 string value_str = (*status_it)->GetValue().GetStr();
1974 bool has_misspell_flag =
false;
1978 if ((*status_it)->IsSetProperty()) {
1979 string prop = (*status_it)->GetProperty();
1981 has_misspell_flag =
true;
1987 return has_misspell_flag;
2011 for (
const auto& mod_it : orgname.
GetMod()) {
2012 if (mod_it->IsSetSubtype()
2015 && mod_it->IsSetSubname()
2017 match = mod_it->GetSubname();
2064 if (pos != string::npos) {
2065 host = host.substr(0, pos);
2070 if (pos == string::npos) {
2084 if (pos != string::npos) {
2085 host = host.substr(0, pos);
2088 host = host.substr(0, pos);
2103 err_str =
"Specific host value is ambiguous: " +
2106 err_str =
"Invalid value for specific host: " +
2109 }
else if (reply.
IsData()) {
2110 const auto& rdata = reply.
GetData();
2112 err_str =
"Specific host value is misspelled: " +
2114 }
else if (rdata.IsSetOrg()) {
2115 const auto& org = rdata.
GetOrg();
2122 err_str =
"Specific host value is alternate name: " +
2123 orig_host +
" should be " +
2126 err_str =
"Specific host value is incorrectly capitalized: " +
2130 err_str =
"Invalid value for specific host: " +
2140 bool is_common =
false;
2146 if (it->IsSetSubtype() &&
2148 it->IsSetSubname() &&
2176 bool is_species =
false;
2177 bool is_uncultured =
false;
2199 string hostfix =
val;
2200 validator::CTaxValidationAndCleanup tval;
2201 tval.FixOneSpecificHost(hostfix);
2209 if (ch < 0x02 || ch > 0x7F) {
2218 else if (ch ==
'\'' || ch ==
'/' || ch ==
'@' || ch ==
'`' || ch ==
',') {
2230 string::iterator s = title.begin();
2232 while (s != title.end()) {
2252 const auto& gcode = cdr.
GetCode();
2254 for (
auto& it : gcode.Get()) {
2256 genCode = it->GetId();
2262 }
else if (genCode == 8) {
2264 }
else if (genCode == 0) {
2269 new_code->SetId(genCode);
2270 cdr.
SetCode().Set().push_back(new_code);
2291 }
else if (cdregion.
GetFrame() == 3) {
2297 genetic_code = &(cdregion.
GetCode());
2316 bool got_dash = (transl_prot[0] ==
'-');
2317 bool got_x = (transl_prot[0] ==
'X'
2320 if (!got_dash && !got_x) {
2331 "adjusted for low-quality genome",
2332 "annotated by transcript or proteomic data",
2333 "rearrangement required for product",
2334 "reasons given in citation",
2335 "translated product replaced",
2342 "artificial frameshift",
2343 "mismatches in translation"
2388 bool alt_start =
false;
2406 size_t internal_stop_count = 0;
2408 ITERATE(
string, it, transl_prot) {
2410 ++internal_stop_count;
2414 if (transl_prot[transl_prot.length() - 1] ==
'*') {
2415 --internal_stop_count;
2417 return internal_stop_count;
2444 bool alt_start =
false;
2453 if (internal_stop_codons > 0) {
2476 if (sv.
size() < 1) {
2478 }
else if (sv.
IsInGap(0) || sv[0] ==
'-') {
2513 size_t terminations = 0;
2516 if (*sv_iter ==
'*') {
2520 return terminations;
2588 const CSeq_id* protid =
nullptr;
2594 if (!prot_handle && far_fetch) {
2606 len = transl_prot.length();
2607 prot_len = prot_vec.
size();
2613 if (transl_prot[
len - 1] ==
'X') {
2621 while (prot_len > 0) {
2622 if (prot_vec[prot_len - 1] ==
'X') {
2635 vector<TSeqPos> mismatches;
2641 if (
len == prot_len) {
2646 if (t_res != p_res) {
2648 bool no_beg, no_end;
2651 }
else if (t_res ==
'-') {
2653 mismatches.push_back(
i);
2656 mismatches.push_back(
i);
2667 vector<TSeqPos> mismatches;
2669 if (!prot_handle || !prot_handle.
IsAa()) {
2682 bool no_beg, no_end;
2698 bool show_stop =
true;
2704 bool is_far =
false;
2707 vector<TSeqPos> mismatches =
GetMismatches(feat, prot_handle, transl_prot);
2708 if (mismatches.size() == 0) {
2723 bool fetchable =
false;
2728 if (ids.size() > 0) {
2741 }
catch (std::exception &) {
2749 bool fetchable =
false;
2756 }
catch (std::exception &) {
2775 if (
id.IsOther() &&
id.GetOther().IsSetAccession() &&
2799 if (
id.IsOther() &&
id.GetOther().IsSetAccession() &&
2812 if (
IsNG(**id_it)) {
2826 if (
id.IsGeneral() &&
id.GetGeneral().IsSetDb()) {
2827 const string& db =
id.GetGeneral().GetDb();
2881 return (
bool)(strchr(
"ANRMWHVD", ch) !=
NULL);
2887 return (
bool)(strchr(
"CNYMSHBV", ch) !=
NULL);
2893 return (
bool)(strchr(
"GNRKSBVD", ch) !=
NULL);
2899 return (
bool)(strchr(
"TNYKWHBD", ch) !=
NULL);
2935 size_t mismatches = 0;
2942 (feat, mismatches,
false,
2943 nuc,
rna,
false,
false,
false, &scope);
2986 switch (acc.length()) {
3012 switch (
id.Which()) {
3014 if (
id.GetOther().IsSetAccession()) {
3015 const string& acc =
id.GetOther().GetAccession();
3016 switch (acc.length()) {
3034 if (
id.GetGenbank().IsSetAccession()) {
3039 if (
id.GetDdbj().IsSetAccession()) {
3044 if (
id.GetEmbl().IsSetAccession()) {
3049 if (
id.GetTpg().IsSetAccession()) {
3074 if (!
set.IsSetClass()) {
3081 set =
set.GetParentBioseq_set();
static CRef< CScope > m_Scope
@ eExtreme_Biological
5' and 3'
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void CalculateTranslationProblems(const CSeq_feat &feat, CBioseq_Handle loc_handle, CBioseq_Handle prot_handle, bool ignore_exceptions, bool far_fetch_cds, bool standalone_annot, bool single_seq, bool is_gpipe, bool is_genomic, bool is_refseq, bool is_nt_or_ng_or_nw, bool is_nc, bool has_accession, CScope *scope)
@ eCDSTranslationProblem_UnnecessaryException
size_t GetTranslationProblemFlags() const
FASTA-format output; see also ReadFasta in <objtools/readers/fasta.hpp>
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
int Compare(const CObject_id &oid2) const
bool IsSetOrgMod(void) const
ESubtype GetSubtype(void) const
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
const CSeq_descr & GetDescr(void) const
bool IsSetDescr(void) const
namespace ncbi::objects::
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Base class for all serializable objects.
void CalculateSpliceProblems(const CSeq_feat &feat, bool check_all, bool pseudo, CBioseq_Handle loc_handle)
bool IsExceptionUnnecessary() const
TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
bool IsOneSpecificHostValid(const string &val, string &err_msg)
CConstRef< COrg_ref > GetOrgRef(TTaxId tax_id, bool &is_species, bool &is_uncultured, string &blast_name, bool *is_specified=NULL)
TTaxId GetTaxIdByName(const string &orgname)
Template class for iteration on objects of class C (non-medifiable version)
Include a standard set of the NCBI C++ Toolkit most basic headers.
The NCBI C++ standard methods for dealing with std::string.
static const char si[8][64]
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
const string & FindName(TEnumValueType value, bool allowBadValue) const
Find name of the enum by its numeric value.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string GetLabel(const CSeq_id &id)
@ eFasta
Tagged ID in NCBI's traditional FASTA style.
CRef< CSeq_loc > MakeSeq_loc(EMakeType make_type=eMake_CompactType) const
return constructed CSeq_loc with all changes
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
CConstRef< CSeq_loc > GetRangeAsSeq_loc(void) const
Get seq-loc for the current iterator position.
void SetSeq_id(const CSeq_id &id)
Set seq_id of the current location.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
TRange GetRange(void) const
Get the range.
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...
bool IsPartialStop(ESeqLocExtremes ext) const
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
@ fFGL_Content
Include its content if there is any.
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,...
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
int SeqLocPartialCheck(const CSeq_loc &loc, CScope *scope)
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
bool IsSameBioseq(const CSeq_id &id1, const CSeq_id &id2, CScope *scope, CScope::EGetBioseqFlag get_flag=CScope::eGetBioseq_All)
Determines if two CSeq_ids represent the same CBioseq.
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eSame
CSeq_locs contain each other.
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
virtual void WriteSequence(const CBioseq_Handle &handle, const CSeq_loc *location=0, CSeq_loc::EOpFlags merge_flags=CSeq_loc::fMerge_AbuttingOnly)
void SetFlag(EFlags flag)
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
@ fInstantiateGaps
honor specifed gap mode; on by default
@ fAssembleParts
assemble FAR delta sequences; on by dflt
TIds GetIds(const CSeq_id &id, TGetFlags flags=0)
Get "native" bioseq ids without filtering and matching.
CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id &id, const CTSE_Handle &tse)
Get bioseq handle for sequence withing one TSE.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
CSeq_annot_Handle GetSeq_annotHandle(const CSeq_annot &annot, EMissing action=eMissing_Default)
TGi GetGi(const CSeq_id_Handle &idh, TGetFlags flags=0)
Get GI of a sequence Returns ZERO_GI if the sequence is not found or if it doesn't have GI.
vector< CSeq_id_Handle > TIds
@ eGetBioseq_All
Search bioseq, load if not loaded yet.
bool IsSetComment(void) const
bool IsNucleotide(void) const
const CTSE_Handle & GetTSE_Handle(void) const
Get CTSE_Handle of containing TSE.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TClass GetClass(void) const
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
bool IsSetDbxref(void) const
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
const CSeqFeatData & GetData(void) const
CConstRef< CBioseq_set > GetCompleteBioseq_set(void) const
Return the complete bioseq-set object.
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
virtual const CSeq_loc & GetLocation(void) const
EVectorCoding
CSeqVector constructor flags.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
TInst_Topology GetInst_Topology(void) const
const string & GetComment(void) const
const CSeq_annot::TDesc & Seq_annot_GetDesc(void) const
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
TInst_Length GetInst_Length(void) const
bool IsSetInst_Repr(void) const
bool IsSetClass(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
TInst_Repr GetInst_Repr(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeq_feat::TDbxref & GetDbxref(void) const
bool IsSetQual(void) const
bool IsSetInst_Topology(void) const
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
const CSeq_feat::TQual & GetQual(void) const
CSeq_entry_Handle GetParentEntry(void) const
Get parent 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,...
static CRef< CSeqMap > CreateSeqMapForSeq_loc(const CSeq_loc &loc, CScope *scope)
void SetCoding(TCoding coding)
bool IsNucleotide(void) const
CScope & GetScope(void) const
#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 SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive equality of a substring with another string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
static const char label[]
TGenome GetGenome(void) const
Get the Genome member data.
bool IsSetGenome(void) const
Check if a value has been assigned to Genome data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
bool IsStd(void) const
Check if variant Std is selected.
const TStr & GetStr(void) const
Get the variant data.
const TStd & GetStd(void) const
Get the variant data.
TId GetId(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
const TMod & GetMod(void) const
Get the Mod member data.
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
const TCommon & GetCommon(void) const
Get the Common member data.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
@ eSubtype_gb_synonym
used by taxonomy database
TDim GetDim(void) const
Get the Dim member data.
bool IsSetSegs(void) const
Check if a value has been assigned to Segs data member.
bool IsDendiag(void) const
Check if variant Dendiag is selected.
const TDendiag & GetDendiag(void) const
Get the variant data.
bool IsStd(void) const
Check if variant Std is selected.
bool IsSetDim(void) const
dimensionality Check if a value has been assigned to Dim data member.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetCode(void) const
genetic code used Check if a value has been assigned to Code data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void ResetCode(void)
Reset Code data member.
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
const TLocal & GetLocal(void) const
Get the variant data.
void SetCode(TCode &value)
Assign a value to Code data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsLocal(void) const
Check if variant Local is selected.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
const TCode & GetCode(void) const
Get the Code member data.
void SetData(TData &value)
Assign a value to Data data member.
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
const TCdregion & GetCdregion(void) const
Get the variant data.
bool CanGetExcept_text(void) const
Check if it is safe to call GetExcept_text method.
const TProduct & GetProduct(void) const
Get the Product member data.
bool CanGetExcept(void) const
Check if it is safe to call GetExcept method.
TPartial GetPartial(void) const
Get the Partial member data.
TExcept GetExcept(void) const
Get the Except member data.
vector< CRef< CGb_qual > > TQual
bool CanGetProduct(void) const
Check if it is safe to call GetProduct method.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product 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.
@ e_not_set
No variant selected.
ENa_strand
strand of nucleic acid
const TWhole & GetWhole(void) const
Get the variant data.
TFrom GetFrom(void) const
Get the From member data.
TGi & SetGi(void)
Select the variant.
TTo GetTo(void) const
Get the To member data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
@ e_Other
for historical reasons, 'other' = 'refseq'
@ e_Tpg
Third Party Annot/Seq Genbank.
const TLoc & GetLoc(void) const
Get the Loc member data.
const TSeq & GetSeq(void) const
Get the variant data.
TClass GetClass(void) const
Get the Class member data.
const TSet & GetSet(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
bool IsSetSeq_set(void) const
Check if a value has been assigned to Seq_set data member.
bool IsSet(void) const
Check if variant Set is selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
@ eClass_parts
parts for 2 or 3
@ eClass_nuc_prot
nuc acid and coded proteins
@ eClass_gen_prod_set
genomic products, chrom+mRNA+protein
@ eClass_segset
segmented sequence + parts
@ eClass_small_genome_set
viral segments or mitochondrial minicircles
TRepr GetRepr(void) const
Get the Repr member data.
const Tdata & Get(void) const
Get the member data.
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
ERepr
representation class
const TInst & GetInst(void) const
Get the Inst member data.
const TSource & GetSource(void) const
Get the variant data.
const TId & GetId(void) const
Get the Id member data.
TTech GetTech(void) const
Get the Tech member data.
TLength GetLength(void) const
Get the Length member data.
TMol GetMol(void) const
Get the Mol member data.
bool IsSetLength(void) const
length of sequence in residues Check if a value has been assigned to Length data member.
bool IsSetTech(void) const
Check if a value has been assigned to Tech data member.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
const TMolinfo & GetMolinfo(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
@ eRepr_seg
segmented sequence
@ eRepr_delta
sequence made by changes (delta) to others
@ eTech_tsa
transcriptome shotgun assembly
@ e_not_set
No variant selected.
@ e_Ncbieaa
extended ASCII 1 letter aa codes
@ e_Ncbistdaa
consecutive codes for std aas
@ e_Molinfo
info on the molecule and techniques
@ e_Source
source of materials, includes Org-ref
@ eMol_na
just a nucleic acid
bool IsData(void) const
Check if variant Data is selected.
const TData & GetData(void) const
Get the variant data.
bool IsSetStatus(void) const
Check if a value has been assigned to Status data member.
const TStatus & GetStatus(void) const
Get the Status member data.
list< CRef< CT3StatusFlags > > TStatus
bool IsError(void) const
Check if variant Error is selected.
const TError & GetError(void) const
Get the variant data.
const TOrg & GetOrg(void) const
Get the Org member data.
const TMessage & GetMessage(void) const
Get the Message member data.
bool IsSetMessage(void) const
Check if a value has been assigned to Message data member.
double f(double x_, const double &y_)
const CConstRef< CSeq_id > GetAccession(const CSeq_id_Handle &id_handle)
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
#define FOR_EACH_SEQID_ON_BIOSEQ(Itr, Var)
FOR_EACH_SEQID_ON_BIOSEQ EDIT_EACH_SEQID_ON_BIOSEQ.
#define FOR_EACH_GBQUAL_ON_FEATURE
#define FOR_EACH_SYN_ON_ORGREF(Itr, Var)
FOR_EACH_SYN_ON_ORGREF EDIT_EACH_SYN_ON_ORGREF.
#define FOR_EACH_SEQFEATXREF_ON_SEQFEAT(Itr, Var)
FOR_EACH_SEQFEATXREF_ON_SEQFEAT EDIT_EACH_SEQFEATXREF_ON_SEQFEAT.
static const char * str(char *buf, int n)
size_t GetMRNATranslationProblems(const CSeq_feat &feat, size_t &mismatches, bool ignore_exceptions, CBioseq_Handle nuc, CBioseq_Handle rna, bool far_fetch, bool is_gpipe, bool is_genomic, CScope *scope)
@ eMRNAProblem_UnnecessaryException