143 if (iter != sm_NameTypeMap.end()) {
155 for (iter = sm_NameTypeMap.begin(); iter != sm_NameTypeMap.end(); ++iter) {
156 if (iter->second ==
type) {
187 view = reg.
GetReadView(
"GBENCH.Utils.AnnotSelector");
189 if (view.
GetBool(
"ExcludeExternal")) {
198 static const char* named_annots[] = {
205 for (
const char** p = named_annots; p && *p; ++p) {
206 bool incl = view.
GetBool(*p,
true);
215 if (view.
GetBool(
"AdaptiveDepth",
true)) {
274 bool include_naas =
false;
276 if (include_naas && annots.empty()) {
280 ITERATE (vector<string>, iter, annots) {
281 const string& annot = *iter;
312 bool adaptive,
int depth)
324 sel.AddUnnamedAnnots();
327 sel.ExcludeUnnamedAnnots();
335 bool include_naas =
false;
337 sel.IncludeNamedAnnotAccession(
"NA*");
343 sel.AddNamedAnnots(annot);
345 sel.IncludeNamedAnnotAccession(annot);
356 return reg.
GetReadView(
"GBENCH.Utils.AnnotSelector");
361 return view.
GetInt(
"MaxSearchSegments", 0);
366 string max_search_segs_action = view.
GetString(
"MaxSearchSegmentsAction",
"silent");
369 if(max_search_segs_action ==
"throw") {
371 }
else if (max_search_segs_action ==
"log") {
375 return MaxSearchSegmentsAction;
380 if (
max > 0 && actual >
max) {
384 "CSeqUtils::CheckMaxSearchSegments: search segments limit exceeded");
390 ERR_POST(
"CSeqUtils::CheckMaxSearchSegments: search segments limit exceeded");
401 return view.
GetInt(
"MaxSearchTime", 0);
406 bool adaptive,
int depth)
409 sel.SetAdaptiveDepth(
true);
410 sel.SetExactDepth(
false);
419 sel.SetMaxSearchSegments(max_search_segs);
420 if(max_search_segs > 0) {
426 sel.SetResolveDepth(
depth);
428 }
else if (
depth >= 0) {
429 sel.SetResolveDepth(
depth);
430 sel.SetExactDepth(
true);
431 sel.SetAdaptiveDepth(
false);
442 template <
class T,
class U>
445 bool operator()(
const pair<T,U>& p1,
const pair<T,U>& p2)
const
447 return p1.first < p2.first;
465 feature::CFeatTree
tree;
466 tree.SetFeatIdMode(feature::CFeatTree::EFeatIdMode(
mode));
473 tree.AddFeature(curr_feat->GetMappedFeature());
474 fmap[curr_feat->GetMappedFeature()] = curr_feat;
481 CMappedFeat parent_feat =
tree.GetParent(curr_feat->GetMappedFeature());
483 fmap[parent_feat]->AddChild(curr_feat);
486 out_feats.push_back(curr_feat);
491 out_feats.swap(feats);
504 SRelLoc converter(dummy_parent, child, scope);
506 return converter.
Resolve(scope);
562 if ( !it_r->Empty() ) {
563 p_int.
AddInterval(
id, it_r->GetFrom(), it_r->GetTo());
566 switch (p_int.
Get().size()) {
592 if(it != loc_map.
end()) {
632 bioseq->
SetInst().SetLength((
int)seq_string.size());
646 bioseq->
SetId().push_back(
id);
651 id->GetLabel(&title_str);
655 bioseq->
SetDescr().Set().push_back(title);
668 if (handle.
IsSynonym(iter.GetSeq_id())) {
670 if ( !
range.Empty() ) {
672 range.GetTo(), iter.GetStrand());
676 switch (p_int.
Get().size()) {
702 }
else if (annot_handle.
IsNamed()) {
714 if ((*descrIter)->IsTitle()) {
715 name = (*descrIter)->GetTitle();
717 }
else if ((*descrIter)->IsName()) {
718 name = (*descrIter)->GetName();
729 if ((*descrIter)->IsUser()) {
730 const auto& user((*descrIter)->GetUser());
731 if(user.GetType().IsStr() && user.GetType().GetStr() ==
type && user.HasField(
label)) {
732 return user.GetFieldRef(
label);
756 if ((*descrIter)->IsComment()) {
757 return (*descrIter)->GetComment();
764 static bool s_IsNAA(
const string& annot,
char div)
771 size_t len = annot.size();
772 if (
len >= acc_len && annot[0] ==
'N' && annot[1] ==
'A') {
774 while (
i < acc_len && annot[
i] >=
'0' && annot[
i] <=
'9') {
779 if (
len == acc_len) {
782 else if (annot[
i++] == div) {
783 while (
i <
len && annot[
i] >=
'0' && annot[
i] <=
'9') {
809 return "rmt_pipleine_" + sSuffix;
820 return sFileType ==
"bigBed" || sFileType ==
"bigWig" || sFileType ==
"vcfTabix" || sFileType ==
"vcf";
826 size_t posHashSign{sAnnotName.find(
'#')};
828 if(posHashSign ==
NPOS) {
832 return s_IsNAA(sAnnotName, div);
835 if(!
s_IsNAA(sAnnotName.substr(0, posHashSign), div))
839 if(posHashSign == sAnnotName.length() - 1) {
842 for(
size_t i = posHashSign+1;
i<sAnnotName.length(); ++
i) {
843 if(sAnnotName[
i] <
'0' || sAnnotName[
i] >
'9') {
869 vector<string> parts;
873 return parts.size() > 1 ? parts[1] :
string();
879 vector<string> parts;
883 return parts.size() > 2 ? parts[2] :
string(
"N");
889 if (acc.size() < 3 || acc[1] !=
'R')
973 static string base_url =
"https://www.ncbi.nlm.nih.gov";
980 return "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
992 return "<tr><td align=\"right\" valign=\"top\" nowrap><b>" +
tag + (
tag.empty() ?
"" :
":") +
" " +
993 "</b></td><td valign=\"top\" width=\"200\">" +
value +
"</td></tr>";
999 return "<tr><td align=\"right\" nowrap>[<i>" +
tag +
"</i>] </td><td></td></tr>";
1004 const string&
label,
1007 return "<tr><td align=\"right\" valign=\"top\" nowrap><b>" +
tag +
": " +
1008 "</b></td><td width=\"200\"><a href=\"" + url +
"\">" +
label +
"</a></td></tr>";
1018 for (; aln_iter; ++aln_iter) {
1035 if (r_map.count(target_gi) == 0) {
1039 r_map[target_gi].CombineWith(
TSeqRange(from, to));
1045 ITERATE(TRangeMap, iter, r_map) {
1047 id->SetGi(iter->first);
1049 iter->second.GetTo()));
1050 mapped_locs.push_back(loc);
1056 "https://www.ncbi.nlm.nih.gov/sviewer/links.fcgi?link_name=gi_placement&report=asn";
1060 static string LinksUrl;
1061 if (LinksUrl.empty()) {
1071 timeout.
sec = time_out_sec;
1078 *obj_stream >> align_set;
1080 LOG_POST(
Error <<
"Failed to retrieve gi placements for gi|"
1081 << gi <<
", error: " << e.
GetMsg());
1148 *obj_stream >> align_set;
1164 timeout.
sec = time_out_sec;
1171 SourceFrom = loc.GetInt().GetFrom();
1172 SourceTo = loc.GetInt().GetTo();
1173 if(loc.GetInt().GetId().IsGi()) {
1174 SourceGi = loc.GetInt().GetId().GetGi();
1178 }
else if(loc.IsPnt()) {
1179 SourceFrom = loc.GetPnt().GetPoint();
1180 SourceTo = SourceFrom;
1181 if(loc.GetPnt().GetId().IsGi()) {
1182 SourceGi = loc.GetPnt().GetId().GetGi();
1189 if(SourceTo < SourceFrom) {
1190 swap(SourceTo, SourceFrom);
1199 *obj_stream >> align_set;
1201 LOG_POST(
Error <<
"Failed to retrieve location placements for gi|"
1202 << SourceGi <<
", error: " << e.
GetMsg());
1207 TRangeMap range_map;
1209 for(; aln_iter; ++aln_iter) {
1225 if (i_source_from > i_source_to) {
1226 swap(i_source_from, i_source_to);
1228 if(i_source_from <= SourceFrom && SourceTo <= i_source_to) {
1237 range_map[target_gi] =
TSignedSeqRange(from + (SourceFrom - i_source_from), from + (SourceTo - i_source_from));
1243 ITERATE (TRangeMap, iter, range_map) {
1245 id->SetGi(iter->first);
1247 mapped_locs.push_back(loc);
1254 long& from,
long& to)
1270 size_t len =
str.length();
1272 if (
len == 0)
return false;
1283 bool space_before_this =
false;
1284 bool separator_before_this =
false;
1285 for (
size_t i = 0;
i <
len; ++
i) {
1291 if ( !separator_before_this )
1292 space_before_this =
true;
1295 if (separator_before_this)
return false;
1297 space_before_this =
false;
1301 if (separator_before_this)
return false;
1303 space_before_this =
false;
1305 out_str.append(
"000");
1309 if (separator_before_this)
return false;
1311 space_before_this =
false;
1313 out_str.append(
"000000");
1319 space_before_this =
false;
1320 separator_before_this =
true;
1323 if (separator_before_this) {
1324 out_str.append(
"-");
1325 separator_before_this =
false;
1326 }
else if (space_before_this) {
1327 out_str.append(
"-");
1328 space_before_this =
false;
1330 out_str.append(1,
str[
i]);
1335 typedef vector<string> TPositions;
1338 if (pos.size() < 3) {
1340 bool is_from =
true;
1343 if (iter->empty())
continue;
1369 #ifdef NCBI_STRICT_GI
1372 uids_from.push_back(gi);
1383 LOG_POST(
Error <<
"Failed to get assembly entrez ids for gi: " << gi <<
". Error: " << e.
GetMsg());
1386 if (uids_to.empty())
1402 for (itNode = nodes.
begin(); itNode != nodes.
end(); ++itNode) {
1406 gc_ids.push_back(NStr::StringToNumeric<TEntrezId>(
id));
1422 assm->
Find(idh, sequences);
1426 if(replicon->IsSetName()) {
1427 return replicon->GetName();
1431 LOG_POST(
Error <<
"Call to GenColl timed out when getting assembly: " << *iGCId);
1459 for (
auto it : top_level_seqs) {
1460 const CSeq_id& tls_seq_id = it->GetSeq_id();
1461 ids.emplace_back(&tls_seq_id);
1489 string sNormalizedSeqId(seq_id.
AsFastaString() +
":" + assm_acc);
1499 if (scope && !assembly_ids.empty() && assembly_ids.front()->IsGi()) {
1502 bool all_checked =
true;
1503 for (
const auto&
id : assembly_ids) {
1507 all_checked =
false;
1510 if (id->GetGi() == gi) {
1525 for (
const auto&
id : assembly_ids) {
1526 if(
Match(seq_id, *
id, scope)) {
1536 }
catch (exception& e) {
1537 LOG_POST(
Error <<
"Call to GenColl timed out when getting assembly: " << assm_acc <<
", " << e.what());
1546 if(!id_str.empty() ) {
1548 seq_id->Set(id_str);
1549 objects::CBioseq_Handle bsh = scope.GetBioseqHandle(*seq_id);
1550 objects::CSeq_id_Handle shdl = bsh.GetAccessSeq_id_Handle();
1589 for (itAcc = doc_sums.
begin(); itAcc != doc_sums.
end(); ++itAcc) {
1597 template<
class T1,
class T2>
1598 static void s_ELinkQuery(
const string &db_from,
const string &db_to,
const vector<T1> &uids_from, vector<T2> &uids_to,
const string &
cmd,
const string &xpath)
1605 for (itLink = links.
begin(); itLink != links.
end(); ++itLink) {
1609 uids_to.push_back(NStr::StringToNumeric<T2>(
id));
1631 ecli.
Link(db_from, db_to, uids_from,
xml,
cmd);
1635 string docstr(sb.str());
1652 static void s_ESearchQuery(
const string &db,
const string &term, vector<T> &uids,
size_t &count,
const int ret_max,
const string &xpath)
1662 string docstr(sb.str());
1667 for (itLink = links.
begin(); itLink != links.
end(); ++itLink) {
1671 uids.push_back(NStr::StringToNumeric<T>(
id));
1674 if (!countStr.empty())
1677 count = uids.size();
1686 static void s_ESearchQuery(
const string &db,
const string &term,
const string &web_env,
const string &query_key, vector<T> &uids,
size_t &count,
int retstart,
const string &xpath)
1693 for (itLink = links.
begin(); itLink != links.
end(); ++itLink) {
1697 uids.push_back(NStr::StringToNumeric<T>(
id));
1700 if (!countStr.empty())
1703 count = uids.size();
1706 void CSeqUtils::ESearchQuery(
const string &db,
const string &term,
const string &web_env,
const string &query_key,
TEntrezIds &uids,
size_t &count,
int retstart,
const string &xpath)
1708 s_ESearchQuery(db, term, web_env, query_key, uids, count, retstart, xpath);
1717 ecli.
SearchHistory(db, term, web_env, NStr::StringToNumeric<Int8>(query_key), retstart,
xml);
1721 string docstr(sb.str());
1724 searchset.
swap(doc);
1731 if (parent.
end() == itNode)
1750 #ifdef NCBI_STRICT_GI
1753 uids_from.push_back(gi);
1763 LOG_POST(
Error <<
"Failed to get assembly ids for gi: " << gi <<
". Error: " << e.
GetMsg());
1794 if (annot && annot.
IsNamed()) {
1795 const string& annot_str = annot.
GetName();
1804 CAlign_CI align_iter(scope, *aln_loc, sel);
1806 while (align_iter && !align_ref) {
1810 if (num_row != 2)
continue;
1818 align_ref.
Reset(&align);
1841 locs.push_back(prod_loc);
1842 locs.push_back(gen_loc);
1847 #undef MAP_INFO_DEBUG
1864 while (it1 && it2) {
1878 int1->
SetId(*prod_id);
1885 int2->
SetId(*gen_id);
1889 info.emplace_back(int1, int2);
1901 const objects::CSeq_loc& feat_loc,
1903 const objects::CBioseq_Handle& handle)
1907 if (locs.size() == 2) {
1928 #ifdef MAP_INFO_DEBUG
1929 cout <<
"\n===== Original Map ==========\n";
1930 for (
const auto& it : cds_map_info) {
1931 auto& gen_int = get<1>(it);
1932 auto& prod_int = get<0>(it);
1933 cout << gen_int->GetFrom() <<
".." << gen_int->GetTo() <<
"->" << prod_int->GetFrom() <<
".." << prod_int->GetTo() << endl;
1935 cout <<
"\n========================\n";
1942 int curr_prod_pos = -1;
1943 int last_prod_pos = -1;
1945 auto cds_map_it = cds_map_info.begin();
1946 while (cds_map_it != cds_map_info.end()) {
1947 auto& gen_int = cds_map_it->second;
1949 if ((gen_int->GetTo() - gen_int->GetFrom()) + 1 < 3) {
1950 cds_map_it = cds_map_info.erase(cds_map_it);
1954 auto prod_loc =
Ref(
new CSeq_loc(gen_int->SetId(), gen_int->GetFrom(), gen_int->GetTo(), gen_int->GetStrand()));
1955 auto mapped_prod_loc = map2prod.
Map(*prod_loc);
1956 auto mapped_gen_loc = map2loc.
Map(*mapped_prod_loc);
1958 #ifdef MAP_INFO_DEBUG
1963 cout <<
"Remapped to\n";
1968 list<TSeqRange> rngs;
1969 for (
size_t i = 0;
i < sz; ++
i, ++lit) {
1973 if (
i == 0 &&
r.GetLength() < 3) {
1976 if (
i == sz - 1 &&
r.GetLength() < 3)
1980 if (!rngs.empty()) {
1981 bool reverse = gen_int->CanGetStrand() && gen_int->GetStrand() ==
eNa_strand_minus;
1983 auto& prod_int = cds_map_it->first;
1984 auto r_it = rngs.begin();
1987 gen_int->SetFrom(max<int>(r_it->GetFrom(), gen_int->GetFrom()));
1988 gen_int->SetTo(gen_int->GetTo());
1991 gen_int->SetFrom(gen_int->GetFrom());
1992 gen_int->SetTo(min<int>(r_it->GetTo(), gen_int->GetTo()));
1994 if (curr_prod_pos == -1) {
1995 curr_prod_pos = prod_int->SetFrom();
1997 else if (last_prod_pos != -1) {
1998 if (prod_int->SetFrom() - last_prod_pos > 0) {
1999 curr_prod_pos += (prod_int->SetFrom() - last_prod_pos);
2002 last_prod_pos = prod_int->GetTo() + 1;
2003 prod_int->SetFrom(curr_prod_pos);
2004 curr_prod_pos += (gen_int->GetTo() - gen_int->GetFrom());
2005 prod_int->SetTo(curr_prod_pos);
2008 while (r_it != rngs.end()) {
2012 auto from = curr_prod_pos;
2013 curr_prod_pos += r_it->GetLength() - 1;
2016 cds_map_it = cds_map_info.emplace(++cds_map_it, int1, int2);
2024 #ifdef MAP_INFO_DEBUG
2026 cout <<
"\n=====Final Map ==========\n";
2027 for (
const auto& it : cds_map_info) {
2028 auto& gen_int = get<1>(it);
2029 auto& prod_int = get<0>(it);
2030 cout << gen_int->GetFrom() <<
".." << gen_int->GetTo() <<
"->" << prod_int->GetFrom() <<
".." << prod_int->GetTo() << endl;
2032 cout <<
"\n========================\n";
2042 const int feat_offset)
2048 int cds_offset = -1;
2063 for (; feat_iter; ++feat_iter) {
2077 prod_id->
Assign(product_id);
2088 TMappingInfo::const_iterator iter = mapping_info.begin();
2090 while (iter != mapping_info.end() && !
done) {
2091 auto& gen_int = iter->second;
2092 auto& prod_int = iter->first;
2094 TSeqPos gen_from = gen_int->GetFrom();
2095 TSeqPos gen_to = gen_int->GetTo();
2096 TSeqPos prod_from = prod_int->GetFrom();
2097 TSeqPos prod_to = prod_int->GetTo();
2098 bool reverse = gen_int->CanGetStrand() && gen_int->GetStrand() ==
eNa_strand_minus;
2101 if (cds_map_info.empty()) {
2102 if (bio_start >= gen_from && bio_start <= gen_to) {
2104 TSeqPos off1 = reverse ? gen_to - bio_start : bio_start - gen_from;
2105 r1.
Set(prod_from + off1, prod_to);
2107 r2.
Set(gen_from, gen_to - off1);
2109 r2.
Set(gen_from + off1, gen_to);
2116 r1.
Set(prod_from, prod_to);
2117 r2.
Set(gen_from, gen_to);
2122 if (bio_stop >= gen_from && bio_stop <= gen_to) {
2124 TSeqPos off2 = reverse ? bio_stop - gen_from : gen_to - bio_stop;
2136 int1->
SetId(*prod_id);
2142 int2->
SetId(*gen_id);
2146 cds_map_info.emplace_back(int1, int2);
2154 if ( !cds_map_info.empty() ) {
2168 cds_map_info.clear();
2181 if (!cds_map_info.empty() && (0 != feat_offset)) {
2182 if (feat_offset > 0) {
2183 auto& prod_int = cds_map_info.begin()->first;
2184 prod_int->SetFrom(prod_int->GetFrom() + feat_offset);
2185 auto& gen_int = cds_map_info.begin()->second;
2186 gen_int->SetFrom(gen_int->GetFrom() + feat_offset);
2189 auto& prod_int = cds_map_info.begin()->first;
2190 prod_int->SetFrom(prod_int->GetFrom() - feat_offset);
2191 auto& gen_int = cds_map_info.begin()->second;
2192 gen_int->SetTo(gen_int->GetTo() + feat_offset);
2195 return cds_map_info;
2200 const objects::CSeq_loc &feat_loc,
2201 const objects::CSeq_id &product_id,
2202 const int feat_offset
2207 gen_id->
Assign(*feat_loc.GetId());
2209 prod_id->
Assign(product_id);
2215 start +=
r.GetLength();
2218 info.emplace_back(int1, int2);
2221 if (!
info.empty() && (0 != feat_offset)) {
2222 if (feat_offset > 0) {
2223 auto& prod_int =
info.begin()->first;
2224 prod_int->SetFrom(prod_int->GetFrom() + feat_offset);
2225 auto& gen_int =
info.begin()->second;
2226 gen_int->SetFrom(gen_int->GetFrom() + feat_offset);
2229 auto& prod_int =
info.begin()->first;
2230 prod_int->SetFrom(prod_int->GetFrom() - feat_offset);
2231 auto& gen_int =
info.begin()->second;
2232 gen_int->SetTo(gen_int->GetTo() + feat_offset);
2245 if ( !loc_obj.
GetId() ) {
2249 loc.
Reset(&loc_obj);
2257 if (!named_acc.empty()) {
2288 auto GetCDSFrame = [&]() {
2305 int offset = GetCDSFrame();
2315 if (mrna_info.empty())
2326 static unsigned id_num{ 0 };
2327 int offset = GetCDSFrame();
2339 if (!gi_str)
return match;
2346 for (
size_t i = pos + 3;
i < sid.length(); ++
i) {
2349 gi_str->append(1, c);
2379 shown_desc->
SetType().SetStr(
"x-sv-track-settings");
2380 shown_desc->
AddField(
"show-track", isShown);
2381 annot.AddUserObject(*shown_desc);
2402 if (!
id &&
str.find(
'|') !=
NPOS) {
2418 mapper->MapObject(*
id);
2437 for (
CBioseq_CI bioseq_it(*handle); bioseq_it; ++bioseq_it) {
2439 if (bioseq_it->IsSetDescr()) {
2442 if (dit->GetPointer() == &seq_desc) {
2465 if (entry_ci->IsSetDescr()) {
2467 if ((*dit)->IsPub()) {
2469 if (&desc_pub == &pubdesc) {
2475 if (entry_ci->IsSeq()) {
2477 if (&(
fi->GetData().GetPub()) == &pubdesc) {
2495 if (handles.size() > 0) {
2509 if (
f->GetSeq_feat() == &feat) {
2523 if (
f.IsSetLocation()) {
2525 if (subloc && !subloc.
IsEmpty()) {
2547 const objects::CSeq_entry* seqEntry =
dynamic_cast<const objects::CSeq_entry*
>(ptr);
2548 const objects::CBioseq* bioseq =
dynamic_cast<const objects::CBioseq*
>(ptr);
2549 const objects::CBioseq_set* bioseq_set =
dynamic_cast<const objects::CBioseq_set*
>(ptr);
2550 const objects::CSeq_annot* seqannot =
dynamic_cast<const objects::CSeq_annot*
>(ptr);
2551 const objects::CSeq_feat* seqfeat =
dynamic_cast<const objects::CSeq_feat*
>(ptr);
2552 const objects::CSeqdesc* seqdesc =
dynamic_cast<const objects::CSeqdesc*
>(ptr);
2553 const objects::CSeq_submit* seqsubmit =
dynamic_cast<const objects::CSeq_submit*
>(ptr);
2554 const objects::CPubdesc* pubdesc =
dynamic_cast<const objects::CPubdesc*
>(ptr);
2555 const objects::CSeq_loc* loc =
dynamic_cast<const objects::CSeq_loc*
>(ptr);
2556 const objects::CSeq_id* seq_id =
dynamic_cast<const objects::CSeq_id*
>(ptr);
2558 objects::CSeq_entry_Handle seh;
2565 seh = seh.GetTopLevelEntry();
2570 }
else if(bioseq_set) {
2575 }
else if(seqannot) {
2578 seh = sah.GetTopLevelEntry();
2579 }
else if(seqfeat) {
2584 }
else if (seqdesc) {
2587 seh = seh.GetTopLevelEntry();
2591 }
else if (pubdesc) {
2594 seh = seh.GetTopLevelEntry();
2598 }
else if (seqsubmit) {
2599 if (seqsubmit->IsEntrys() && seqsubmit->GetData().GetEntrys().front()) {
2607 }
else if (seq_id) {
2626 char ch1 = str1.c_str()[0];
2627 char ch2 = str2.c_str()[0];
2641 if (
ch1 ==
'~' &&
ch2 ==
'~') {
2643 }
else if (
ch1 ==
'~') {
2645 }
else if (
ch2 ==
'~') {
2648 if (
ch1 ==
'-' &&
ch2 ==
'-') {
2650 }
else if (
ch1 ==
'-') {
2652 }
else if (
ch2 ==
'-') {
2662 vector<const CFeatListItem * > r_list;
2669 present[
fi->GetData().GetSubtype()] =
true;
2679 vector<const CFeatListItem * > used;
2680 vector<const CFeatListItem * > popular;
2681 vector<const CFeatListItem * > import_feats;
2682 vector<const CFeatListItem * > least_liked;
2683 vector<const CFeatListItem * > unused;
2689 int subtype =
f->GetSubtype();
2697 string desc =
f->GetDescription();
2698 if (existing.
find(desc) == existing.
end())
2702 if (!present[subtype]) {
2703 unused.push_back(
f);
2711 import_feats.push_back(
f);
2714 popular.push_back(
f);
2723 popular.push_back(
f);
2726 least_liked.push_back(
f);
2742 r_list.insert(r_list.begin(), popular.begin(), popular.end());
2743 r_list.insert(r_list.end(), used.begin(), used.end());
2744 r_list.insert(r_list.end(), least_liked.begin(), least_liked.end());
2745 r_list.insert(r_list.end(), import_feats.begin(), import_feats.end());
2746 r_list.insert(r_list.end(), unused.begin(), unused.end());
2749 r_list.insert(r_list.begin(),
all);
2757 vector<string> range_pairs;
2760 ITERATE (vector<string>, iter, range_pairs) {
2763 if (pos.size() != 2)
continue;
2766 if ( !f_str.empty() && !t_str.empty() ) {
2794 id->Assign(*idh.GetSeqId());
2798 auto mapped_loc =
Map(*loc);
2801 if (mapped_loc && !mapped_loc->IsNull() && !mapped_loc->IsEmpty() && mapped_loc->GetId())
2813 for (; idit; ++idit) {
2815 if (ids.emplace(&
id).second ==
false)
2819 auto mapped_loc =
Map(*loc);
2820 if (!mapped_loc || !mapped_loc->GetId())
2822 id.Assign(*mapped_loc->GetId());
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Biological
5' and 3'
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CRef< CSeq_align > ConvertSeq_align(const CSeq_align &src, CSeq_align::TSegs::E_Choice dst_choice, CSeq_align::TDim anchor_row=-1, CScope *scope=NULL)
Convert source alignment to a new type.
CSeq_entry_Handle GetSeqEntryForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)
int GetGenCode(int def=1) const
This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...
void SetMaxReturn(int ret_max)
void SearchHistory(const string &db, const string &term, const string &web_env, Int8 query_key, int retstart, CNcbiOstream &ostr)
Uint8 Search(const string &db, const string &term, vector< objects::CSeq_id_Handle > &uids, const string &xml_path=kEmptyStr)
void Summary(const string &db, const vector< objects::CSeq_id_Handle > &uids, xml::document &docsums, const string &version="")
void Link(const string &db_from, const string &db_to, const vector< objects::CSeq_id_Handle > &uids_from, vector< objects::CSeq_id_Handle > &uids_to, const string &xml_path=kEmptyStr, const string &command="neighbor")
CFeatListItem - basic configuration data for one "feature" type.
string GetDescription() const
CConfigurableItems - a static list of items that can be configured.
string GetAccession() const
Retrieve the accession for this assembly.
void Find(const CSeq_id_Handle &id, TSequenceList &sequences) const
Find all references to a given sequence within an assembly.
bool IsRefSeq() const
Is this assembly a RefSeq assembly?
list< CConstRef< CGC_Sequence > > TSequenceList
void GetMolecules(TSequenceList &molecules, ESubset subset) const
Retrieve a subset of molecules.
CRef< objects::CSeq_loc > Map(const objects::CSeq_loc &Loc, const SIdSpec &Spec) const
static bool isGenCollSequence(const objects::CBioseq_Handle &handle)
static CRef< CGencollSvc > GetInstance(void)
static CRef< objects::CGenomicCollectionsService > GetGenCollService(int timeout_sec=-1)
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
static CNcbiApplication * Instance(void)
Singleton method.
void AddInterval(const CSeq_interval &ival)
for convenience
@Pubdesc.hpp User-defined methods of the data storage class.
TThisType & CombineWith(const TRange &r)
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
bool GetBool(const string &key, bool default_val=false) const
list< SKeyInfo > TKeys
retrieve information about all keys in the registry
string GetString(const string &key, const string &default_val=kEmptyStr) const
void GetKeys(TKeys &keys) const
Retrieve information about all keys in this view.
ESubtype GetSubtype(void) const
static const CFeatList * GetFeatList()
@ eSubtype_transit_peptide
@ eSubtype_bad
These no longer need to match the FEATDEF values in the C toolkit's objfdef.h.
TDim CheckNumRows(void) const
Validatiors.
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
namespace ncbi::objects::
int Compare(const CSeq_feat &f2) const
Compare relative order of this feature and feature f2, ordering first by features' coordinates,...
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
static TSeqPos Pack(CSeq_data *in_seq, TSeqPos uLength=ncbi::numeric_limits< TSeqPos >::max())
Base class for all serializable objects.
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
TBase::const_iterator const_iterator
static CSeq_id_Handle GetSeq_id_Handle(const const_iterator &iter)
Template class for iteration on objects of class C (non-medifiable version)
Template class for iteration on objects of class C.
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
General IdMapper interface.
Task clients implement this callback interface.
container_type::const_iterator const_iterator
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
The xml::document class is used to hold the XML tree and various bits of information about it.
void swap(document &other)
Swap one xml::document object for another.
const node & get_root_node(void) const
Get a reference to the root node of this document.
The xml::node::const_iterator provides a way to access children nodes similar to a standard C++ conta...
The xml::node_set::const_iterator class is used to iterate over nodes in a node set.
The xml::node_set class is used to store xpath query result set.
iterator begin()
Get an iterator that points to the beginning of the xpath query result node set.
iterator end()
Get an iterator that points one past the last node in the xpath query result node set.
The xml::node class is used to hold information about one XML node.
iterator end(void)
Get an iterator that points one past the last child for this node.
iterator find(const char *name, const ns *nspace=NULL)
Find the first child node that has the given name and namespace.
node_set run_xpath_query(const xpath_expression &expr)
Run the given XPath query.
const char * get_content(void) const
Get the content for this text node.
string GetSeqIdString(const CSeq_id &id)
static unsigned char depth[2 *(256+1+29)+1]
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
#define ENTREZ_ID_TO(T, entrez_id)
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
unsigned int THTTP_Flags
Bitwise OR of EHTTP_Flag.
@ fHTTP_AutoReconnect
See HTTP_CreateConnectorEx()
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
static CConstRef< objects::CSeq_loc > GetFeatLocation(const objects::CSeq_feat &feat, const objects::CBioseq_Handle &bsh)
static bool StringToRange(const string &range_str, long &from, long &to)
Convert a range string to a range.
virtual void SetTaskName(const string &name)=0
virtual void SetTaskCompleted(int completed)=0
set total finished task number.
static int GetMaxSearchTime(const CRegistryReadView &view)
static string CreateLinkRow(const string &tag, const string &label, const string &url)
static TMappingInfo GetMappingInfoFromLocation(const objects::CSeq_loc &feat_loc, const objects::CSeq_id &product_id, const int feat_offset=0)
static TMappingInfo GetRnaMappingInfo(const objects::CSeq_loc &feat_loc, const objects::CMappedFeat &feat, const objects::CBioseq_Handle &handle)
Helper function to generate mapping info between the specified product sequence and genomic sequence ...
static void ELinkQuery(const string &db_from, const string &db_to, const TEntrezIds &uids_from, TEntrezIds &uids_to, const string &cmd="neighbor", const string &xpath="//Link/Id/text()")
Queries elink.fcgi with a vector of uids/seq-ids (seq-ids preferred for future compatibility) and ret...
static string GetAlignDbIsQuery(const string &annot)
get a is_source_assembly_query string from AlignDb annotation suffixed after a second '#'
static bool LinkFeatures(CLinkedFeature::TLinkedFeats &feats, TFeatLinkingMode mode=1, ISeqTaskProgressCallback *p_cb=NULL)
Link features into a hierarchical list.
static bool IsNAA(const string &annot, bool isStrict=false)
check if a given annotation is a named annotation accession[.version][number] when isSctrict == false...
static bool IsException(const objects::CSeq_feat &feat)
static objects::CBioseq * SeqLocToBioseq(objects::CScope &scope, const objects::CSeq_loc &loc)
Construct a bioseq to fit a given location.
static bool isRmtPipelineFileType(const string &sFileType)
check if a file type is one of remote file types
static TLocVec GetAccessionPlacements(const objects::CSeq_id &id, objects::CScope &scope, int time_out_sec=1, THTTP_Flags flags=fHTTP_AutoReconnect)
Retrieve mapped-up sequences.
static bool isTopLevel(const objects::CSeq_id &seq_id, const string &assm_acc, objects::CScope *scope=NULL)
static bool IsPartialStart(const objects::CSeq_loc &loc)
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
list< CRef< CLinkedFeature > > TLinkedFeats
static bool IsPartialFeature(const objects::CSeq_feat &feat)
static TLocVec GetGiPlacements(TGi gi, int time_out_sec=5, THTTP_Flags flags=fHTTP_AutoReconnect)
Retrieve mapped-up sequences.
static void ESearchQuery(const string &db, const string &term, TEntrezIds &uids, size_t &count, const int ret_max, const string &xpath="//IdList/Id/text()")
Queries esearch.fcgi and returns a vector of uids/seq-ids (seq-ids preferred for future compatibility...
vector< CRef< objects::CSeq_loc > > TLocVec
static TMappingInfo GetCdsMappingInfoFromRna(const TMappingInfo &rna_mapping_info, const objects::CSeq_feat &rna_feat, const objects::CMappedFeat &mapped_cds_feat, const objects::CSeq_loc &feat_loc, objects::CScope &scope, const int feat_offset=0)
Derive the CDS feature mapping information based on its parent RNA feature mapping info.
static string GetNcbiBaseUrl()
static int GetMaxSearchSegments(const CRegistryReadView &view)
static bool IsAlignDb(const string &annot)
check if a given annotation is AlignDb (potentially suffixed with batch identication string after a '...
static const string & NameTypeValueToStr(TAnnotNameType type)
vector< TEntrezId > TEntrezIds
static void GetAssmAccs_Gi(TAccs &accs, TGi gi)
get all assembly accessions corresponding to a GI
static objects::SAnnotSelector::EMaxSearchSegmentsAction GetMaxSearchSegmentsAction(const CRegistryReadView &view)
virtual objects::CSeq_id_Handle Map(const objects::CSeq_id_Handle &idh) override
static bool IsPseudoFeature(const objects::CSeq_feat &feat)
vector< objects::CSeq_id_Handle > TSeqIdHandles
static string MakeRmtAnnotName(const string &sSuffix)
create an annotation name for a remote file pipeline, appending sSuffix
static string GetAnnotName(const objects::CSeq_annot_Handle &annot_handle)
static bool IsPartialStop(const objects::CSeq_loc &loc)
CGencollIdMapper::SIdSpec m_Spec
CSeq_entry_Handle GetTopSeqEntryFromScopedObject(SConstScopedObject &obj)
static bool GetRangeCollection(const objects::CSeq_id &id, const objects::CHandleRangeMap &map, CRangeCollection< TSeqPos > &ranges)
static CRef< objects::CSeq_loc > MixLocToLoc(const objects::CSeq_loc &mix_loc, const objects::CBioseq_Handle &handle)
Create a new seq-loc with a unique seq-id from a "mixed" loc.
static void GetAssmIds_GIChr(TEntrezIds &gc_ids, TGi gi)
get all assembly ids associated with a gi where this gi is a chromosome
static CConstRef< objects::CUser_field > GetAnnotUserField(const objects::CSeq_annot &annot, const string &type, const string &label)
static bool CanHavePlacements(const objects::CSeq_id &seqid)
check that a given seq-id can potentially have placements (to weed out cases like local ids)
static const string & GetUnnamedAnnot()
Get the commonly used symbol representing a unnnamed annotation.
static void GetMappingInfo(const objects::CMappedFeat &mapped_feat, const objects::CBioseq_Handle &bsh, TMappingInfo &info, const string &annot=string())
virtual void SetTaskTotal(int total)=0
static string CreateIdStr(const vector< T > &uids)
Convert a list of ids into a comma-delimited string.
static TLocVec GetLocPlacements(const objects::CSeq_loc &loc, int time_out_sec=1)
Retrieve locations on mapped-up sequences Help method for retrieving upper level sequences for a give...
static string GetAnnotComment(const objects::CSeq_annot_Handle &annot_handle)
static string CreateSectionRow(const string &tag)
virtual void MapObject(CSerialObject &obj) override
static bool isQuasiLocal(const objects::CBioseq_Handle &handle)
check that a given accession is either local or unrecognizable this can be important to avoid unneces...
static bool IsVDBAccession(const string &acc)
Check if string starts with ("SRA", "SRR", "DRR", "ERR")
static bool IsSameStrands(const objects::CSeq_loc &loc)
static bool GetAnnotShown(const objects::CSeq_annot &annot)
static CRef< objects::CSeq_loc > CreateSeq_loc(const objects::CSeq_id &id, const CRangeCollection< TSeqPos > &ranges)
vector< TSeqRange > TRanges
CRef< CGencollIdMapper > m_Mapper
static bool IsNAA_Name(const string &annot)
check if a given annotation is a named annotation name with '.' replaced with '_'.
static bool GetGIString(const string &sid, string *gi_str)
ad-hoc GI extraction (for misformed seq-id strings like: "gi|55823257|ref|YP_141698....
static IIdMapper * GetIdMapper(CRef< objects::CGC_Assembly > assm)
static TAnnotNameType NameTypeStrToValue(const string &type)
static bool IsExtendedNAA(const string &annot, bool isStrict=false)
check if a given annotation is an extended NAA (named accession[.version][number],...
static int GetGenCode(const objects::CBioseq_Handle &handle)
Returns Bioseq's Genetic Code.
static string GetChrGI(TGi gi)
try to get a chromosome from a GI
static bool Match(const objects::CSeq_id &id1, const objects::CSeq_id &id2, objects::CScope *scope=NULL)
check to see if two seq-ids are identical.
static void SetAnnot(objects::SAnnotSelector &sel, const string &annot)
help function for setting up an annotation.
static string CreateTableRow(const string &tag="", const string &value="")
static CRef< objects::CSeq_loc > RemapChildToParent(const objects::CSeq_loc &parent, const objects::CSeq_loc &child, objects::CScope *scope=NULL)
remap a location to a parent location.
static string CreateTableStart()
help methods for creating HTML text
static TLocVec GetAccessionPlacementsMsec(const objects::CSeq_id &id, objects::CScope &scope, unsigned long time_out_msec=1000, THTTP_Flags flags=fHTTP_AutoReconnect)
same, with a timeout in milliseconds
static CRegistryReadView GetSelectorRegistry()
helper functions to read selector-related tune-up info (mostly segment limits) from registry:
CGencollIdMapperAdapter(CRef< CGencollIdMapper > mapper, const CGencollIdMapper::SIdSpec &spec)
-------------------------------- CGencollIdMapperAdapter ——————————–
virtual bool StopRequested() const =0
static bool isRmtAnnotName(const string &sAnnotname)
check if a given annotation was created by a remote file pipeline
EAnnotationNameType
flags for classifying annotation names.
static CRef< objects::CSeq_id > MapStringId(const string &str, objects::IIdMapper *mapper)
static objects::CMappedFeat GetMrnaForCds(const objects::CMappedFeat &cds_feat, const string &named_acc=string())
static std::string GetXmlChildNodeValue(const xml::node &parent, const std::string &name)
Returns the contents of the specified child node.
static string GetChrId(const string &id_str, objects::CScope &scope)
same as GetChrGI(), but takes an string with id (that must correspond to some GI)
static void GetAssmIds_GI(TEntrezIds &gc_ids, TGi gi)
get all assembly ids associated with a gi.
static bool IsExtendedNAA_Name(const string &annot)
check if a given annotation is an extended NAA name with '.' replaced with '_'.
static void ParseRanges(const string &sRanges, TRanges &ranges)
vector< TMappedInt > TMappingInfo
static string CreateTableEnd()
static void SetResolveDepth(objects::SAnnotSelector &sel, bool adaptive, int depth=-1)
help function for setting selector resolve depth.
static void SetAnnotShown(objects::CSeq_annot &annot, bool isShown)
static bool CheckMaxSearchSegments(int actual, int max, objects::SAnnotSelector::EMaxSearchSegmentsAction action)
check actual number of segments against max and perform the action if the actual number is more than ...
virtual void AddTaskCompleted(int delta)=0
set to add newly finished task number.
static string GetAlignDbBatch(const string &annot)
get a batch string from AlignDb annotation suffixed with batch identication string after a '#'
@ eAnnot_Unnamed
unnamed annotation
@ eAnnot_All
all annotations
@ eAnnot_Named
all named annotations
@ eAnnot_Other
any given named annots
CRef< objects::CScope > scope
CConstRef< CObject > object
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators –.
@ eSerial_AsnText
ASN.1 text.
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...
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
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.
EAccessionInfo
For IdentifyAccession (below)
bool MatchesTo(const CSeq_id_Handle &h) const
True if *this matches to h.
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.
@ eAcc_refseq_mrna_predicted
@ eAcc_refseq_prot_predicted
@ eAcc_refseq_ncrna_predicted
@ eAcc_refseq_wgs_intermed
void SetPacked_int(TPacked_int &v)
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
TRange GetTotalRange(void) const
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
CRef< CSeq_loc > Merge(TOpFlags flags, ISynonymMapper *syn_mapper) const
All functions create and return a new seq-loc object.
bool IsSetStrand(void) const
Get strand.
int CompareSubLoc(const CSeq_loc &loc, ENa_strand strand, const ISubLocFilter *filter=NULL) const
Compare first-level sub-locations sequentially to order them by biological "complexity".
bool IsEmpty(void) const
True if the current location is empty.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
size_t GetSize(void) const
Get number of ranges.
TRange GetRange(void) const
Get the range.
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
TSeqPos GetStop(ESeqLocExtremes ext) const
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
CMappedFeat GetBestMrnaForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
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...
CConstRef< CSeq_loc > m_ParentLoc
CRef< CSeq_loc > Resolve(CScope *scope=0, TFlags flags=0) const
TGi GetGiForId(const objects::CSeq_id &id, CScope &scope, EGetIdType flags=0)
Given a Seq-id retrieve the corresponding GI.
@ eGetId_ForceGi
return only a gi-based seq-id
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void GetAllTSEs(TTSE_Handles &tses, enum ETSEKind kind=eManualTSEs)
CConstRef< CSynonymsSet > GetSynonyms(const CSeq_id &id)
Get bioseq synonyms, resolving to the bioseq in this scope.
vector< CSeq_entry_Handle > TTSE_Handles
@ eProductToLocation
Map from the feature's product to location.
@ eLocationToProduct
Map from the feature's location to product.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
CConstRef< CSeq_annot > GetCompleteSeq_annot(void) const
Complete and return const reference to the current seq-annot.
bool IsSetProduct(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
CScope & GetScope(void) const
Get scope this handle belongs to.
const string & GetName(void) const
CRef< CSeq_loc > GetRangeSeq_loc(TSeqPos start, TSeqPos stop, ENa_strand strand=eNa_strand_unknown) const
Return CSeq_loc referencing the given range and strand on the bioseq If start == 0,...
CSeq_entry_Handle GetTopLevelEntry(void) const
Return a handle for the top-level seq-entry.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
bool IsSynonym(const CSeq_id &id) const
Check if this id can be used to obtain this bioseq handle.
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
SAnnotSelector & SetFeatType(TFeatType type)
Set feature type (also set annotation type to feat)
SAnnotSelector & SetExactDepth(bool value=true)
SetExactDepth() specifies that annotations will be searched on the segment level specified by SetReso...
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
SAnnotSelector & SetOverlapTotalRange(void)
Check overlapping only of total ranges.
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
SAnnotSelector & SetResolveDepth(int depth)
SetResolveDepth sets the limit of subsegment resolution in searching annotations.
SAnnotSelector & IncludeNamedAnnotAccession(const string &acc, int zoom_level=0)
SAnnotSelector & SetExcludeExternal(bool exclude=true)
External annotations for the Object Manger are annotations located in top level Seq-entry different f...
SAnnotSelector & SetCollectNames(bool value=true)
Collect available annot names rather than annots.
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
const CSeq_loc & GetProduct(void) const
SAnnotSelector & SetAnnotType(TAnnotType type)
Set annotation type (feat, align, graph)
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
SAnnotSelector & SetFeatSubtype(TFeatSubtype subtype)
Set feature subtype (also set annotation and feat type)
SAnnotSelector & ExcludeNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to exclude.
SAnnotSelector & ExcludeUnnamedAnnots(void)
Add unnamed annots to set of annots names to exclude.
SAnnotSelector & AddUnnamedAnnots(void)
Add unnamed annots to set of annots names to look for.
@ fIncludeGivenEntry
Include the top (given) entry.
@ fRecursive
Iterate recursively.
@ eMaxSearchSegmentsSilent
@ eMaxSearchSegmentsThrow
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
bool IsProtein(void) const
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
position_type GetLength(void) const
TThisType & Set(position_type from, position_type to)
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
CRange< TSignedSeqPos > TSignedSeqRange
static TThisType GetWhole(void)
virtual string GetString(const string §ion, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
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 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 size_t StringToSizet(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to size_t.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Compare of a substring with another string.
static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to long.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
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.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
@ eNocase
Case insensitive compare.
unsigned int usec
microseconds (modulo 1,000,000)
STimeout * NcbiMsToTimeout(STimeout *timeout, unsigned long ms)
static const char label[]
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTo(TTo value)
Assign a value to To data member.
bool IsSetPseudo(void) const
pseudogene Check if a value has been assigned to Pseudo data member.
TPseudo GetPseudo(void) const
Get the Pseudo member data.
const TData & GetData(void) const
Get the Data member data.
void SetType(TType &value)
Assign a value to Type data member.
bool IsBool(void) const
Check if variant Bool is selected.
@ eGC_SequenceRole_top_level
TPseudo GetPseudo(void) const
Get the Pseudo member data.
bool IsSetPseudo(void) const
Check if a value has been assigned to Pseudo data member.
const TStd & GetStd(void) const
Get the variant data.
bool IsStd(void) const
Check if variant Std is selected.
bool IsSpliced(void) const
Check if variant Spliced is selected.
const TSegs & GetSegs(void) const
Get the Segs member data.
E_Choice Which(void) const
Which variant is currently selected.
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsGene(void) const
Check if variant Gene is selected.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetExcept(void) const
something funny about this? Check if a value has been assigned to Except data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
TPseudo GetPseudo(void) const
Get the Pseudo member data.
const TProduct & GetProduct(void) const
Get the Product member data.
bool IsSetPseudo(void) const
annotated on pseudogene? Check if a value has been assigned to Pseudo data member.
const TGene & GetGene(void) const
Get the variant data.
TPartial GetPartial(void) const
Get the Partial member data.
TExcept GetExcept(void) const
Get the Except member data.
bool CanGetProduct(void) const
Check if it is safe to call GetProduct method.
const TRna & GetRna(void) const
Get the variant data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsRna(void) const
Check if variant Rna is selected.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
@ e_Pub
publication applies to this seq
void SetTo(TTo value)
Assign a value to To data member.
ENa_strand
strand of nucleic acid
const Tdata & Get(void) const
Get the member data.
Tdata & Set(void)
Assign a value to data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetFrom(TFrom value)
Assign a value to From data member.
TGi GetGi(void) const
Get the variant data.
bool IsGi(void) const
Check if variant Gi is selected.
bool IsWhole(void) const
Check if variant Whole is selected.
void SetStrand(TStrand value)
Assign a value to Strand data member.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
@ e_Gi
GenInfo Integrated Database.
list< CRef< CSeqdesc > > Tdata
const Tdata & Get(void) const
Get the member data.
TId & SetId(void)
Assign a value to Id data member.
TTitle & SetTitle(void)
Select the variant.
const TSource & GetSource(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
const TDesc & GetDesc(void) const
Get the Desc member data.
list< CRef< CSeq_id > > TId
bool IsSetDesc(void) const
used only for stand alone Seq-annots Check if a value has been assigned to Desc data member.
void SetInst(TInst &value)
Assign a value to Inst data member.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
const TPub & GetPub(void) const
Get the Pub member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
@ eRepr_raw
continuous sequence
@ e_Source
source of materials, includes Org-ref
@ eMol_na
just a nucleic acid
unsigned int
A callback function used to compare two keys in a database.
SStaticPair< const char *, CSeqUtils::TAnnotNameType > TNameTypeStr
static bool s_CompareDescriptions(const CFeatListItem *p1, const CFeatListItem *p2)
static void s_CreateMappingInfo(const CSeq_loc &prod_loc, const CSeq_loc &gen_loc, CSeqUtils::TMappingInfo &info)
Helper function to convert two mapped locations into an interval-to-interval mapping structure.
static TMappedLocs s_GetRnaMappingLocs(const CSeq_loc &feat_loc, const CMappedFeat &feat, const CBioseq_Handle &handle)
static bool s_IsNAA(const string &annot, char div)
static void s_AdjustToAnnotatedCDS(const CMappedFeat &mapped_cds_feat, CScope &scope, CSeqUtils::TMappingInfo &cds_map_info)
map< string, bool > TTopLevels
DEFINE_STATIC_ARRAY_MAP(TNameTypeMap, sm_NameTypeMap, s_NameTypeStrs)
CBioseq_Handle GetBioseqForSeqFeat(const CSeq_feat &f, CScope &scope)
static void s_ESearchQuery(const string &db, const string &term, vector< T > &uids, size_t &count, const int ret_max, const string &xpath)
static void s_ELinkQuery(const string &db_from, const string &db_to, const vector< T1 > &uids_from, vector< T2 > &uids_to, const string &cmd, const string &xpath)
static const TAssemblySeqIds & s_GetAssemblySeqIds(const string &assm_acc)
CConstRef< CBioseq > GetBioseqForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)
static CSeqUtils::TLocVec s_GetAlnMapplingLocs(const CSeq_align_set &align_set, TGi gi)
static CRWLock m_AssemblySeqIdLock
CSeq_feat_Handle GetSeqFeatHandleForBadLocFeature(const CSeq_feat &feat, CScope &scope)
CStaticArrayMap< string, CSeqUtils::TAnnotNameType > TNameTypeMap
static const string kTaxDb
static bool s_IsExtendedNAA(const string &sAnnotName, char div, bool isStrict)
static map< string, TAssemblySeqIds > s_AssemblySeqIdCache
static const string kAssmDb
static CRWLock m_TopLevelsLock
static const string & GetLinksURL()
CSeq_entry_Handle GetDefaultTopLevelSeqEntry(CScope &scope)
static const string kNucDb
vector< const CFeatListItem * > GetSortedFeatList(CSeq_entry_Handle seh, size_t max)
CSeq_entry_Handle GetSeqEntryForPubdesc(CRef< CScope > scope, const CPubdesc &pubdesc)
static TTopLevels m_TopLevels
vector< CRef< CSeq_loc > > TMappedLocs
For CDS and RNA feature mapping information.
static const char * kLinksUrlDefault
vector< CConstRef< CSeq_id > > TAssemblySeqIds
static const TNameTypeStr s_NameTypeStrs[]
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 smart and slim</td> n<td> orig</td> n</tr> n<tr> n<td> last_modified</td> n<td> optional</td> n<td> Integer</td> n<td class=\"description\"> The blob last modification If provided then the exact match will be requested with n the Cassandra storage corresponding field value</td> n<td> Positive integer Not provided means that the most recent match will be selected</td> n<td></td> n</tr> n<tr> n<td> use_cache</td> n<td> optional</td> n<td> String</td> n<td class=\"description\"> The option controls if the Cassandra LMDB cache and or database should be used It n affects the seq id resolution step and the blob properties lookup step The following n options are BIOSEQ_INFO and BLOB_PROP at all
Lightweight interface for getting lines of data with minimal memory copying.
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
constexpr bool empty(list< Ts... >) noexcept
static const BitmapCharRec ch1
static const BitmapCharRec ch2
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
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)
static const char * str(char *buf, int n)
CSeq_annot::C_Data::E_Choice TAnnotType
bool operator()(const CMappedFeat &feat0, const CMappedFeat &feat1) const
bool operator()(const CMappedFeat &feat0, const CMappedFeat &feat1) const
bool operator()(const pair< T, U > &p1, const pair< T, U > &p2) const
Location relative to a base Seq-loc: one (usually) or more ranges of offsets.
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...