CSeq_id_find_pred
79 const char* kSymbols;
80 booloperator()(
const charch)
84 returnstrchr(kSymbols, ch) != 0;
132 case eFormat:
return "eFormat";
156 if(verstr.
empty()) {
162 "Version embedded in accession "+
string(acc_in)
163+
" is not a positive integer");
171 switch(
Which() ) {
205 switch( src.
Which() ) {
322 switch(
id.
Which() ) {
425 if( tsip1->
Match(*tsip2) )
431 switch(
Which() ) {
494 if( tsip1 && tsip2 ) {
495 returntsip1->
Compare(*tsip2);
497 switch(
Which() ) {
602 if(it == sc_ChoiceMap.end()) {
621 if(s.
size() > 3 && s[2] ==
'|') {
623}
else if(s.
size() > 4 && s[3] ==
'|') {
635 if(s.
size() > 3 && s[2] ==
'|') {
637}
else if(s.
size() > 4 && s[3] ==
'|') {
890 typedefpair<string, TAccInfo>
TPair;
951 string* key_used =
NULL)
const;
961 void x_Load(
const string& filename);
966 const string* old_name,
const CTempString& new_name);
981 if(it == sc_AccInfoMap.end()) {
997 if(fmt == prev_special_format) {
998 if(acc_or_range == prev_special_key) {
999prev_special_type = prev_type;
1000prev_special_type_name = prev_type_name;
1002}
else if(pfx == prev_special_base_key) {
1003 returnprev_special_base_type;
1006prev_special_format = fmt;
1007prev_special_base_key = pfx;
1008prev_special_base_type = guide.
Find(fmt, pfx);
1009 returnprev_special_base_type;
1016 if(prev_submap !=
NULL&& prev_submap->first == fmt) {
1017 returnprev_submap->second;
1020 if(it ==
rules.
end() || it->first != fmt) {
1024prev_big_special = it->second.big_specials.end();
1025prev_small_special = it->second.small_specials.end();
1033vector<CTempStringEx> tokens;
1037 tmp1.assign(rule, 0, rule.
find(
'#'));
1043 if(tokens.empty()) {
1045}
else if(tokens.size() == 2
1051<<
": Unsupported version "<< tokens[1]);
1054}
else if((pos = tokens[0].find(
'+')) !=
NPOS 1055&& (tokens.size() == 3
1056|| (tokens.size() == 4 && tokens[3] ==
"*"))) {
1059 tmp1.assign(tokens[0], 0, pos);
1065unique_ptr<string> old_name;
1069old_name.reset(
new string);
1077 if( !key_used.empty() ) {
1078key_used =
" (per "+ key_used +
')';
1081<<
": ignoring refinement of "<< tokens[1]
1082<<
" from "<< *old_name << key_used
1083<<
" to unrecognized accession type "<< tokens[2]);
1087*old_name = it->second;
1092<<
": using default fallback from "<< tokens[2]
1093<<
" to "<< *old_name <<
" for "<< tokens[1]);
1095*old_name =
"unknown";
1097 "SAccGuide::AddRule: "<<
count 1098<<
": unrecognized accession type "<< tokens[2]
1099<<
" for "<< tokens[1]);
1105 if(tokens.size() == 4) {
1109 if(tokens[1].find_first_of(
"?*") ==
NPOS) {
1114 if(wit->first == tokens[1]) {
1115wit->second =
value;
1116value_ptr = &wit->second;
1120 if(value_ptr ==
NULL) {
1122value_ptr = &submap.
wildcards.back().second;
1127 _ASSERT(old_name.get() !=
NULL&& !old_name->empty());
1128 fallbacks[value_ptr] = make_pair(*old_name, tokens[2]);
1135pos = tokens[1].find_first_of(
kDigits);
1136pos2 = tokens[1].find(
'-', pos);
1138=
s_Key(pos, ((pos2 ==
NPOS) ? tokens[1].
size() : pos2) - pos);
1145 Find(fmt, tokens[1].substr(0, pos2), &key_used);
1146 if( !key_used.empty() ) {
1148<<
"SAccGuide::AddRule: Main listing for special " 1150<<
" doesn't indicate that specials are present.");
1153unique_ptr<string> old_name;
1156 Find(fmt, tokens[1].substr(0, pos2), &key_used);
1157old_name.reset(
new string);
1158 if( !key_used.empty() ) {
1162*old_name = it->second;
1167<<
": using default fallback from "<< tokens[2]
1168<<
" to "<< *old_name <<
" for "<< tokens[1]);
1180 if( !key_used.empty() ) {
1181key_used =
" (per "+ key_used +
')';
1184<<
": unrecognized accession type "<< tokens[2]
1185<<
" for special case "<< tokens[1]
1186<<
"; falling back to "<< *old_name << key_used);
1187}
else if(old_name->empty()) {
1188*old_name =
"unknown";
1190<<
": unrecognized accession type "<< tokens[2]
1191<<
" for stray(!) special case "<< tokens[1]);
1199 if(pos2 ==
NPOS) {
1200 tmp1= tmp2 = tokens[1];
1202 tmp1.assign(tokens[1], 0, pos2);
1210}
else if(tokens.size() >= 3
1215<<
": special2 valid only in version 2+ guides");
1218 autodigits = NStr::StringToNumeric<unsigned short>(tmp2);
1232 if( !why.empty() ) {
1234<<
"SAccGuide::AddRule: Main listing for special " 1236<<
" doesn't indicate that specials are present.");
1239 for(
size_t i= 2;
i< tokens.size(); ++
i) {
1249 for(
size_t i= 2;
i< tokens.size(); ++
i) {
1255why =
" (per default fallback for "+ tokens[
i] +
')';
1269 if( !why.empty() ) {
1270why =
" (per "+ why +
')';
1275<<
": unrecognized accession type "<< tokens[2]
1276<<
" for stray(!) special case "<< tokens[1]);
1285<<
": unrecognized accession type "<< tokens[2]
1286<<
" for special case "<< tokens[1]
1292}
else if(tokens.size() >= 2 && tokens[0] ==
":") {
1296<<
": special2 continuation lines valid only in" 1297 " version 2+ guides");
1302 "SAccGuide::AddRule: "<<
count 1303<<
": ignoring misplaced special2 ranges line.");
1309 for(
size_t i= 1;
i< tokens.size(); ++
i) {
1312 if(tmp2.
empty()) {
1317memcpy(p - tmp2.
size(), tmp2.
data(), tmp2.
size());
1326 string key(tokens[1]);
1333<<
": unrecognized accession type "<< tokens[2]
1334<<
" for "<<
key);
1343 fallbacks[&it2->second] = make_pair(old_name, tokens[2]);
1345<<
": ignoring refinement of "<<
key<<
" from " 1346<< old_name <<
" to unrecognized accession type " 1352}
else if(tokens.size() == 3
1358<<
": default fallbacks valid only in version 2+" 1366<<
": ignoring invalid line: "<< rule);
1372 string* key_used)
const 1380 const SSubMap& submap = it->second;
1389 boolbad_match =
false;
1391 while(pos !=
NPOS) {
1392 if( !
isalnum(pfx[pos]) && pfx[pos] !=
'?') {
1396pos = wit->first.find(
'?', pos + 1);
1402 if(key_used && acc_or_pfx != wit->first) {
1403*key_used = wit->first;
1416 if(ssit->second.first[
n]) {
1420 returnssit->second.second;
1426&& !(acc_or_pfx < bsit->second.first) ) {
1430 returnbsit->second.second;
1432 if(key_used && key_used->empty()) {
1433*key_used = pfx.
substr(0, fmt >> 16);
1446 boolfile_is_old =
false;
1449 CTimebuiltin_timestamp(
static_cast<time_t
>(kBuiltInGuide_Timestamp));
1450 if( !
file.empty() &&
1460 "using built-in rules because accguide.txt is older.");
1463 "falling back on built-in rules.");
1465 static const unsigned intkNumBuiltInRules
1466=
sizeof(kBuiltInGuide) /
sizeof(*kBuiltInGuide);
1468 for(
unsigned int i= 0;
i< kNumBuiltInRules; ++
i) {
1469 AddRule(kBuiltInGuide[
i], hints);
1472 for(
auto&rit :
rules) {
1474 if(sit->second.first.any()) {
1475sit->second.first.optimize();
1477rit.second.small_specials.erase(sit);
1490 static const char*
constkNucDBs[] = {
1491 "SRA",
"TI",
"TR_ASSM_CH",
"TRACE_ASSM",
"TRACE_CHGR",
NULL 1493 for(
const char*
const* p = kNucDBs; *p; ++p) {
1510}
while( !
in.AtEOF() );
1515 const string* old_name,
1521 const TAccInfo* value_ptr =
nullptr;
1522 if(from_pfx != to_pfx) {
1546it->second.first.clear_range(left, right);
1550|| (--it)->first != from_pfx) {
1560 if(it->first != from_pfx) {
1571 _ASSERT(it->first == from_pfx);
1588 if(value_ptr !=
nullptr) {
1589 _ASSERT(old_name !=
nullptr&& !old_name->empty());
1590 fallbacks[value_ptr] = make_pair(*old_name, new_name);
1592 _ASSERT(old_name ==
nullptr);
1599 autoraw_digits = fmt & 0xffff, digits = raw_digits;
1600 autonormal_size = (fmt >> 16) + digits;
1608 if(acc.
size() == normal_size) {
1609pos = acc.
size() - digits;
1614pos = (fmt >> 16) + 2;
1617 if(digits == raw_digits) {
1619 result+= (NStr::StringToNumeric<Uint1>(acc.
substr(pos, 2))
1638 boolhas_version =
true;
1639 if(main_size ==
NPOS) {
1640has_version =
false;
1641main_size = acc.
size();
1642}
else if(main_size >= acc.
size() - 1
1647 static const SIZE_TYPEkMainAccBufSize = 32;
1648 if(main_size <= kMainAccBufSize) {
1649 const unsigned char* ucdata = (
const unsigned char*)acc.
data();
1650 charmain_acc_buf[kMainAccBufSize];
1652main_acc_buf[
i] =
toupper(ucdata[
i]);
1659 stringmain_acc(acc, 0, main_size);
1670main_size = main_acc.
size();
1671 charflag_char =
'\0';
1672 if(digit_pos ==
NPOS) {
1676 const unsigned char* ucdata = (
const unsigned char*)main_acc.
data();
1678 if( !has_version && digit_pos == 0 && main_size >= 4
1679&& non_dig_pos < 5 &&
isalnum(ucdata[1])
1683 if(main_size > 4 && main_size <= 17
1684&& strchr(
"|-_", main_acc[4])
1685&& (main_size <= 6 ||
isalnum(ucdata[5]))) {
1688}
else switch(main_size) {
1713 if(digit_pos == 1 && main_size == 6
1714&& (main_acc[0] ==
'O'|| main_acc[0] ==
'P' 1715|| main_acc[0] ==
'Q'||
isalpha(ucdata[2]))
1720}
else if(digit_pos == 1 && main_size == 10
1721&& main_acc[0] !=
'O'&& main_acc[0] !=
'P' 1722&& main_acc[0] !=
'Q' 1728}
else if( !has_version && digit_pos == 0
1729&& (non_dig_pos == 6 || non_dig_pos == 7)
1730&& (main_size == non_dig_pos + 1
1731|| main_acc[non_dig_pos + 1] ==
':' 1732|| (
isalpha(ucdata[non_dig_pos + 1])
1733&& (main_size == non_dig_pos + 2
1734|| main_acc[non_dig_pos + 2] ==
':')))) {
1739}
else if(digit_pos >= 4 && non_dig_pos == digit_pos + 2
1740&& main_size - non_dig_pos >= 6 && main_acc[3] !=
'_' 1741&& (main_acc[non_dig_pos] ==
'S' 1742|| main_acc[non_dig_pos] ==
'P')
1745flag_char = main_acc[non_dig_pos];
1752 if(digit_pos == 0) {
1754&& main_acc[0] !=
'0' 1764 SIZE_TYPEflag_len = (flag_char ==
'\0') ? 0 : 1;
1765 SIZE_TYPEdigit_count = main_size - digit_pos - flag_len;
1775 static bools_ReportedFallback;
1778s_ReportedFallback =
true;
1779 autoit = guide->fallbacks.find(&found_ai);
1780 if(it != guide->fallbacks.end()) {
1782 " Returning fallback type " 1783<< it->second.first <<
" for accession " 1784<< main_acc <<
". (Preferred type " 1785<< it->second.second <<
" unrecognized.)");
1788 " Returning fallback type 0x" 1790<<
" for accession "<< main_acc
1791<<
". (Internal error looking up names of" 1792 " fallback and preferred types.)");
1796 if(flag_char ==
'P') {
1809<<
": Protein flag found with unexpected division " 1823(
"0", digit_pos
+ 2) ==
NPOS)) {
1855}
else if(type2 ==
type) {
1873 returnit == (*s_Guide)->general.end() ?
eAcc_general: it->second;
1897 unsignedchoice =
id.Which();
1907*
label+=
id.GetGeneral().GetDb();
1949 if( !
str.empty() ) {
1957 switch(
id.Which()) {
1966}
else if(oid.
IsStr()) {
1986 const CDbtag& dbt =
id.GetGeneral();
2000 const CId_pat& idp =
id.GetPatent().GetCit();
2023 unsigned charchain =
static_cast<unsigned char>(pid.
GetChain());
2027*
label+=
static_cast<char>(chain);
2073list<string> secondary_id_list;
2075 if(!primary_id.empty())
2076*
label+= primary_id;
2077 else if(secondary_id_list.size() > 0)
2078*
label+= *secondary_id_list.begin();
2100 while((*
label)[
label->size() - 1] ==
'|') {
2167 unsignedthe_type =
Which();
2172 const charpgp[] =
"pat|";
2173 out.write(pgp,
sizeof(pgp) - 1);
2176 const chartr[] =
"tr|";
2177 out.write(tr,
sizeof(tr) - 1);
2188 unsignedthe_type =
Which();
2261 out<<
"[UnknownSeqIdType]";
2268 #ifdef HAVE_THREAD_LOCAL 2271 #if NCBI_SHUN_OSTRSTREAM 2310 if( (*iter)->IsGi() ) {
2312(*iter)->WriteAsFasta(out_str);
2357 boolfound_gi =
false;
2360 if((*id)->IsGi()) {
2361(*id)->WriteAsFasta(ostr);
2381 Set(dbtag, set_as_general);
2400 "Bad CDbtag tag type " 2426 if(set_as_general) {
2430 "Unrecognized Dbtag DB "+ dbtag.
GetDb());
2467 if(the_id.
empty()) {
2469 "Empty bare accession supplied");
2486 if(colon_pos !=
NPOS) {
2487 stringdb = the_id.
substr(0, colon_pos);
2490 const auto& whitelist = kSupportedRawDbtags;
2491 if(whitelist.find(db) != whitelist.end()) {
2494the_id.
substr(colon_pos + 1));
2503 "Malformatted ID "+
string(the_id));
2511 stringmol(the_id, 0, 4), chain;
2513 if(the_id.
size() > 5) {
2514chain = the_id.
substr(5);
2515}
else if(the_id.
size() == 5 && the_id[4] !=
'|') {
2518 return Set(
type, mol, chain);
2529list<CTempString> fasta_pieces;
2532fasta_pieces.pop_front();
2534 if( !fasta_pieces.empty() ) {
2536 ITERATE(list<CTempString>, it, fasta_pieces) {
2537 if( !it->empty() ) {
2540 " (synonyms?) in FASTA-style ID " 2544 "FASTA-style ID "+
string(the_id)
2545+
" has too many parts.");
2558 Set(
f, the_type, the_content);
2564list<CTempString> fasta_pieces;
2567 if( !fasta_pieces.empty()
2570fasta_pieces.pop_front();
2572 x_Init(fasta_pieces, the_type, tv);
2595 static const char* kIllegal =
" >[]|\"";
2596CSeq_id_find_pred pred; pred.kSymbols = kIllegal;
2597 if(find_if(s.
begin(), s.
end(), pred) != s.
end()) {
2605 boolallow_partial_failure)
2608 if(allow_partial_failure) {
2625ids.push_back(
id);
2630list<CTempString> fasta_pieces;
2632 _ASSERT(fasta_pieces.size() > 0);
2633 if(fasta_pieces.size() == 1)
2636ids.push_back(
id);
2644 if(fasta_pieces.size() == 2) {
2651fasta_pieces.pop_front();
2653 while( !fasta_pieces.empty() ) {
2657 type=
id->x_Init(fasta_pieces,
type, tv);
2663fasta_pieces.pop_front();
2665 "Unsupported ID type "+ typestr);
2669 _ASSERT( !fasta_pieces.empty() );
2671fasta_pieces.pop_front();
2673ids.push_back(
id);
2675}
catch(std::exception& e) {
2676 if(fasta_pieces.empty()) {
2682 auto l= fasta_pieces.front().size();
2683 if(
l!= 2 &&
l!= 3) {
2684fasta_pieces.pop_front();
2688}
while( !fasta_pieces.empty() );
2702 _ASSERT(!fasta_pieces.empty());
2705vector<CTempString> fields(3);
2714min_fields = max_fields = 1;
2717min_fields = max_fields = 3;
2720min_fields = max_fields = 2;
2735 if(fasta_pieces.empty()) {
2736 if(
i>= min_fields) {
2740 "Not enough fields for ID of type " 2744 if(
i>= min_fields && fasta_pieces.size() > 1
2745&& (fasta_pieces.front().size() == 2
2746|| fasta_pieces.front().size() == 3)
2752list<CTempString>::iterator it = fasta_pieces.begin();
2754 _ASSERT(it != fasta_pieces.end());
2756 if((it->size() == 2 || it->size() == 3)
2758next_type = next_type_2;
2759}
else if(it->find_first_not_of(
" \t\n") ==
NPOS 2760&& ++it == fasta_pieces.end()) {
2766fields[
i] = fasta_pieces.front();
2767fasta_pieces.pop_front();
2775&& !fasta_pieces.empty() ) {
2777fields[1] = snp_name;
2778fasta_pieces.clear();
2782 while( !fasta_pieces.empty() && fasta_pieces.front().empty() ) {
2783fasta_pieces.pop_front();
2790fields[2] =
"unreviewed";
2792fields[2] =
"reviewed";
2801 "Bad sequence number "+
string(fields[2]) +
" for " 2802+
string(fields[0]) +
" patent "+
string(fields[1]));
2810 if(fields[0].
size() < 4
2811|| (fields[0].
size() > 5
2812&& ( !fields[1].
empty()
2813|| strchr(
"|-_", fields[0][4]) ==
NULL))) {
2815 "Malformatted PDB ID "+
string(fields[0]));
2817 if(fields[0].
size() > 4 && fields[1].
empty()) {
2818 if(fields[0].
size() > 5) {
2819fields[1] = fields[0].substr(5);
2821 _ASSERT(fields[0][4] !=
'|');
2822fields[1] = fields[0].substr(4);
2824fields[0] = fields[0].substr(0, 4);
2832 Set(
type, fields[0]
, fields[1]
, ver,
2841 Set(the_type, the_id);
2844 #ifdef NCBI_STRICT_GI 2854 if((the_id < 0) || (the_type ==
e_Local&& the_id == 0)) {
2894 Set(the_type, acc_in, name_in,
version, release_in);
2910 boolallow_dot =
true;
2926 if( the_type ==
e_Gi) {
2928 TGigi = NStr::StringToNumeric<TGi>(acc);
2940 return Set(the_type, the_id);
2943 "Negative, excessively large, or non-numeric " 2945+
" ID "+
string(acc));
2952 case e_Pir: tsid = &
SetPir(); allow_dot =
false;
break;
2956 case e_Prf: tsid = &
SetPrf(); allow_dot =
false;
break;
2990dbt.
SetTag().SetStrOrId(name);
3003 if(name_in.
empty()) {
3005}
else if(name.
empty()) {
3008}
else if(name.
size() == 1) {
3009pdb.
SetChain(
static_cast<unsigned char>(name[0]));
3013 Info<<
"Necessarily using backwards-incompatible" 3014 " representation for chain "<<
string(name)
3015<<
" of PDB molecule "<< acc <<
'.');
3017 if(name.
empty()) {
3033tsid->
Set(acc, name_in,
version, release_in, allow_dot);
3042 switch(
Which()) {
3054 case e_Tpd:
return10;
3059 case e_Prf:
return20;
3076 default:
return90;
3083 switch(
Which()) {
3092 default:
return60;
3099 switch(
Which()) {
3108 if(db.compare(
"TMSMART") == 0 ||
3109db.compare(
"BankIt") == 0 ||
3110db.compare(
"NCBIFILE") == 0 )
3116 case e_Pdb:
return80;
3122 default:
return20;
3129 switch(
Which()) {
3136 if(db.compare(
"TMSMART") == 0 ||
3137db.compare(
"BankIt") == 0 ||
3138db.compare(
"NCBIFILE") == 0)
3144 case e_Prf:
return70;
3145 case e_Pdb:
return50;
3150 case e_Pir:
return30;
3153 default:
return60;
3160 switch(
Which()) {
3163 case e_Pir:
return30;
3164 case e_Pdb:
return40;
3168 case e_Tpg:
return80;
3169 case e_Tpe:
return90;
3170 case e_Tpd:
return100;
3173 case e_Prf:
return140;
3179 if(db.compare(
"TMSMART") == 0 ||
3180db.compare(
"BankIt") == 0 ||
3181db.compare(
"NCBIFILE") == 0)
3188 case e_Giim:
return251;
3191 default:
return255;
3198 intscore = base_score * 10;
3201 if( db ==
"TRACE") {
3207 if( !text_id->IsSetVersion() ) {
3210 if( !text_id->IsSetAccession() ) {
3217 if( !text_id->IsSetName() ) {
3239 return&
match.SetGenbank();
3241 return&
match.SetEmbl();
3243 return&
match.SetPir();
3245 return&
match.SetSwissprot();
3247 return&
match.SetOther();
3249 return&
match.SetDdbj();
3251 return&
match.SetPrf();
3253 return&
match.SetTpg();
3255 return&
match.SetTpe();
3257 return&
match.SetTpd();
3259 return&
match.SetGpipe();
3261 return&
match.SetNamed_annot_track();
3272 if( !
orig)
return;
3274 bool A=
orig->IsSetAccession();
3276 boolv =
orig->IsSetVersion();
3278 bool N=
orig->IsSetName();
3280 bool r=
orig->IsSetRelease();
3286 if(
A&& (v ||
N||
r)) {
3290 if(v && (
N||
r)) {
3322 else if(
N&& (v ||
r)) {
3338 switch(
Which() ) {
3358 if(
GetPdb().IsSetRel() ) {
3360 match.Assign(*
this);
3361 match.SetPdb().ResetRel();
3396SEQ_ID_PREFER_ACCESSION_OVER_GI);
3407 returnTPreferAccessionOverGi::GetDefault() ||
AvoidGi();
3413 returnTAvoidGi::GetDefault();
3421 stringsecondary_id;
3423 boolmixed_case =
false;
3425 switch(seqid_type) {
3433secondary_id = primary_id;
3437secondary_id = primary_id;
3441secondary_id = primary_id;
3456primary_id = tsid->
GetName();
3462 if(secondary_id_list) {
3490 if(secondary_id_list) {
3494 if(!suffix.empty())
3501 if(secondary_id_list) {
3507 if((parse_flags &
fAllowLocalId) != 0 && secondary_id_list) {
3511}
else if(oid.
IsStr()) {
3512secondary_id = oid.
GetStr();
3526 if( secondary_id_list ) {
3529&& !primary_id.empty()) {
3531secondary_id = primary_id +
"."+ to_string(tsid->
GetVersion());
3533secondary_id = primary_id +
".1";
3536secondary_id = tsid->
GetName();
3546 if(secondary_id_list && !secondary_id.empty()) {
3548secondary_id_list->emplace_back(secondary_id);
3561 default:
return "";
3580 if(!text_id || !text_id->IsSetAccession() || !text_id->IsSetVersion())
return true;
3597 if(scale_limit < min_limit)
return false;
3604: start(0), stop(0), digits(0), acc_info(
CSeq_id::eAcc_unknown)
3606 size_tpos = 0,
n= s.
size();
3608&& (
isalpha((
unsigned char) s[pos])
3612 while(pos <
n&&
isdigit((
unsigned char) s[pos])) {
3619}
else if(s[pos++] !=
'-') {
3621 "Expected hyphen in range "+
string(s));
3627&& (
isalpha((
unsigned char) s[pos])
3631 if( !pfx2.empty() && pfx2 !=
prefix) {
3633 "Mismatched prefixes in range "+
string(s));
3638 "Mismatched digit counts in range "+
string(s));
3640 while(pos <
n&&
isdigit((
unsigned char) s[pos])) {
3641 stop=
stop* 10 + s[pos++] -
'0';
3657 case 'C':
case 'D':
case 'c':
case 'd':
3661 case 'N':
case 'n':
3683oss << m_Range->prefix << setw(m_Range->digits) << setfill(
'0') << m_Number;
3692 #undef NCBI_USE_ERRCODE_XUser-defined methods of the data storage class.
NCBI_PARAM_DECL(bool, SeqId, PreferAccessionOverGi)
static const TChoiceMapEntry sc_ChoiceArray[]
bool CanCmpAcc(CSeq_id::E_Choice choice)
static void x_GetLabel_Content(const CSeq_id &id, string *label, CSeq_id::TLabelFlags flags, int *version)
static const char *const s_TextId[CSeq_id::e_MaxChoice+1]
static const char * sc_SupportedRawDbtags[]
DEFINE_STATIC_ARRAY_MAP_WITH_COPY(CStaticArraySet< string >, kSupportedRawDbtags, sc_SupportedRawDbtags)
typedef NCBI_PARAM_TYPE(SeqId, PreferAccessionOverGi) TPreferAccessionOverGi
static CSeq_id::E_Choice s_CheckForFastaTag(const CTempString &s)
CStaticPairArrayMap< CTempString, CSeq_id::E_Choice, PNocase_Generic< CTempString > > TChoiceMap
static const unsigned int kMaxSmallSpecialDigits
void x_Assign(CObject_id &dst, const CObject_id &src)
static const TAccInfoMapEntry sc_AccInfoArray[]
CStaticPairArrayMap< CTempString, CSeq_id::EAccessionInfo, PNocase_Generic< CTempString > > TAccInfoMap
static CSafeStatic< CRef< SAccGuide > > s_Guide(s_CreateGuide, NULL)
static const bm::bvector ::size_type kBVSizes[kMaxSmallSpecialDigits+1]
static void x_GetLabel_Type(const CSeq_id &id, string *label, CSeq_id::TLabelFlags flags)
SStaticPair< const char *, CSeq_id::EAccessionInfo > TAccInfoMapEntry
static bool s_HasFastaTag(const CTempString &s)
static CRef< SAccGuide > * s_CreateGuide(void)
CTextseq_id * s_GetTextseq_id(const CSeq_id::E_Choice &choice, CSeq_id &match)
NCBI_PARAM_DEF_EX(bool, SeqId, PreferAccessionOverGi, false, eParam_NoThread, SEQ_ID_PREFER_ACCESSION_OVER_GI)
static void s_SplitVersion(const CTempString &acc_in, CTempString &acc, int &ver)
static const SAccGuide::TAccInfo kUnrecognized
SStaticPair< const char *, CSeq_id::E_Choice > TChoiceMapEntry
static const char kDigits[]
EDbtagType GetType(void) const
int Compare(const CDbtag &dbt2) const
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
void SetStrOrId(CTempString str)
ostream & AsString(ostream &s) const
int Compare(const CObject_id &oid2) const
bool Match(const CObject_id &oid2) const
int Compare(const CPDB_seq_id &psip2) const
bool Match(const CPDB_seq_id &psip2) const
ostream & AsFastaString(ostream &s) const
ostream & AsFastaString(ostream &s) const
int Compare(const CPatent_seq_id &psip2) const
bool Match(const CPatent_seq_id &psip2) const
Base class for all serializable objects.
class CStaticArrayMap<> is an array adaptor that provides an STLish interface to statically-defined a...
TBase::const_iterator const_iterator
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
ostream & AsFastaString(ostream &s, bool allow_version=true) const
Format the contents FASTA string style.
CTextseq_id & Set(const CTempString &acc_in, const CTempString &name_in=kEmptyStr, int version=0, const CTempString &release_in=kEmptyStr, bool allow_dot_version=true)
Set all fields with a single call.
int Compare(const CTextseq_id &tsip2) const
bool Match(const CTextseq_id &tsip2) const
Comparison functions.
Abstract base class for lightweight line-by-line reading.
bvector_size_type size_type
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator end() const
const_iterator lower_bound(const key_type &key) const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
const_iterator find(const key_type &key) const
const_iterator lower_bound(const key_type &key) const
const_iterator end() const
const_iterator begin() const
container_type::iterator iterator
iterator_bool insert(const value_type &val)
std::ofstream out("events_result.xml")
main entry point for tests
static const char * str(char *buf, int n)
#define GI_FROM(T, value)
constexpr size_t ArraySize(const Element(&)[Size])
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERASE_ITERATE(Type, Var, Cont)
Non-constant version with ability to erase current element, if container permits.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define INT_ID_TO(T, id)
Convert gi-compatible int to/from other types.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
TErrCode GetErrCode(void) const
Get error code.
#define STD_CATCH_ALL_X(err_subcode, message)
Standard handling of "exception"-derived exceptions; catches non-standard exceptions and generates "u...
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
void Info(CExceptionArgs_Base &args)
ESerialRecursionMode
How to assign and compare child sub-objects of serial objects.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
const TPrim & Get(void) const
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
static CRef< ILineReader > New(const string &filename)
Return a new ILineReader object corresponding to the given filename, taking "-" (but not "....
void x_WriteContentAsFasta(ostream &out) const
CSeq_id(void)
See also CSeq_id related functions in "util/sequence.hpp":
string ComposeOSLT(list< string > *secondary_ids=nullptr, TComposeOSLTFlags parse_flags=0) const
JIRA ID-5188 : Compose OSLT string for the primary id, as well as OSLT strings for the secondary ids,...
const string AsFastaString(void) const
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
static bool IsValid(const CBioseq::TId &ids, TParseFlags flags=fParse_Default)
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
int BaseBlastScore(void) const
int BaseFastaAAScore(void) const
static const size_t kMaxLocalIDLength
ID length restrictions.
static SIZE_TYPE ParseIDs(CBioseq::TId &ids, const CTempString &s, TParseFlags flags=fParse_Default)
Parse a string representing one or more Seq-ids, appending the results to IDS.
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
E_Choice x_Init(list< CTempString > &fasta_pieces, E_Choice type, ETypeVariant tv)
EAccessionInfo
For IdentifyAccession (below)
static ESNPScaleLimit GetSNPScaleLimit_Value(const string &name)
int CompareOrdered(const CSeq_id &sid2) const
const SSeqIdRange * m_Range
static SIZE_TYPE ParseFastaIds(CBioseq::TId &ids, const CTempString &s, bool allow_partial_failure=false)
Parse an entire set of |-delimited FASTA-style IDs, appending the results to IDS.
static E_Choice GetAccType(EAccessionInfo info)
E_SIC
Compare return values.
EFastaAsTypeAndContent
Tag for method variants that would otherwise be ambiguous.
static ETypeVariant x_IdentifyTypeVariant(E_Choice type, const CTempString &str)
virtual void WriteAsFasta(ostream &out) const
Implement serializable interface.
int BaseBestRankScore(void) const
int TFlags
binary OR of EFlags
CSeq_id & Set(const CTempString &the_id, TParseFlags flags=fParse_AnyRaw)
Reassign based on flat specifications; arguments interpreted as with constructors.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
SSeqIdRange(const CTempString &s, TFlags flags=0)
static E_Choice WhichInverseSeqId(const CTempString &SeqIdCode)
Converts a string to a choice, no need to require a member.
static const char * GetSNPScaleLimit_Name(ESNPScaleLimit value)
static bool IsValidLocalID(const CTempString &s)
Perform rudimentary validation on potential local IDs, whose contents should be pure ASCII and limite...
static string GetStringDescr(const CBioseq &bioseq, EStringFormat fmt)
static void LoadAccessionGuide(const string &filename)
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
int AdjustScore(int base_score, TAdjustScoreFlags flags=TAdjustScoreFlags()) const
EStringFormat
Get a string representation of the sequence IDs of a given bioseq.
CSeq_id::EAccessionInfo acc_info
virtual const char * GetErrCodeString(void) const override
Translate from the error code value to its string representation.
bool IsAllowedSNPScaleLimit(ESNPScaleLimit scale_limit) const
static EAccessionInfo x_IdentifyAccession(const CTempString &main_acc, TParseFlags flags, bool has_version)
CRef< CSeq_id > GetID(void) const
void GetMatchingTextseqIds(TSeqIdHandles &matches) const
Collect partially matching textseq-ids.
ELabelType
return the label for a given string
const string & x_SetAccession(void) const
void GetMatchingIds(TSeqIdHandles &matches) const
Collect partially matching seq-ids: no-version, no-name etc.
static int FastaNARank(const CRef< CSeq_id > &id)
int BaseTextScore(void) const
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
static bool PreferAccessionOverGi(void)
Check if the option to prefer accession.version over GI is enabled (SeqId/PreferAccessionOverGi or SE...
static bool AvoidGi(void)
Check if the option to avoid GI ids is enabled (SeqId/AvoidGi or SEQ_ID_AVOID_GI).
virtual ~CSeq_id(void)
Destructor.
static TErrorFlags CheckLocalID(const CTempString &s)
Perform rudimentary validation on potential local IDs, whose contents should not exceed fifty charact...
int BaseFastaNAScore(void) const
static const char * WhichFastaTag(E_Choice choice)
Converts a choice to a FASTA tag, with no trailing vertical bar.
E_SIC Compare(const CSeq_id &sid2) const
Compare() - more general.
ESNPScaleLimit
SNP annotation scale limits.
static int FastaAARank(const CRef< CSeq_id > &id)
@ fLabel_Trimmed
Trim trailing FASTA delimeters.
@ fLabel_UpperCase
Upper case label, with special encoding for PDB chain-ids.
@ fLabel_Version
Show the version.
@ fLabel_GeneralDbIsContent
For type general, use the database name as the tag and the (text or numeric) key as the content.
@ eUnknownType
Unrecognized Seq-id type.
@ eFormat
Contents not parsable as expected.
@ eAcc_refseq_wgsv_intermed
@ eAcc_refseq_unique_prot
@ eAcc_ddbj_tpa_wgsvm_prot
@ eAcc_ddbj_tpa_targeted_nuc
@ eAcc_ddbj_tpa_targetedvm_nuc
@ eAcc_embl_tpa_wgsvm_nuc
@ eAcc_refseq_contig_ncbo
@ eAcc_ddbj_tpa_tsam_prot
@ eAcc_ddbj_tpa_tsav_prot
@ eAcc_refseq_mrna_predicted
@ eAcc_embl_tpa_wgsvm_prot
@ eAcc_ddbj_tpa_wgsm_prot
@ eAcc_ddbj_tpa_tsavm_nuc
@ eAcc_embl_tpa_wgsm_prot
@ eAcc_ddbj_tpa_targetedm_nuc
@ eAcc_ddbj_tpa_targetedv_nuc
@ eAcc_ddbj_tpa_tsavm_prot
@ eAcc_ddbj_targetedvm_nuc
@ eAcc_refseq_prot_predicted
@ eAcc_embl_tpa_tsam_prot
@ eAcc_embl_tpa_tsav_prot
@ eAcc_ddbj_targetedv_nuc
@ eAcc_embl_tpa_tsavm_prot
@ eAcc_refseq_wgsm_intermed
@ eAcc_ddbj_tpa_chromosome
@ eAcc_ddbj_tpa_wgsvm_nuc
@ eAcc_embl_tpa_wgsv_prot
@ eAcc_refseq_chromosome_ncbo
@ eAcc_refseq_ncrna_predicted
@ eAcc_refseq_wgsvm_intermed
@ eAcc_embl_tpa_tsavm_nuc
@ eAcc_refseq_wgs_intermed
@ eAcc_ddbj_targetedm_nuc
@ eAcc_ddbj_tpa_wgsv_prot
@ e_NO
different SeqId types-can't compare
@ e_YES
SeqIds compared, but are different.
@ fGpipeAddSecondary
Add "ACC.VER(=1)" for a 2ndary id.
@ fParse_NoFASTA
Don't bother checking for a tag.
@ fParse_RawText
Try to ID raw non-numeric accessions.
@ fParse_PartialOK
Warn rather than throwing an exception when a FASTA-style ID set contains unparsable portions,...
@ fParse_RawGI
Treat raw numbers as GIs, not local IDs.
@ fParse_AnyLocal
Treat otherwise unidentified strings as local accessions as long as they don't resemble FASTA-style I...
@ fParse_FallbackOK
For IdentifyAccession, don't warn about falling back to a different specific type because broad ident...
@ fParse_ValidLocal
Treat otherwise unidentified strings as raw accessions, provided that they pass rudimentary validatio...
@ eFormat_BestWithoutVersion
@ eFormat_BestWithVersion
@ eFastaContent
Like eFasta, but without any tag.
@ eContent
Untagged human-readable accession or the like.
@ eDefault
default is to show type + content
@ eBoth
Type and content, delimited by a vertical bar.
@ eFasta
Tagged ID in NCBI's traditional FASTA style.
@ eType
FASTA-style type, or database in GeneralDbIsContent mode.
@ fAllowUnderscores
Allow prefixes to contain underscores.
@ eSNPScaleLimit_Supercontig
@ eSNPScaleLimit_Chromosome
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,...
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
@ eParam_NoThread
Do not use per-thread values.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
NCBI_NS_STD::string::size_type SIZE_TYPE
const_iterator end() const
Return an iterator to the string's ending position (one past the end of the represented sequence)
static CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
static int StringToNonNegativeInt(const CTempString str, TStringToNumFlags flags=0)
Convert string to non-negative integer value.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static bool MatchesMask(CTempString str, CTempString mask, ECase use_case=eCase)
Match "str" against the "mask".
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
CTempString & assign(const char *src_str, size_type len)
Assign new values to the content of the a string.
static TNumeric StringToNumeric(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to a numeric value.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
const char * data(void) const
Return a pointer to the array represented.
void erase(size_type pos=0)
Truncate the string at some specified position Note: basic_string<> supports additional erase() optio...
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
void clear(void)
Clears the string.
size_type find_last_not_of(const CTempString match, size_type pos=npos) const
Find the last occurrence of any character not in the matching string within the current string,...
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
size_type length(void) const
Return the length of the represented array.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
CTempString substr(size_type pos) const
Obtain a substring from this string, beginning at a given offset.
size_type find_first_not_of(const CTempString match, size_type pos=0) const
Find the first occurrence of any character not in the matching string within the current string,...
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
size_type find_first_of(const CTempString match, size_type pos=0) const
Find the first occurrence of any character in the matching string within the current string,...
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
size_type find(const CTempString match, size_type pos=0) const
Find the first instance of the entire matching string within the current string, beginning at an opti...
static string & ToUpper(string &str)
Convert string to upper case â string& version.
const char *const kEmptyCStr
Empty "C" string (points to a '\0').
size_type size(void) const
Return the length of the represented array.
const_iterator begin() const
Return an iterator to the string's starting position.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
@ eTrunc_Both
Truncate whitespace at both begin and end of string.
C::value_type FindBestChoice(const C &container, F score_func)
Find the best choice (lowest score) for values in a container.
static const char label[]
void SetCountry(const TCountry &value)
Assign a value to Country data member.
bool IsNumber(void) const
Check if variant Number is selected.
TApp_number & SetApp_number(void)
Select the variant.
void SetId(TId &value)
Assign a value to Id data member.
TNumber & SetNumber(void)
Select the variant.
const TId & GetId(void) const
Get the Id member data.
const TNumber & GetNumber(void) const
Get the variant data.
const TApp_number & GetApp_number(void) const
Get the variant data.
void ResetDoc_type(void)
Reset Doc_type data member.
const TCountry & GetCountry(void) const
Get the Country member data.
bool IsStr(void) const
Check if variant Str is selected.
const TTag & GetTag(void) const
Get the Tag member data.
void SetTag(TTag &value)
Assign a value to Tag data member.
bool IsId(void) const
Check if variant Id is selected.
const TDb & GetDb(void) const
Get the Db member data.
E_Choice Which(void) const
Which variant is currently selected.
const TStr & GetStr(void) const
Get the variant data.
TStr & SetStr(void)
Select the variant.
virtual void Reset(void)
Reset the whole object.
void SetDb(const TDb &value)
Assign a value to Db data member.
TId & SetId(void)
Select the variant.
TId GetId(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
@ e_not_set
No variant selected.
const TRelease & GetRelease(void) const
Get the Release member data.
void SetSeqid(TSeqid value)
Assign a value to Seqid data member.
bool IsPatent(void) const
Check if variant Patent is selected.
void SetRel(TRel &value)
Assign a value to Rel data member.
TGeneral & SetGeneral(void)
Select the variant.
TChain GetChain(void) const
Get the Chain member data.
TNamed_annot_track & SetNamed_annot_track(void)
Select the variant.
const TEmbl & GetEmbl(void) const
Get the variant data.
const TPdb & GetPdb(void) const
Get the variant data.
void SetMol(const TMol &value)
Assign a value to Mol data member.
TGibbsq GetGibbsq(void) const
Get the variant data.
TPatent & SetPatent(void)
Select the variant.
TId GetId(void) const
Get the Id member data.
bool IsSetChain_id(void) const
chain identifier; length-independent generalization of 'chain' Check if a value has been assigned to ...
bool IsSetChain(void) const
Deprecated: 'chain' can't support multiple character PDB chain identifiers (introduced in 2015).
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
TEmbl & SetEmbl(void)
Select the variant.
const TTpe & GetTpe(void) const
Get the variant data.
bool IsSetRelease(void) const
the release Check if a value has been assigned to Release data member.
void SetName(const TName &value)
Assign a value to Name data member.
TOther & SetOther(void)
Select the variant.
const TGenbank & GetGenbank(void) const
Get the variant data.
const TName & GetName(void) const
Get the Name member data.
void SetId(TId value)
Assign a value to Id data member.
void ResetVersion(void)
Reset Version data member.
const TTpd & GetTpd(void) const
Get the variant data.
void SetAccession(const TAccession &value)
Assign a value to Accession data member.
bool IsGeneral(void) const
Check if variant General is selected.
TTpe & SetTpe(void)
Select the variant.
void SetRelease(const TRelease &value)
Assign a value to Release data member.
bool CanGetName(void) const
Check if it is safe to call GetName method.
const TTpg & GetTpg(void) const
Get the variant data.
TTpg & SetTpg(void)
Select the variant.
void ResetAccession(void)
Reset Accession data member.
E_Choice Which(void) const
Which variant is currently selected.
void ResetRelease(void)
Reset Release data member.
virtual void Reset(void)
Reset the whole object.
TPir & SetPir(void)
Select the variant.
bool IsSwissprot(void) const
Check if variant Swissprot is selected.
void ResetChain_id(void)
Reset Chain_id data member.
TGi GetGi(void) const
Get the variant data.
TGi & SetGi(void)
Select the variant.
TTpd & SetTpd(void)
Select the variant.
TVersion GetVersion(void) const
Get the Version member data.
TGibbmt & SetGibbmt(void)
Select the variant.
bool IsSetRelease(void) const
Check if a value has been assigned to Release data member.
const TRelease & GetRelease(void) const
Get the Release member data.
TGpipe & SetGpipe(void)
Select the variant.
bool IsSetRel(void) const
release date, month and year Check if a value has been assigned to Rel data member.
const TMol & GetMol(void) const
Get the Mol member data.
TSeqid GetSeqid(void) const
Get the Seqid member data.
E_Choice
Choice variants.
TDdbj & SetDdbj(void)
Select the variant.
void ResetRel(void)
Reset Rel data member.
const TOther & GetOther(void) const
Get the variant data.
const TGiim & GetGiim(void) const
Get the variant data.
const TSwissprot & GetSwissprot(void) const
Get the variant data.
void SetRelease(const TRelease &value)
Assign a value to Release data member.
void ResetDb(void)
Reset Db data member.
TLocal & SetLocal(void)
Select the variant.
TGiim & SetGiim(void)
Select the variant.
const TDdbj & GetDdbj(void) const
Get the variant data.
const TLocal & GetLocal(void) const
Get the variant data.
void ResetName(void)
Reset Name data member.
void ResetRelease(void)
Reset Release data member.
const TPir & GetPir(void) const
Get the variant data.
bool CanGetAccession(void) const
Check if it is safe to call GetAccession method.
const TGpipe & GetGpipe(void) const
Get the variant data.
const TChain_id & GetChain_id(void) const
Get the Chain_id member data.
void ResetChain(void)
Reset Chain data member.
void SetDb(const TDb &value)
Assign a value to Db data member.
TPrf & SetPrf(void)
Select the variant.
virtual void Reset(void)
Reset the whole object.
const TGeneral & GetGeneral(void) const
Get the variant data.
bool IsGi(void) const
Check if variant Gi is selected.
TGibbsq & SetGibbsq(void)
Select the variant.
TGenbank & SetGenbank(void)
Select the variant.
const TPatent & GetPatent(void) const
Get the variant data.
TGibbmt GetGibbmt(void) const
Get the variant data.
const TPrf & GetPrf(void) const
Get the variant data.
TSwissprot & SetSwissprot(void)
Select the variant.
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
void SetCit(TCit &value)
Assign a value to Cit data member.
const TRel & GetRel(void) const
Get the Rel member data.
void SetChain_id(const TChain_id &value)
Assign a value to Chain_id data member.
bool IsSetDb(void) const
dbase used in Check if a value has been assigned to Db data member.
const TCit & GetCit(void) const
Get the Cit member data.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
void SetVersion(TVersion value)
Assign a value to Version data member.
const TNamed_annot_track & GetNamed_annot_track(void) const
Get the variant data.
const TDb & GetDb(void) const
Get the Db member data.
const TAccession & GetAccession(void) const
Get the Accession member data.
void SetChain(TChain value)
Assign a value to Chain data member.
TPdb & SetPdb(void)
Select the variant.
@ e_Gibbmt
Geninfo backbone moltype.
@ e_Giim
Geninfo import id.
@ e_Other
for historical reasons, 'other' = 'refseq'
@ e_Gpipe
Internal NCBI genome pipeline processing ID.
@ e_Tpe
Third Party Annot/Seq EMBL.
@ e_Tpd
Third Party Annot/Seq DDBJ.
@ e_Gibbsq
Geninfo backbone seqid.
@ e_General
for other databases
@ e_Gi
GenInfo Integrated Database.
@ e_Named_annot_track
Internal named annotation tracking ID.
@ e_not_set
No variant selected.
@ e_Tpg
Third Party Annot/Seq Genbank.
@ e_MaxChoice
== e_Named_annot_track+1
const TInst & GetInst(void) const
Get the Inst member data.
const TId & GetId(void) const
Get the Id member data.
list< CRef< CSeq_id > > TId
TMol GetMol(void) const
Get the Mol member data.
Definition of all error codes used in objects libraries.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
Lightweight interface for getting lines of data with minimal memory copying.
bm::id_t bvector_size_type
constexpr bool empty(list< Ts... >) noexcept
const string version
version string
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Compressed bitset (entry point to bm.h)
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
Useful/utility classes and methods.
std::istream & in(std::istream &in_, double &x_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
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)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins lr(sljit_gpr dst, sljit_gpr src)
Define Case-insensitive string comparison methods.
TSmallSpecialMap::iterator prev_small_special
CTempString prev_special_type_name
SSubMap * special2_submap
TBigSpecialMap::iterator prev_big_special
TAccInfo FindAccInfo(CTempString name)
SSubMap & FindSubMap(TMainMap &rules, TFormatCode fmt)
unique_ptr< string > special2_old_name
TAccInfo prev_special_type
map< string, CTempString > default_fallbacks
TAccInfo prev_special_base_type
string prev_special_base_key
TMainMap::value_type * prev_submap
CTempString prev_type_name
TFormatCode prev_special_format
TAccInfo FindSpecial(const SAccGuide &guide, TFormatCode fmt, CTempString acc_or_range)
TBigSpecialMap big_specials
TSmallSpecialMap small_specials
void x_Load(const string &filename)
SAccGuide(const string &filename)
map< string, TPair > TBigSpecialMap
pair< bm::bvector<>, TAccInfo > TSmallSpecialOption
static TFormatCode s_Key(unsigned short letters, unsigned short digits)
pair< string, TAccInfo > TPair
pair< string, string > TFallback
CSeq_id::EAccessionInfo TAccInfo
multimap< string, TSmallSpecialOption > TSmallSpecialMap
static bm::bvector_size_type x_SplitSpecial(CTempString &acc, TFormatCode fmt)
const TAccInfo & Find(TFormatCode fmt, const CTempString &acc_or_pfx, string *key_used=NULL) const
SAccGuide(ILineReader &lr)
map< string, TAccInfo > TPrefixes
map< const TAccInfo *, TFallback > TFallbackMap
void x_AddSpecial(SSubMap &submap, SHints &hints, TFormatCode fmt, CTempString from, CTempString to, TAccInfo value, const string *old_name, const CTempString &new_name)
map< TFormatCode, SSubMap > TMainMap
void AddRule(const CTempString &rule, SHints &hints)
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
static const char * kUnknown
string g_FindDataFile(const CTempString &name, CDirEntry::EType type=CDirEntry::eFile)
Look for an NCBI application data file or directory of the given name and type; in general,...
bool g_IsDataFileOld(const CTempString &path, const CTempString &id_line)
Check whether the given file (a full path, as returned by g_FindDataFile) is older than a built-in ve...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4