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)) {
369 }
else if (seh.
IsSeq()) {
390 for (
CAlign_CI align_it(seh); align_it; ++align_it) {
391 if (&(*align_it) == &align) {
407 for (
int i = 0;
i < align.
GetDim(); ++
i) {
459 }
else if (
ctx->IsSet()) {
482 }
else if (entry.
IsSet()) {
495 }
else if (seh.
IsSet()) {
541 }
else if (!parent.
IsSet()) {
560 }
else if (!parent.
IsSet()) {
628 }
else if (accession.length() >= 16) {
630 }
else if (accession.length() < 3
631 || !
isalpha (accession.c_str()[0])
632 || !
isupper (accession.c_str()[0])) {
636 string str = accession;
641 const char *cp =
str.c_str();
662 if ((*cp !=
'\0' && *cp !=
' ' && *cp !=
'.') || numUndersc > 1) {
666 if (require_version) {
676 if (numVersion < 1) {
678 }
else if (*cp !=
'\0' && *cp !=
' ') {
684 if (numUndersc == 0) {
685 if ((numAlpha == 1 && numDigits == 5)
686 || (numAlpha == 2 && numDigits == 6)
687 || (numAlpha == 3 && numDigits == 5)
688 || (numAlpha == 4 && numDigits == 8)
689 || (numAlpha == 5 && numDigits == 7)) {
693 if (numAlpha != 2 || (numDigits != 6 && numDigits != 8 && numDigits != 9)) {
696 char first_letter = accession.c_str()[0];
697 char second_letter = accession.c_str()[1];
698 if (first_letter ==
'N' || first_letter ==
'X' || first_letter ==
'Z') {
699 if (second_letter ==
'M' || second_letter ==
'C'
700 || second_letter ==
'T' || second_letter ==
'P'
701 || second_letter ==
'G' || second_letter ==
'R'
702 || second_letter ==
'S' || second_letter ==
'W'
703 || second_letter ==
'Z') {
707 if ((first_letter ==
'A' || first_letter ==
'Y')
708 && second_letter ==
'P') {
734 if (pos == string::npos) {
738 const char *ptr =
str.c_str() + pos + 6;
739 unsigned int numdigits = 0;
740 while (*ptr != 0 && *ptr !=
')') {
747 if (*ptr ==
')' && numdigits > 0) {
788 }
else if (date.
IsStd()) {
789 const auto& sdate = date.
GetStd();
790 if (!sdate.IsSetYear() || sdate.GetYear() < 1000) {
793 if (sdate.IsSetMonth() && sdate.GetMonth() > 12) {
796 if (sdate.IsSetDay() && sdate.GetDay() > 31) {
799 if (require_full_date) {
800 if (!sdate.IsSetMonth() || sdate.GetMonth() == 0) {
803 if (!sdate.IsSetDay() || sdate.GetDay() == 0) {
807 if (sdate.IsSetSeason() && !
NStr::IsBlank (sdate.GetSeason())) {
808 const char * cp = sdate.GetSeason().c_str();
810 if (
isalpha (*cp) || *cp ==
'-') {
833 bool in_past =
false;
837 const auto & sdate = date.
GetStd();
838 if (sdate.GetYear() < tm->tm_year + 1900) {
840 }
else if (sdate.GetYear() == tm->tm_year + 1900
841 && sdate.IsSetMonth()) {
842 if (sdate.GetMonth() < tm->tm_mon + 1) {
844 }
else if (sdate.GetMonth() == tm->tm_mon + 1
845 && sdate.IsSetDay()) {
846 if (sdate.GetDay() < tm->tm_mday) {
860 reasons +=
"EMPTY_DATE ";
863 reasons +=
"BAD_STR ";
866 reasons +=
"BAD_YEAR ";
869 reasons +=
"BAD_MONTH ";
872 reasons +=
"BAD_DAY ";
875 reasons +=
"BAD_SEASON ";
878 reasons +=
"BAD_OTHER ";
893 while (desc_ci && !is_tsa) {
906 bool IsNCBIFILESeqId (
const CSeq_id&
id)
908 if (!
id.IsGeneral() || !
id.GetGeneral().IsSetDb()
909 || !
NStr::Equal(
id.GetGeneral().GetDb(),
"NCBIFILE")) {
920 if (
id.GetTextseq_Id()) {
930 bool any_change =
false;
939 for (
auto& id_it : ids) {
984 int num_ids_found = 0;
985 bool id_found =
false;
987 const auto& id_list = sq.
GetId();
990 for (
auto id_it : id_list) {
993 id_it->WriteAsFasta(os);
1001 for (
auto id_it : id_list) {
1002 if (id_it->IsGenbank()
1005 || id_it->IsSwissprot()
1009 || id_it->IsTpg()) {
1010 if (num_ids_found > 0) {
1014 id_it->WriteAsFasta(os);
1022 if (num_ids_found == 0) {
1024 for (
auto id_it : id_list) {
1025 if (id_it->IsGeneral()) {
1026 if (num_ids_found > 0) {
1030 id_it->WriteAsFasta(os);
1039 if (num_ids_found == 0) {
1040 bool found_local =
false;
1041 for (
auto id_it : id_list) {
1042 if (id_it->IsLocal()) {
1053 id_it->WriteAsFasta(os);
1070 if (!supress_context) {
1071 if (!content.empty()) {
1095 bool is_ambig =
false;
1100 string::const_iterator sit =
str.begin();
1101 while (sit !=
str.end() && !rval) {
1109 }
else if (*sit ==
'-') {
1112 }
else if (*sit ==
'n') {
1115 }
else if (*sit ==
'.') {
1117 if (numdigits > 0 && numdashes > 0) {
1120 }
else if (numdigits == 0 && numdashes == 0) {
1123 }
else if (numdashes > 1) {
1130 if (numperiods == 3) {
1131 if (numdigits > 0 && numdashes > 0) {
1133 }
else if (numdigits > 0 || numdashes == 1) {
1144 if (numperiods == 3) {
1145 if (numdigits > 0 && numdashes > 0) {
1147 }
else if (numdigits > 0 || numdashes == 1) {
1157 bool is_patent =
false;
1161 if ((*id_it)->IsPatent()) {
1189 for (
CSeq_loc_CI sl_iter(loc); sl_iter; ++sl_iter ) {
1196 if (
first.GetStrand() !=
last.GetStrand() ) {
1228 swap(acceptor, donor);
1229 stop =
len - donor - 1;
1230 start =
len - acceptor - 1;
1241 }
catch ( exception& ) {
1257 }
catch ( exception& ) {
1268 }
catch ( exception& ) {
1282 const CSeq_id&
id = citer.GetSeq_id();
1295 if (pos >= vec.
size()) {
1297 }
else if (vec[pos] !=
'N' && vec[pos] !=
'n') {
1299 }
else if (vec.
IsInGap(pos)) {
1330 begin_ambig =
false;
1333 if (vec.
size() < 10) {
1342 for (
int i = 0;
i < 10;
i++) {
1353 for (
unsigned int i = vec.
size() - 11;
i < vec.
size();
i++) {
1365 for (
unsigned int i = 0;
i < 10;
i++) {
1376 for (
unsigned int i = vec.
size() - 10;
i < vec.
size();
i++) {
1385 size_t check_len = 50;
1386 if (vec.
size() < 50) {
1387 check_len = vec.
size();
1391 if (vec[
i] ==
'N') {
1393 if (num_ns >= 5 &&
i < 10) {
1396 }
else if (num_ns >= 15) {
1404 if (vec[vec.
size() -
i - 1] ==
'N') {
1406 if (num_ns >= 5 &&
i < 10) {
1409 }
else if (num_ns >= 15) {
1416 }
catch (exception&) {
1435 begin_ambig =
false;
1445 }
catch ( exception& ) {
1465 bool loc1_partial_start =
1467 bool loc1_partial_stop =
1469 bool loc2_partial_start =
1471 bool loc2_partial_stop =
1473 if (loc1_partial_start == loc2_partial_start &&
1474 loc1_partial_stop == loc2_partial_stop) {
1501 const auto& annot1 = f1.
GetAnnot();
1502 const auto& annot2 = f2.
GetAnnot();
1503 bool rval = annot1 == annot2;
1504 diff_descriptions =
false;
1506 if ((!annot1.Seq_annot_IsSetDesc() || annot1.Seq_annot_GetDesc().Get().empty()) &&
1507 (!annot2.Seq_annot_IsSetDesc() || annot2.Seq_annot_GetDesc().Get().empty())) {
1509 diff_descriptions =
false;
1510 }
else if (annot1.Seq_annot_IsSetDesc() && annot2.Seq_annot_IsSetDesc()) {
1513 const auto d2 = annot2.Seq_annot_GetDesc().Get().front();
1514 if (d1->Which() != d2->Which()) {
1515 diff_descriptions =
true;
1519 diff_descriptions =
false;
1520 }
else if (d1->IsTitle()
1522 diff_descriptions =
false;
1524 diff_descriptions =
true;
1528 diff_descriptions =
true;
1543 CSeq_feat::TQual::const_iterator gb1 = feat1.
GetQual().begin();
1544 CSeq_feat::TQual::const_iterator gb1_end = feat1.
GetQual().end();
1545 CSeq_feat::TQual::const_iterator gb2 = feat2.
GetQual().begin();
1546 CSeq_feat::TQual::const_iterator gb2_end = feat2.
GetQual().end();
1548 while ((gb1 != gb1_end) && (gb2 != gb2_end) && rval) {
1549 if (!(*gb1)->IsSetQual()) {
1550 if ((*gb2)->IsSetQual()) {
1553 }
else if (!(*gb2)->IsSetQual()) {
1555 }
else if (!
NStr::Equal ((*gb1)->GetQual(), (*gb2)->GetQual())) {
1559 string v1 = (*gb1)->IsSetVal() ? (*gb1)->GetVal() :
"";
1560 string v2 = (*gb2)->IsSetVal() ? (*gb2)->GetVal() :
"";
1568 if (gb1 != gb1_end || gb2 != gb2_end) {
1583 bool same_label =
true;
1584 const string& curr_comment =
1586 const string& prev_comment =
1599 if (!comments_same || !labels_same) {
1610 if (list1.empty() || list2.empty()) {
1612 }
else if (list1.size() != list2.size()) {
1616 TDbtags::const_iterator it1 = list1.begin();
1617 TDbtags::const_iterator it2 = list2.begin();
1618 for (; it1 != list1.end(); ++it1, ++it2) {
1623 (*it1)->GetTag().IsStr() ? (*it1)->GetTag().GetStr() :
"";
1625 (*it2)->GetTag().IsStr() ? (*it2)->GetTag().GetStr() :
"";
1626 if ( str1.empty() && str2.empty() ) {
1627 if (!(*it1)->GetTag().IsId() && !(*it2)->GetTag().IsId()) {
1629 }
else if ((*it1)->GetTag().IsId() && (*it2)->GetTag().IsId()) {
1630 if ((*it1)->GetTag().GetId() != (*it2)->GetTag().GetId()) {
1646 const auto & f1data = f1.
GetData();
1647 const auto & f2data = f2.
GetData();
1648 if (!f1data.IsCdregion() || !f2data.IsCdregion()) {
1652 const auto & cd2 = f2data.GetCdregion();
1654 int frame1 = 1, frame2 = 1;
1655 if (cd1.IsSetFrame()) {
1661 if (cd2.IsSetFrame()) {
1662 frame2 = cd2.GetFrame();
1667 if (frame1 == frame2) {
1690 if ((*q)->IsSetQual() &&
NStr::Equal((*q)->GetQual(),
"replace") && (*q)->IsSetVal()) {
1694 replace += (*q)->GetVal();
1737 list<CSeq_feat_Handle> mrna1;
1738 list<CSeq_feat_Handle> mrna2;
1741 if ((*itx)->IsSetId() && (*itx)->GetId().IsLocal()) {
1744 ITERATE( vector<CSeq_feat_Handle>, feat_it, handles ) {
1745 if (feat_it->IsSetData()
1746 && feat_it->GetData().GetSubtype() == s2) {
1747 mrna1.push_back(*feat_it);
1749 mrna1_id.push_back (
f);
1756 if ((*itx)->IsSetId() && (*itx)->GetId().IsLocal()) {
1759 ITERATE( vector<CSeq_feat_Handle>, feat_it, handles ) {
1760 if (feat_it->IsSetData()
1761 && feat_it->GetData().GetSubtype() == s2) {
1762 mrna2.push_back(*feat_it);
1764 mrna2_id.push_back (
f);
1770 if (mrna1_id.size() > 0 && mrna2_id.size() > 0) {
1772 for (
auto i1 = mrna1_id.begin(); i1 != mrna1_id.end(); ++i1) {
1773 for (
auto i2 = mrna2_id.begin(); i2 != mrna2_id.end(); ++i2) {
1774 if ((*i1)->Equals(**i2)) {
1827 if (!
f.IsSetExcept())
return false;
1828 if (!
f.IsSetExcept_text())
return false;
1830 const string& except_text =
f.GetExcept_text();
1841 bool check_partials,
1842 bool case_sensitive)
1852 if (feat1_subtype != feat2_subtype) {
1868 bool diff_annot_desc =
false;
1871 if (diff_annot_desc) {
1888 bool full_length_coding_regions_with_different_frames =
1890 if (!same_label && full_length_coding_regions_with_different_frames) {
1919 bool partials_ok = (!check_partials ||
PartialsSame(feat1_loc, feat2_loc));
1946 bool is_common =
false;
1948 if (
data.IsSetStatus()) {
1950 if ((*status_it)->IsSetProperty()
1952 if ((*status_it)->IsSetValue() && (*status_it)->GetValue().IsStr()) {
1953 string value_str = (*status_it)->GetValue().GetStr();
1968 bool has_misspell_flag =
false;
1970 if (
data.IsSetStatus()) {
1972 if ((*status_it)->IsSetProperty()) {
1973 string prop = (*status_it)->GetProperty();
1975 has_misspell_flag =
true;
1981 return has_misspell_flag;
2005 for (
const auto& mod_it : orgname.
GetMod()) {
2006 if (mod_it->IsSetSubtype()
2009 && mod_it->IsSetSubname()
2011 match = mod_it->GetSubname();
2055 if (pos != string::npos) {
2056 host = host.substr(0, pos);
2061 if (pos == string::npos) {
2075 if (pos != string::npos) {
2076 host = host.substr(0, pos);
2079 host = host.substr(0, pos);
2094 err_str =
"Specific host value is ambiguous: " +
2097 err_str =
"Invalid value for specific host: " +
2100 }
else if (reply.
IsData()) {
2101 const auto& rdata = reply.
GetData();
2103 err_str =
"Specific host value is misspelled: " +
2105 }
else if (rdata.IsSetOrg()) {
2106 const auto& org = rdata.
GetOrg();
2113 err_str =
"Specific host value is alternate name: " +
2114 orig_host +
" should be " +
2117 err_str =
"Specific host value is incorrectly capitalized: " +
2121 err_str =
"Invalid value for specific host: " +
2131 bool is_common =
false;
2137 if (it->IsSetSubtype() &&
2139 it->IsSetSubname() &&
2167 bool is_species =
false;
2168 bool is_uncultured =
false;
2191 string hostfix =
val;
2192 validator::CTaxValidationAndCleanup tval;
2193 tval.FixOneSpecificHost(hostfix);
2201 if (ch < 0x02 || ch > 0x7F) {
2210 else if (ch ==
'\'' || ch ==
'/' || ch ==
'@' || ch ==
'`' || ch ==
',') {
2222 string::iterator s = title.begin();
2224 while (s != title.end()) {
2244 const auto& gcode = cdr.
GetCode();
2246 for (
auto& it : gcode.Get()) {
2248 genCode = it->GetId();
2254 }
else if (genCode == 8) {
2256 }
else if (genCode == 0) {
2261 new_code->SetId(genCode);
2262 cdr.
SetCode().Set().push_back(new_code);
2283 }
else if (cdregion.
GetFrame() == 3) {
2289 genetic_code = &(cdregion.
GetCode());
2297 *tmp_cds, scope, transl_prot,
2309 bool got_dash = (transl_prot[0] ==
'-');
2310 bool got_x = (transl_prot[0] ==
'X'
2313 if (!got_dash && !got_x) {
2324 "adjusted for low-quality genome",
2325 "annotated by transcript or proteomic data",
2326 "rearrangement required for product",
2327 "reasons given in citation",
2328 "translated product replaced",
2335 "artificial frameshift",
2336 "mismatches in translation"
2381 bool alt_start =
false;
2399 size_t internal_stop_count = 0;
2401 ITERATE(
string, it, transl_prot) {
2403 ++internal_stop_count;
2407 if (transl_prot[transl_prot.length() - 1] ==
'*') {
2408 --internal_stop_count;
2410 return internal_stop_count;
2437 bool alt_start =
false;
2446 if (internal_stop_codons > 0) {
2469 if (sv.
size() < 1) {
2471 }
else if (sv.
IsInGap(0) || sv[0] ==
'-') {
2506 size_t terminations = 0;
2509 if (*sv_iter ==
'*') {
2513 return terminations;
2581 const CSeq_id* protid =
nullptr;
2587 if (!prot_handle && far_fetch) {
2599 len = transl_prot.length();
2600 prot_len = prot_vec.
size();
2606 if (transl_prot[
len - 1] ==
'X') {
2614 while (prot_len > 0) {
2615 if (prot_vec[(
TSeqPos)prot_len - 1] ==
'X') {
2628 vector<TSeqPos> mismatches;
2634 if (
len == prot_len) {
2639 if (t_res != p_res) {
2641 bool no_beg, no_end;
2644 }
else if (t_res ==
'-') {
2646 mismatches.push_back(
i);
2649 mismatches.push_back(
i);
2660 vector<TSeqPos> mismatches;
2662 if (!prot_handle || !prot_handle.
IsAa()) {
2675 bool no_beg, no_end;
2691 bool show_stop =
true;
2697 bool is_far =
false;
2700 vector<TSeqPos> mismatches =
GetMismatches(feat, prot_handle, transl_prot);
2701 if (mismatches.size() == 0) {
2716 bool fetchable =
false;
2721 if (ids.size() > 0) {
2734 }
catch (std::exception &) {
2742 bool fetchable =
false;
2749 }
catch (std::exception &) {
2768 if (
id.IsOther() &&
id.GetOther().IsSetAccession() &&
2792 if (
id.IsOther() &&
id.GetOther().IsSetAccession() &&
2805 if (
IsNG(**id_it)) {
2819 if (
id.IsGeneral() &&
id.GetGeneral().IsSetDb()) {
2820 const string& db =
id.GetGeneral().GetDb();
2873 return (
bool)(strchr(
"ANRMWHVD", ch) !=
NULL);
2878 return (
bool)(strchr(
"CNYMSHBV", ch) !=
NULL);
2883 return (
bool)(strchr(
"GNRKSBVD", ch) !=
NULL);
2888 return (
bool)(strchr(
"TNYKWHBD", ch) !=
NULL);
2925 size_t mismatches = 0;
2932 (feat, mismatches,
false,
2933 nuc,
rna,
false,
false,
false, &scope);
2976 switch (acc.length()) {
3002 switch (
id.Which()) {
3004 if (
id.GetOther().IsSetAccession()) {
3005 const string& acc =
id.GetOther().GetAccession();
3006 switch (acc.length()) {
3024 if (
id.GetGenbank().IsSetAccession()) {
3029 if (
id.GetDdbj().IsSetAccession()) {
3034 if (
id.GetEmbl().IsSetAccession()) {
3039 if (
id.GetTpg().IsSetAccession()) {
3064 if (!
set.IsSetClass()) {
3071 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)
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
constexpr size_t ArraySize(const Element(&)[Size])
#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.
#define ENUM_METHOD_NAME(EnumName)
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 whitespace 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.
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.
const string version
version string
const CConstRef< CSeq_id > GetAccession(const CSeq_id_Handle &id_handle)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
#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.
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