97 #define NCBI_USE_ERRCODE_X ObjMgr_SeqUtil
108 if ((**it).IsSource())
109 return &(**it).GetSource();
147 cleaned_location->
Assign(*cds_loc);
156 cleaned_location->
Assign(*rev_loc);
181 return scope.GetTaxId(idh);
187 const auto& bioSource = pSourceFeat->GetData().GetBiosrc();
188 if (!bioSource.CanGetOrg()) {
191 return bioSource.GetOrg().GetTaxId();
201 const auto& bioSource = pSourceFeat->GetData().GetBiosrc();
202 if (bioSource.CanGetOrg()) {
203 pOrgRef = &bioSource.GetOrg();
214 if (!pSource || !pSource->CanGetOrg()) {
217 return &pSource->GetOrg();
225 return &pSourceFeat->GetData().GetBiosrc();
247 vector<CSeqdesc::E_Choice>
types;
256 if ( desc.
IsOrg() ) {
288 if ((**it).IsMolinfo())
289 return &(**it).GetMolinfo();
298 for ( ; desc_iter; ++desc_iter) {
348 }
catch (exception&) {
366 "the sequence is not a protein");
370 vector<CMappedFeat> best_feats;
373 if (
range.GetToOpen() > seq_length ) {
374 range.SetToOpen(seq_length);
377 if ( length > best_length ) {
378 best_length = length;
381 if ( length == best_length ) {
382 best_feats.push_back(*it);
385 if ( best_feats.empty() ) {
388 "the sequence does't have prot feature");
390 if ( best_feats.size() > 1 ) {
393 "the sequence have ambiguous prot feature");
396 best_feats[0].GetData().GetProt().GetLabel(&ret);
400 "the prot feature doesn't return name");
408 switch (GetErrCode()) {
420 (
const_cast<CSeq_id*
>(
id.GetPointer()));
429 (
const_cast<CSeq_id*
>(
id.GetPointer()));
438 (
const_cast<CSeq_id*
>(
id.GetPointer()));
447 (
const_cast<CSeq_id*
>(
id.GetPointer()));
456 (
const_cast<CSeq_id*
>(
id.GetPointer()));
479 "sequence::GetId(): gi seq-id not found in the list");
494 "sequence::GetId(): text seq-id not found in the list");
562 if (!idh)
return ret;
582 idh.
IsGi())
return idh;
587 if (db ==
"ti" || db ==
"SRA")
return idh;
605 catch (exception& e) {
606 ERR_POST(
"sequence::GetId(): exception: "<<e.what());
615 "sequence::GetId(): seq-id not found in the scope");
631 "Unable to get Seq-id from handle");
654 catch (exception& e) {
662 "sequence::GetGiForAccession(): invalid seq-id type");
680 "sequence::GetGiForId(): seq-id not found in the scope");
702 "sequence::GetAccessionForGi(): seq-id not found in the scope");
723 "sequence::GetAccessionForId(): seq-id not found in the scope");
746 if ( rec.
GetIds().empty() ) {
792 CScope* scope,
int* frame)
805 if (base_frame > 0) {
809 *frame = (3 + rl.
m_Ranges.front()->GetFrom() - base_frame) % 3 + 1;
820 <<
"SourceToProduct:"
821 " parent and child have opposite orientations");
825 (*it)->SetFrom(((*it)->GetFrom() - base_frame) / 3);
826 (*it)->SetTo (((*it)->GetTo() - base_frame) / 3);
837 return rl.
Resolve(scope, rl_flags);
851 if (base_frame > 0) {
854 TSeqPos nuc_length, prot_length;
871 from = (*it)->GetFrom() * 3 + base_frame;
876 to = (*it)->GetTo() * 3 + base_frame + 2;
878 (*it)->SetFrom(from);
890 template <
class T,
class U>
893 bool operator()(
const pair<T,U>& p1,
const pair<T,U>& p2)
const
895 return p1.first < p2.first;
899 template <
class T,
class U>
902 bool operator()(
const pair<T,U>& p1,
const pair<T,U>& p2)
const
904 return p1.second < p2.second;
917 if( gene1.first != gene2.first ) {
918 return gene1.first < gene2.first;
921 const CSeq_loc &loc1 = gene1.second->GetLocation();
922 const CSeq_loc &loc2 = gene2.second->GetLocation();
927 if( gene1.second->IsSetData() && gene1.second->GetData().IsGene() &&
928 gene2.second->IsSetData() && gene2.second->GetData().IsGene() )
933 gene1.second->GetData().GetGene().
GetLabel( &gene1_label );
934 gene2.second->GetData().GetGene().GetLabel( &gene2_label );
935 return gene1_label < gene2_label;
954 bool revert_locations =
false;
956 switch (overlap_type) {
968 revert_locations =
true;
1004 if ( bioseq_handle ) {
1008 circular_id = bioseq_handle.
GetSeqId();
1013 const CSeq_id* loc_id =
nullptr;
1017 catch (exception&) {
1021 circular_id.
Reset(loc_id);
1030 _TRACE(
"test for circularity failed: " << e.what()) ;
1035 if (circular_id &&
range.GetFrom() >
range.GetTo()) {
1040 sub_loc->
SetId().Assign(*circular_id);
1049 sub_loc->
SetId().Assign(*circular_id);
1071 if( ! circular_id &&
range.GetFrom() >
range.GetTo() ) {
1080 unique_ptr<CFeat_CI> feat_it_ptr;
1083 circular_length,
range, loc, sel, scope, strand);
1085 if ( circular_loc ) {
1086 if ( !bioseq_handle ) {
1089 feat_it_ptr.reset(
new CFeat_CI(scope, *circular_loc, sel) );
1091 else if ( bioseq_handle ) {
1092 feat_it_ptr.reset(
new CFeat_CI(bioseq_handle,
range, strand, sel) );
1096 feat_it_ptr.reset(
new CFeat_CI(scope, loc, sel) );
1103 cleaned_loc->
Assign( loc );
1109 plugin->
processLoc( bioseq_handle, cleaned_loc, circular_length );
1112 for ( ; feat_it; ++feat_it) {
1119 EOverlapType overlap_type_this_iteration = overlap_type;
1120 bool revert_locations_this_iteration = revert_locations;
1123 bool shouldContinueToNextIteration =
false;
1125 shouldContinueToNextIteration,
1126 cleaned_loc_this_iteration,
1128 overlap_type_this_iteration,
1129 revert_locations_this_iteration,
1133 annot_overlap_type);
1134 if( shouldContinueToNextIteration ) {
1142 if ( !revert_locations_this_iteration ) {
1145 *cleaned_loc_this_iteration,
1146 overlap_type_this_iteration,
1152 *cleaned_loc_this_iteration,
1153 overlap_type_this_iteration,
1161 *candidate_feat_loc,
1162 overlap_type_this_iteration,
1168 *candidate_feat_loc,
1169 overlap_type_this_iteration,
1177 candidate_feat_loc, scope, sel, circular_length );
1191 feats.push_back(sc);
1199 catch (exception&) {
1200 _TRACE(
"GetOverlappingFeatures(): error: feature iterator failed");
1203 std::stable_sort(feats.begin(), feats.end(),
1218 overlap_type, scores, scope, opts, plugin );
1219 if (scores.size()) {
1221 return scores.back().second;
1223 return scores.front().second;
1240 overlap_type, scores, scope, opts, plugin );
1242 if (scores.size()) {
1244 return scores.back().second;
1246 return scores.front().second;
1265 bool has_xref =
false;
1284 if ((*it)->IsSetId() && (*it)->GetId().IsLocal()) {
1308 bool search_both_strands =
true)
1316 if (scores.size()) {
1317 overlap = scores.front().second;
1320 if (search_both_strands && !overlap) {
1336 if (scores.size()) {
1337 overlap = scores.front().second;
1348 bool search_both_strands)
1351 scope, search_both_strands);
1358 bool search_both_strands)
1362 search_both_strands);
1370 switch ( eTransSplicing ) {
1392 if ( !it ) ret.
Reset();
1406 if ( it ) ret.
Reset();
1447 if ((*it)->IsSetData() && (*it)->GetData().IsGene() &&
1448 (*it)->GetData().GetGene().IsSetPseudo() &&
1449 (*it)->GetData().GetGene().GetPseudo()) {
1455 if (gene &&
IsPseudo(*gene, scope)) {
1480 return p->GetSeq_feat();
1495 return p->GetSeq_feat();
1538 if ((*xit)->IsSetData() && (*xit)->GetData().IsGene() && (*xit)->GetData().GetGene().IsSuppressed()) {
1541 if ((*xit)->IsSetId() && (*xit)->GetId().IsLocal() &&
1542 (!(*xit)->IsSetData() || (*xit)->GetData().IsGene())) {
1545 if (far_feats.size() > 0) {
1546 return far_feats.front().GetSeq_feat();
1550 if ((*xit)->IsSetData() && (*xit)->GetData().IsGene()) {
1553 }
else if ((*xit)->IsSetData() && (*xit)->GetData().IsGene()) {
1554 const CGene_ref& gene = (*xit)->GetData().GetGene();
1631 feats, scope, opts, plugin );
1633 if (feats.size() < 2) {
1634 if (feats.size() == 1) {
1635 mrna_feat = feats.front().second;
1648 const CSeq_feat& feat = *feat_iter->second;
1657 for ( ; obj_iter; ++obj_iter) {
1658 if (obj_iter->IsSetType() &&
1659 obj_iter->GetType().IsStr() &&
1660 obj_iter->GetType().GetStr() ==
"MrnaProteinLink") {
1661 string prot_id_str = obj_iter->GetField(
"protein seqID")
1662 .GetData().GetStr();
1664 vector<CSeq_id_Handle> ids = scope.
GetIds(prot_id);
1666 ITERATE (vector<CSeq_id_Handle>, id_iter, ids) {
1667 if (product_id.
Match(*id_iter->GetSeqId())) {
1668 mrna_feat.
Reset(&feat);
1676 catch (exception&) {
1693 const CSeq_feat& mrna = *feat_iter->second;
1710 for ( ; other_iter && !mrna_feat; ++other_iter) {
1718 if ( !prot_handle ) {
1722 if (prot_handle.
IsSynonym(product_id)) {
1724 matching_feats.push_back(*feat_iter);
1729 if ( !matching_feats.empty() ) {
1731 feats.swap(matching_feats);
1732 if ( feats.size() == 1 ) {
1733 mrna_feat = feats.front().second;
1738 catch (exception&) {
1743 string transcript_id = cds_feat.
GetNamedQual(
"transcript_id");
1744 if ( !transcript_id.empty() ) {
1745 ITERATE (vector<TFeatScore>, feat_iter, feats) {
1746 const CSeq_feat& feat = *feat_iter->second;
1747 string other_transcript_id =
1749 if (transcript_id == other_transcript_id) {
1750 mrna_feat.
Reset(&feat);
1762 mrna_feat = feats.back().second;
1764 mrna_feat = feats.front().second;
1793 unique_ptr<CFeat_CI> &feat_ci,
1803 feat_ci, circular_length,
range, loc, sel, scope, strand);
1806 if ( bioseq_handle ) {
1807 feat_ci.reset(
new CFeat_CI(bioseq_handle,
range, strand, sel));
1809 feat_ci.reset(
new CFeat_CI(scope, loc, sel));
1824 bool &shouldContinueToNextIteration,
1828 bool &revert_locations_this_iteration,
1846 cleaned_loc_this_iteration, candidate_feat_loc,
1847 overlap_type_this_iteration,
1848 revert_locations_this_iteration,
1849 bioseq_handle, feat, circular_length, annot_overlap_type);
1863 cleaned_loc, candidate_feat_loc,
1864 scope, sel, circular_length);
1882 unique_ptr<CGetOverlappingFeaturesPlugin> cds_plugin(
1892 feats, scope, opts, cds_plugin.get());
1895 if (feats.size() < 2) {
1896 if (feats.size() == 1) {
1897 cds_feat = feats.front().second;
1908 for ( ; obj_iter; ++obj_iter) {
1909 if (obj_iter->IsSetType() &&
1910 obj_iter->GetType().IsStr() &&
1911 obj_iter->GetType().GetStr() ==
"MrnaProteinLink") {
1912 prot_id_str = obj_iter->GetField(
"protein seqID").GetData().GetStr();
1916 if ( !prot_id_str.empty() ) {
1918 vector<CSeq_id_Handle> ids = scope.
GetIds(prot_id);
1924 const CSeq_feat& feat = *feat_iter->second;
1930 ITERATE (vector<CSeq_id_Handle>, id_iter, ids) {
1931 if (
id.Match(*id_iter->GetSeqId())) {
1932 cds_feat.
Reset(&feat);
1938 catch (exception&) {
1965 for ( ; iter; ++iter) {
1975 if ( !protein_id ) {
1979 TFeatScores::const_iterator feat_iter = feats.begin();
1980 TFeatScores::const_iterator feat_end = feats.end();
1981 for ( ; feat_iter != feat_end && !cds_feat; ++feat_iter) {
1985 const CSeq_feat& cds = *feat_iter->second;
1992 if ( !prot_handle ) {
1996 if (prot_handle.
IsSynonym(*protein_id)) {
1998 cds_feat.
Reset(&cds);
2003 catch ( exception& ) {
2011 string transcript_id = mrna_feat.
GetNamedQual(
"transcript_id");
2012 if ( !transcript_id.empty() ) {
2014 const CSeq_feat& feat = *feat_iter->second;
2015 string other_transcript_id =
2017 if (transcript_id == other_transcript_id) {
2018 cds_feat.
Reset(&feat);
2030 cds_feat = feats.back().second;
2032 cds_feat = feats.front().second;
2054 feats, scope, opts, plugin );
2056 if (feats.size() < 2) {
2057 if (feats.size() == 1) {
2058 gene_feat = feats.front().second;
2077 const CSeq_feat& feat = *feat_it->second;
2079 string other_ref_str;
2080 other_ref.
GetLabel(&other_ref_str);
2081 if (ref_str == other_ref_str) {
2094 if ((*dbxref)->GetDb() ==
"GeneID" ||
2095 (*dbxref)->GetDb() ==
"LocusID") {
2096 gene_id = (*dbxref)->GetTag().GetId();
2103 const CSeq_feat& feat = *feat_it->second;
2105 const string& db = (*dbxref)->GetDb();
2106 if ((db ==
"GeneID" || db ==
"LocusID") &&
2107 (*dbxref)->GetTag().GetId() == gene_id) {
2118 gene_feat = feats.back().second;
2120 gene_feat = feats.front().second;
2143 feats, scope, opts, plugin );
2145 if (feats.size() < 2) {
2146 if (feats.size() == 1) {
2147 feat_ref = feats.front().second;
2161 const CSeq_feat& feat = *feat_it->second;
2167 string other_ref_str;
2168 other_ref.
GetLabel(&other_ref_str);
2169 if (ref_str == other_ref_str) {
2189 feat_ref = feats.front().second;
2218 for ( ; feat_it; ++feat_it) {
2226 string other_ref_str;
2227 other_ref->
GetLabel(&other_ref_str);
2228 if (other_ref_str != ref_str) {
2241 mrna_feats.push_back(feat_ref);
2257 if ((*dbxref)->GetDb() ==
"GeneID" ||
2258 (*dbxref)->GetDb() ==
"LocusID") {
2259 gene_id = (*dbxref)->GetTag().GetId();
2268 for ( ; feat_it; ++feat_it) {
2289 if (((*dbxref)->GetDb() ==
"GeneID" ||
2290 (*dbxref)->GetDb() ==
"LocusID") &&
2291 (*dbxref)->GetTag().GetId() == gene_id) {
2292 mrna_feats.push_back(ref);
2311 scope, opts, plugin );
2313 mrna_feats.push_back(feat);
2324 list< CConstRef<CSeq_feat> > mrna_feats;
2326 if (mrna_feats.size()) {
2330 cds_feats.push_back(cds);
2338 scope, opts, plugin );
2340 cds_feats.push_back(feat);
2355 switch (feat_type) {
2359 overlap_type, scope, opts, plugin );
2364 overlap_type, scope, opts, plugin );
2370 overlap_type, scope, opts, plugin );
2378 (feat.
GetLocation(), feat_type, overlap_type, scope, opts, plugin );
2430 (feat.
GetLocation(), subtype, overlap_type, scope, opts, plugin );
2448 if (
id.IsLocal() ) {
2450 if ( obj_id.
IsId() ) {
2451 int local_id = obj_id.
GetId();
2454 if ( feat_handle ) {
2562 return &
f.GetOriginalFeature();
2607 return &(
fi->GetOriginalFeature());
2634 return &(
fi->GetOriginalFeature());
2715 m_Flags(fInstantiateGaps | fAssembleParts | fEnableGI),
2716 m_GapMode(eGM_letters)
2718 m_Gen.reset(
new sequence::CDeflineGenerator);
2734 loc2.
SetWhole().Assign(*it->GetSeqId());
2750 const string& custom_title)
2762 if (! desc.
IsUser())
continue;
2766 if (! oi.
IsStr())
continue;
2787 const CSeq_id& sid = **id_itr;
2788 switch (sid.
Which()) {
2795 const string& db = dbtag.
GetDb();
2818 if ((*id)->IsGi()) {
2829 switch (best_id->
Which())
2851 for (
const auto& pId : bioseq.
GetId()) {
2852 if (pId->IsGeneral()) {
2856 if (pId->IsGenbank()) {
2872 return (pAccession || pGnlId);
2885 bool hide_prefix =
false;
2936 pair<TSeq_id_HandleSet::iterator, bool> p
2940 "Duplicate Seq-id " + (*id)->AsFastaString()
2941 +
" in FASTA output");
2947 if (!(m_Flags & fIgnoreOriginalID) &&
2948 s_ShouldUseOriginalID(bioseq)) {
2949 string origID = s_FastaGetOriginalID(bioseq);
2950 if (! NStr::IsBlank(origID)) {
2951 m_Out << "lcl|" << origID;
2953 x_WriteAsFasta(bioseq);
2956 x_WriteAsFasta(bioseq);
2961 for (CSeq_loc_CI it(*location); it; ++it) {
2962 CSeq_loc::TRange range = it.GetRange();
2963 TSeqPos from = range.GetFrom() + 1, to = range.GetTo() + 1;
2964 _ASSERT(from <= to);
2966 if (it.IsSetStrand() && IsReverse(it.GetStrand())) {
2967 m_Out << 'c
' << to << '-
' << from;
2969 m_Out << from << '-
' << to;
2977 sequence::CDeflineGenerator::TUserFlags
2978 CFastaOstream::x_GetTitleFlags(void) const
2980 sequence::TGetTitleFlags title_flags = 0;
2981 title_flags |= sequence::CDeflineGenerator::fFastaFormat;
2983 if ((m_Flags & fNoExpensiveOps) != 0) {
2984 title_flags |= sequence::CDeflineGenerator::fNoExpensiveOps;
2986 if ((m_Flags & fShowModifiers) != 0) {
2987 title_flags |= sequence::CDeflineGenerator::fShowModifiers;
2989 if ((m_Flags & fDoNotUseAutoDef) != 0) {
2990 title_flags |= sequence::CDeflineGenerator::fDoNotUseAutoDef;
2993 if ((m_Flags & fDoNotUseAutoDef) == 0) {
2994 title_flags |= sequence::CDeflineGenerator::fUseAutoDef;
3000 void CFastaOstream::x_WriteSeqTitle(const CBioseq_Handle & bioseq_handle,
3001 const string& custom_title)
3003 string safe_title = (!custom_title.empty()) ? custom_title
3004 : m_Gen->GenerateDefline(bioseq_handle, x_GetTitleFlags());
3006 if ( !safe_title.empty() ) {
3007 if ( !(m_Flags & fKeepGTSigns) ) {
3008 NStr::ReplaceInPlace(safe_title, ">", "_");
3010 if (safe_title[0] != ' ') {
3014 if ((m_Flags & fHTMLEncode) != 0) {
3015 safe_title = NStr::HtmlEncode(safe_title);
3017 m_Out << safe_title;
3022 void CFastaOstream::WriteTitle(const CBioseq& bioseq,
3023 const CSeq_loc* location,
3024 bool no_scope, // not used
3025 const string& custom_title)
3027 x_WriteSeqIds(bioseq, location);
3028 CScope scope(*CObjectManager::GetInstance());
3029 CBioseq_Handle bioseq_handle = scope.AddBioseq(bioseq);
3030 x_WriteSeqTitle(bioseq_handle, custom_title);
3033 void CFastaOstream::WriteTitle(const CBioseq_Handle& bioseq_handle,
3034 const CSeq_loc* location,
3035 const string& custom_title)
3037 const CBioseq& bioseq = *bioseq_handle.GetBioseqCore();
3038 x_WriteSeqIds(bioseq, location);
3039 x_WriteSeqTitle(bioseq_handle, custom_title);
3043 CConstRef<CSeq_loc> CFastaOstream::x_MapMask(CSeq_loc_Mapper& mapper,
3044 const CSeq_loc& mask,
3045 const CSeq_id* base_seq_id,
3048 CConstRef<CSeq_loc> mapped_mask(&mask);
3050 // Mapping down requires the higher-level ID as a reference, even
3051 // when given a scope, and as such should precede mapping up to
3052 // keep sequence::GetId from bombing out.
3053 if ((m_Flags & fMapMasksDown) != 0 && scope) {
3055 CSeq_loc_Mapper mapper_down
3056 (scope->GetBioseqHandle(sequence::GetId(*mapped_mask, scope)),
3057 CSeq_loc_Mapper::eSeqMap_Down);
3058 mapped_mask = mapped_mask->Add(*mapper_down.Map(*mapped_mask),
3059 CSeq_loc::fSortAndMerge_All, 0);
3060 } catch (CObjmgrUtilException&) {
3063 if ((m_Flags & fMapMasksUp) != 0 && scope && base_seq_id) {
3064 CSeq_loc_Mapper mapper_up(scope->GetBioseqHandle(*base_seq_id),
3065 CSeq_loc_Mapper::eSeqMap_Up);
3066 mapped_mask = mapped_mask->Add(*mapper_up.Map(*mapped_mask),
3067 CSeq_loc::fSortAndMerge_All, 0);
3069 mapped_mask = mapper.Map(*mapped_mask);
3074 void CFastaOstream::x_GetMaskingStates(TMSMap& masking_state,
3075 const CSeq_id* base_seq_id,
3076 const CSeq_loc* location,
3079 CRef<CSeq_loc_Mapper> mapper;
3082 if (m_SoftMask.NotEmpty() || m_HardMask.NotEmpty()) {
3083 _ASSERT(base_seq_id);
3087 TSeqPos length = sequence::GetLength(*location, scope);
3088 loc2.SetInt().SetId().Assign(*base_seq_id);
3089 loc2.SetInt().SetFrom(0);
3090 loc2.SetInt().SetTo(length - 1);
3091 } catch (exception&) {
3092 loc2.SetWhole().Assign(*base_seq_id);
3094 mapper.Reset(new CSeq_loc_Mapper(*location, loc2, scope));
3096 // still useful for filtering out locations on other sequences
3098 whole.SetWhole().Assign(*base_seq_id);
3099 mapper.Reset(new CSeq_loc_Mapper(whole, whole, scope));
3101 mapper->SetMergeAll();
3102 mapper->TruncateNonmappingRanges();
3104 if (scope && (m_Flags & (fMapMasksUp | fMapMasksDown))) {
3105 bsh = scope->GetBioseqHandle(*base_seq_id);
3108 const CSeq_loc& mask = m_SoftMask ? *m_SoftMask : *m_HardMask;
3109 int type = m_SoftMask ? eSoftMask : eHardMask;
3110 CConstRef<CSeq_loc> mapped_mask = x_MapMask(*mapper, mask, base_seq_id,
3113 masking_state[0] = 0;
3114 for (CSeq_loc_CI it(*mapped_mask); it; ++it) {
3115 CSeq_loc_CI::TRange loc_range = it.GetRange();
3116 masking_state[loc_range.GetFrom()] = type;
3117 masking_state[loc_range.GetToOpen()] = 0;
3121 if (m_SoftMask.NotEmpty() && m_HardMask.NotEmpty()) {
3122 CConstRef<CSeq_loc> mapped_mask = x_MapMask(*mapper, *m_HardMask,
3123 base_seq_id, scope);
3124 for (CSeq_loc_CI it(*mapped_mask); it; ++it) {
3125 CSeq_loc_CI::TRange loc_range = it.GetRange();
3126 TSeqPos from = loc_range.GetFrom();
3127 TSeqPos to = loc_range.GetToOpen();
3128 TMSMap::iterator ms_it = masking_state.lower_bound(from);
3131 if (ms_it == masking_state.end()) {
3132 masking_state[loc_range.GetFrom()] = eHardMask;
3133 masking_state[loc_range.GetToOpen()] = 0;
3135 } else if (ms_it->first == from) {
3136 prev_state = ms_it->second;
3137 ms_it->second |= eHardMask;
3139 // NB: lower_bound's name is misleading, as it actually
3141 _ASSERT(ms_it != masking_state.begin());
3144 prev_state = prev_it->second;
3150 ms_it = masking_state.insert(ms_it,
value);
3152 while (++ms_it != masking_state.end() && ms_it->first < to) {
3153 prev_state = ms_it->second;
3154 ms_it->second |= eHardMask;
3156 if (ms_it == masking_state.end() || ms_it->first != to) {
3165 const TMSMap& masking_state)
3173 int current_state = 0;
3183 alt_gap_str = uc_hard_mask_str;
3193 if (rem_state == 0) {
3195 current_state = ms_it->second;
3196 if (++ms_it == masking_state.
end()) {
3199 rem_state = ms_it->first - it.
GetPos();
3225 m_Out <<
">?unk" << gap_size;
3227 m_Out <<
">?unk100";
3230 m_Out <<
">?" << gap_size;
3241 pGapLiteral->GetSeq_data().GetGap();
3247 const string sGapModText =
3249 if( ! sGapModText.empty() ) {
3250 m_Out <<
' ' << sGapModText;
3258 while (rem_gap >= rem_line) {
3261 rem_gap -= rem_line;
3266 rem_line -= rem_gap;
3270 if (rem_state >= gap_size) {
3271 rem_state -= gap_size;
3273 while (++ms_it != masking_state.
end()
3274 && ms_it->first < it.
GetPos()) {
3275 current_state = ms_it->second;
3277 if (ms_it == masking_state.
end()) {
3280 rem_state = ms_it->first - it.
GetPos();
3292 : uc_hard_mask_str.
data();
3295 lc_buffer.assign(ptr, count);
3297 ptr = lc_buffer.data();
3299 while ( count >= rem_line ) {
3327 vector<CTSE_Handle> used_tses;
3345 "CFastaOstream: location out of range: " +
label);
3372 switch (entry.
Which()) {
3390 bool no_scope,
const string& custom_title )
3472 out << sPrefix <<
"[gap-type=" <<
gap_type <<
']';
3488 string & gap_type = out_gap_info.
gap_type;
3489 vector<string> & gap_linkage_evidences =
3494 gap_linkage_evidences.clear();
3499 bool need_evidence =
false;
3516 gap_type =
"unknown";
3517 need_evidence = is_linkage;
3520 gap_type =
"within scaffold";
3521 need_evidence =
true;
3524 gap_type = ( is_linkage ?
"within scaffold" :
"between scaffolds" );
3525 need_evidence = is_linkage;
3528 gap_type =
"short arm";
3531 gap_type =
"heterochromatin";
3534 gap_type =
"centromere";
3537 gap_type =
"telomere";
3540 gap_type = ( is_linkage ?
3541 "repeat within scaffold" :
3542 "repeat between scaffolds" );
3543 need_evidence = is_linkage;
3546 gap_type =
"between scaffolds";
3549 gap_type =
"within scaffold";
3550 need_evidence = is_linkage;
3553 gap_type =
"contamination";
3554 need_evidence = is_linkage;
3560 gap_type =
"(ERROR: UNRECOGNIZED_GAP_TYPE:" +
3574 switch( evidence.
GetType() ) {
3576 gap_linkage_evidences.push_back(
"paired-ends");
3579 gap_linkage_evidences.push_back(
"align genus");
3582 gap_linkage_evidences.push_back(
"align xgenus");
3585 gap_linkage_evidences.push_back(
"align trnscpt");
3588 gap_linkage_evidences.push_back(
"within clone");
3591 gap_linkage_evidences.push_back(
"clone contig");
3594 gap_linkage_evidences.push_back(
"map");
3597 gap_linkage_evidences.push_back(
"strobe");
3600 gap_linkage_evidences.push_back(
"unspecified");
3603 gap_linkage_evidences.push_back(
"pcr");
3606 gap_linkage_evidences.push_back(
"proximity ligation");
3609 gap_linkage_evidences.push_back(
"other");
3612 gap_linkage_evidences.push_back(
"(UNRECOGNIZED LINKAGE EVIDENCE:" +
3620 if( need_evidence && gap_linkage_evidences.empty() ) {
3621 gap_linkage_evidences.push_back(
"unspecified");
3622 }
else if( ! need_evidence && ! gap_linkage_evidences.empty() ) {
3625 gap_linkage_evidences.clear();
3635 template <
class Container>
3640 bool is_5prime_complete,
3641 bool is_3prime_complete,
3643 bool remove_trailing_X,
3647 const size_t usable_size = seq.size() > frame ? seq.size() - frame : 0;
3648 const size_t mod = usable_size % 3;
3650 prot.reserve((usable_size + 2) / 3);
3659 int start_state = 0;
3662 typename Container::const_iterator start = seq.begin();
3664 for (
int i = 0;
i < frame; ++
i) {
3671 size_t length = usable_size / 3;
3672 bool check_start = (is_5prime_complete && frame == 0);
3673 bool first_time =
true;
3675 for (
i = 0;
i < length; ++
i) {
3678 for (k = 0; k < 3; ++k, ++start) {
3683 start_state =
state;
3687 if (first_time && check_start) {
3699 for (k = 0; k <
mod; ++k, ++start) {
3703 for (; k < 3; ++k) {
3708 start_state =
state;
3713 if (first_time && check_start) {
3716 }
else if (c !=
'X') {
3726 if ( aa !=
'*' && include_stop && (!
mod) &&
prot.size() > 0 && is_3prime_complete ) {
3735 if (alt_start && is_5prime_complete) {
3743 if ( !include_stop ) {
3745 if (sz != string::npos) {
3750 if (remove_trailing_X) {
3752 for (sz =
prot.size(); sz > 0 &&
prot[sz - 1] ==
'X'; --sz) {
3774 if (
prot->SetInst().SetExt().SetDelta().Set().empty()
3775 ||
prot->GetInst().GetExt().GetDelta().Get().back()->GetLiteral().GetSeq_data().IsGap()) {
3778 seg->SetLiteral().SetLength(0);
3779 prot->SetInst().SetExt().SetDelta().Set().push_back(seg);
3784 if (residue ==
'*' || residue ==
'-') {
3786 if (
last->IsLiteral() &&
last->GetLiteral().IsSetSeq_data() &&
last->GetLiteral().GetSeq_data().IsIupacaa()) {
3788 string current =
last->GetLiteral().GetSeq_data().GetIupacaa().Get();
3789 last->SetLiteral().SetSeq_data().SetNcbieaa().Set(current);
3792 last->SetLiteral().SetSeq_data().SetNcbieaa().Set().append(1, residue);
3793 }
else if (
last->IsLiteral() &&
last->GetLiteral().IsSetSeq_data() &&
last->GetLiteral().GetSeq_data().IsNcbieaa()) {
3795 last->SetLiteral().SetSeq_data().SetNcbieaa().Set().append(1, residue);
3798 last->SetLiteral().SetSeq_data().SetIupacaa().Set().append(1, residue);
3802 last->SetLiteral().SetLength(
len + 1);
3808 if (
prot->SetInst().SetExt().SetDelta().Set().empty()) {
3812 new_seg->SetLiteral().SetLength(add_len);
3813 if (unknown_length) {
3816 prot->SetInst().SetExt().SetDelta().Set().push_back(new_seg);
3819 if (
last->SetLiteral().GetSeq_data().IsGap()
3820 && ((unknown_length &&
last->SetLiteral().IsSetFuzz())
3821 || (!unknown_length && !
last->SetLiteral().IsSetFuzz()))) {
3823 TSeqPos len =
prot->GetInst().GetExt().GetDelta().Get().back()->GetLiteral().GetLength();
3824 prot->SetInst().SetExt().SetDelta().Set().back()->SetLiteral().SetLength(
len + add_len);
3829 new_seg->SetLiteral().SetLength(add_len);
3830 if (unknown_length) {
3833 prot->SetInst().SetExt().SetDelta().Set().push_back(new_seg);
3872 prot->SetInst().SetLength(0);
3886 for (
int i = 0;
i < frame; ++
i) {
3893 TSeqPos length = usable_size / 3;
3894 bool check_start = (is_5prime_complete && frame == 0);
3895 bool first_time =
true;
3897 for (
i = 0;
i < length; ++
i) {
3899 bool unknown_length =
false;
3907 for (k = 0; k < 3; ++k, ++start) {
3910 if (is_gap && !unknown_length) {
3914 unknown_length =
true;
3926 if (first_time && check_start) {
3939 bool unknown_length =
false;
3940 TSeqPos pos = (length * 3) + frame;
3941 for (k = 0; k <
mod; ++k, ++start) {
3944 if (is_gap && !unknown_length) {
3948 unknown_length =
true;
3960 for (; k < 3; ++k) {
3967 if (first_time && check_start) {
3981 prot_len += (*seg_it)->GetLiteral().GetLength();
3996 string::size_type j = seq_pos / 3;
4000 CDelta_ext::Tdata::iterator seg_it =
prot->SetInst().SetExt().SetDelta().Set().begin();
4001 string::size_type
offset = 0;
4002 while (seg_it !=
prot->SetInst().SetExt().SetDelta().Set().end()
4003 &&
offset + (*seg_it)->GetLiteral().GetLength() < j) {
4004 offset += (*seg_it)->GetLiteral().GetLength();
4007 if (seg_it !=
prot->SetInst().SetExt().SetDelta().Set().end()
4008 && !(*seg_it)->GetLiteral().GetSeq_data().IsGap()) {
4009 if ((*seg_it)->GetLiteral().GetSeq_data().IsIupacaa()) {
4010 (*seg_it)->SetLiteral().SetSeq_data().SetIupacaa().Set()[j -
offset] = c_aa.
GetNcbieaa();
4012 (*seg_it)->SetLiteral().SetSeq_data().SetNcbieaa().Set()[j -
offset] = c_aa.
GetNcbieaa();
4016 }
else if (j == prot_len) {
4028 if (!
prot->SetInst().SetExt().SetDelta().Set().empty())
4030 end =
prot->SetInst().SetExt().SetDelta().Set().back();
4033 if (end && end->IsLiteral() && end->GetLiteral().IsSetSeq_data()) {
4034 if (end->GetLiteral().GetSeq_data().IsIupacaa()) {
4035 string& last_seg = end->SetLiteral().SetSeq_data().SetIupacaa().Set();
4037 last_seg = last_seg.substr(0, last_seg.length() - 1);
4038 end->SetLiteral().SetLength(
TSeqPos(last_seg.length()));
4040 }
else if (end->GetLiteral().GetSeq_data().IsNcbieaa()) {
4041 string& last_seg = end->SetLiteral().SetSeq_data().SetNcbieaa().Set();
4043 last_seg = last_seg.substr(0, last_seg.length() - 1);
4044 end->SetLiteral().SetLength(
TSeqPos(last_seg.length()));
4052 prot_len += (*seg_it)->GetLiteral().GetLength();
4053 if ((*seg_it)->GetLiteral().IsSetSeq_data()
4054 && (*seg_it)->GetLiteral().GetSeq_data().IsNcbieaa()) {
4055 string current = (*seg_it)->GetLiteral().GetSeq_data().GetNcbieaa();
4057 (*seg_it)->SetLiteral().SetSeq_data().SetIupacaa().Set(current);
4061 prot->SetInst().SetLength(prot_len);
4063 if (
prot->GetInst().GetLength() == 0) {
4065 }
else if (
prot->SetInst().SetExt().SetDelta().Set().size() == 1
4066 &&
prot->SetInst().SetExt().SetDelta().Set().front()->IsLiteral()
4067 &&
prot->SetInst().SetExt().SetDelta().Set().front()->GetLiteral().IsSetSeq_data()) {
4069 if (
prot->SetInst().SetExt().SetDelta().Set().front()->GetLiteral().GetSeq_data().IsIupacaa()) {
4070 string data =
prot->SetInst().SetExt().SetDelta().Set().front()->GetLiteral().GetSeq_data().GetIupacaa().Get();
4071 prot->SetInst().ResetExt();
4072 prot->SetInst().SetSeq_data().SetIupacaa().Set(data);
4074 }
else if (
prot->SetInst().SetExt().SetDelta().Set().front()->GetLiteral().GetSeq_data().IsNcbieaa()) {
4075 string data =
prot->SetInst().SetExt().SetDelta().Set().front()->GetLiteral().GetSeq_data().GetNcbieaa().Get();
4076 prot->SetInst().ResetExt();
4077 prot->SetInst().SetSeq_data().SetNcbieaa().Set(data);
4088 if (!protein || !protein->
IsAa() || !protein->
IsSetInst()) {
4091 return protein->
SetInst().ConvertDeltaToRaw();
4098 bool remove_trailing_X,
4100 bool is_5prime_complete,
4101 bool is_3prime_complete)
4104 is_5prime_complete, is_3prime_complete, include_stop, remove_trailing_X, alt_start);
4115 !(
flags & fIs5PrimePartial),
4116 !(
flags & fIs3PrimePartial),
4118 flags & fRemoveTrailingX,
4126 bool remove_trailing_X,
4128 bool is_5prime_complete,
4129 bool is_3prime_complete)
4132 is_5prime_complete, is_3prime_complete, include_stop, remove_trailing_X, alt_start);
4142 !(
flags & fIs5PrimePartial),
4143 !(
flags & fIs3PrimePartial),
4145 flags & fRemoveTrailingX,
4155 bool remove_trailing_X,
4162 include_stop, remove_trailing_X, alt_start);
4172 bool remove_trailing_X,
4179 include_stop, remove_trailing_X, alt_start);
4187 bool remove_trailing_X,
4211 bool code_break_include_stop = include_stop;
4214 code_break_include_stop =
true;
4221 code_break_include_stop, remove_trailing_X, alt_start);
4228 string::size_type protlen =
prot.size();
4237 string::size_type
i = seq_pos / 3;
4243 }
else if (
i == protlen) {
4252 if ( !include_stop ) {
4254 if (sz != string::npos) {
4297 for (
auto it = frame_map.
begin(); it != frame_map.
end(); it++) {
4298 tmp_cds->
SetData().SetCdregion().SetFrame(it->first);
4302 it->second.len =
prot.length();
4304 if ((pos ==
prot.length() - 1) && (leftover == it->second.frame_offset)) {
4305 it->second.has_final_stop =
true;
4306 }
else if (pos !=
NPOS) {
4307 it->second.has_internal_stop =
true;
4311 it->second.has_start_m =
true;
4317 if (frame_map[orig_frame].has_final_stop) {
4321 if (is_3complete && !is_5complete) {
4323 for (
auto it = frame_map.
begin(); it != frame_map.
end(); it++) {
4324 if (it->second.has_final_stop) {
4330 if (is_5complete && !is_3complete) {
4346 for (
auto it = frame_map.
begin(); it != frame_map.
end(); it++) {
4347 if (it->second.has_final_stop) {
4354 if (!frame_map[orig_frame].has_internal_stop) {
4359 for (
auto it = frame_map.
begin(); it != frame_map.
end(); it++) {
4360 if (!it->second.has_internal_stop) {
4362 best_frame = it->first;
4378 bool ambiguous =
false;
4380 return FindBestFrame(cds, scope, ambiguous);
4389 bool remove_trailing_X,
4397 include_stop, remove_trailing_X, alt_start);
4406 bool remove_trailing_X,
4417 include_stop, remove_trailing_X, alt_start);
4423 : m_ParentLoc(&parent)
4427 const CSeq_id& cseqid = cit.GetSeq_id();
4428 TRange0 crange = cit.GetRange();
4429 if (crange.IsWholeTo() && scope) {
4437 TRange0 prange = pit.GetRange();
4438 if (prange.IsWholeTo() && scope) {
4443 pos += prange.GetLength();
4449 if (crange.GetFrom() >= prange.GetFrom()) {
4450 abs_from = crange.GetFrom();
4451 fuzz_from = cit.GetFuzzFrom();
4452 if (abs_from == prange.GetFrom()) {
4454 const CInt_fuzz* pfuzz = pit.GetFuzzFrom();
4458 f->Assign(*fuzz_from);
4459 f->Subtract(*pfuzz, abs_from, abs_from);
4460 if (
f->IsP_m() && !
f->GetP_m() ) {
4466 fuzz_from = pfuzz->
Negative(abs_from);
4471 abs_from = prange.GetFrom();
4477 if (crange.GetTo() <= prange.GetTo()) {
4478 abs_to = crange.GetTo();
4479 fuzz_to = cit.GetFuzzTo();
4480 if (abs_to == prange.GetTo()) {
4482 const CInt_fuzz* pfuzz = pit.GetFuzzTo();
4486 f->Assign(*fuzz_to);
4487 f->Subtract(*pfuzz, abs_to, abs_to);
4488 if (
f->IsP_m() && !
f->GetP_m() ) {
4499 abs_to = prange.GetTo();
4505 if (abs_from <= abs_to) {
4507 TSeqPos sigma = pos + prange.GetTo();
4508 intersection->SetFrom(sigma - abs_to);
4509 intersection->SetTo (sigma - abs_from);
4511 intersection->SetFuzz_to().AssignTranslated
4512 (*fuzz_from, intersection->GetTo(), abs_from);
4513 intersection->SetFuzz_to().Negate
4514 (intersection->GetTo());
4517 intersection->SetFuzz_from().AssignTranslated
4518 (*fuzz_to, intersection->GetFrom(), abs_to);
4519 intersection->SetFuzz_from().Negate
4520 (intersection->GetFrom());
4523 intersection->SetStrand(pstrand);
4525 intersection->SetStrand(
Reverse(cstrand));
4529 intersection->SetFrom(abs_from +
delta);
4530 intersection->SetTo (abs_to +
delta);
4532 intersection->SetFuzz_from().AssignTranslated
4533 (*fuzz_from, intersection->GetFrom(), abs_from);
4536 intersection->SetFuzz_to().AssignTranslated
4537 (*fuzz_to, intersection->GetTo(), abs_to);
4540 intersection->SetStrand(pstrand);
4542 intersection->SetStrand(cstrand);
4550 if (
m_Ranges.back()->GetTo() == intersection->GetFrom() - 1
4551 && !
IsReverse(intersection->GetStrand()) ) {
4552 m_Ranges.back()->SetTo(intersection->GetTo());
4553 if (intersection->IsSetFuzz_to()) {
4555 (intersection->SetFuzz_to());
4559 }
else if (
m_Ranges.back()->GetFrom()
4560 == intersection->GetTo() + 1
4561 &&
IsReverse(intersection->GetStrand())) {
4562 m_Ranges.back()->SetFrom(intersection->GetFrom());
4563 if (intersection->IsSetFuzz_from()) {
4565 (intersection->SetFuzz_from());
4576 pos += prange.GetLength();
4591 _ASSERT((*it)->GetFrom() <= (*it)->GetTo());
4592 TSeqPos pos = 0, start = (*it)->GetFrom();
4593 bool keep_going =
true;
4595 TRange0 prange = pit.GetRange();
4596 if (prange.IsWholeTo() && scope) {
4600 TSeqPos length = prange.GetLength();
4601 if (start >= pos && start < pos + length) {
4606 TSeqPos sigma = pos + prange.GetTo();
4607 from = sigma - (*it)->GetTo();
4609 if (from < prange.GetFrom() || from > sigma) {
4610 from = prange.GetFrom();
4615 if ( !(*it)->IsSetStrand()
4617 strand = pit.GetStrand();
4619 strand =
Reverse((*it)->GetStrand());
4621 if (from == prange.GetFrom()) {
4622 fuzz_from = pit.GetFuzzFrom();
4624 if ( !keep_going && (*it)->IsSetFuzz_to() ) {
4627 f->Assign(*fuzz_from);
4631 f->Subtract((*it)->GetFuzz_to(), from, (*it)->GetTo(),
4633 if (
f->IsP_m() && !
f->GetP_m() ) {
4639 if (to == prange.GetTo()) {
4640 fuzz_to = pit.GetFuzzTo();
4642 if (start == (*it)->GetFrom()
4643 && (*it)->IsSetFuzz_from()) {
4646 f->Assign(*fuzz_to);
4650 f->Subtract((*it)->GetFuzz_from(), to,
4652 if (
f->IsP_m() && !
f->GetP_m() ) {
4660 from = start +
delta;
4661 to = (*it)->GetTo() +
delta;
4662 if (to > prange.GetTo()) {
4663 to = prange.GetTo();
4668 if ( !(*it)->IsSetStrand()
4670 strand = pit.GetStrand();
4672 strand = (*it)->GetStrand();
4674 if (from == prange.GetFrom()) {
4675 fuzz_from = pit.GetFuzzFrom();
4677 if (start == (*it)->GetFrom()
4678 && (*it)->IsSetFuzz_from()) {
4681 f->Assign(*fuzz_from);
4682 f->Add((*it)->GetFuzz_from(), from,
4685 f->AssignTranslated((*it)->GetFuzz_from(), from,
4688 if (
f->IsP_m() && !
f->GetP_m() ) {
4694 if (to == prange.GetTo()) {
4695 fuzz_to = pit.GetFuzzTo();
4697 if ( !keep_going && (*it)->IsSetFuzz_to() ) {
4700 f->Assign(*fuzz_to);
4701 f->Add((*it)->GetFuzz_to(), to, (*it)->GetTo());
4703 f->AssignTranslated((*it)->GetFuzz_to(), to,
4706 if (
f->IsP_m() && !
f->GetP_m() ) {
4714 && (fuzz_from == fuzz_to
4716 && fuzz_from->
Equals(*fuzz_to)))) {
4725 point.
SetFuzz().Assign(*fuzz_from);
4727 point.
SetId().Assign(pit.GetSeq_id());
4728 mix.
Set().push_back(loc);
4743 ival.
SetId().Assign(pit.GetSeq_id());
4744 mix.
Set().push_back(loc);
4747 start = pos + length;
4761 << start <<
" exceeds length (" << total_length
4762 <<
") of parent location " <<
label);
4766 <<
" exceeds length (?\?\?) of parent location "
4772 switch (mix.
Get().size()) {
4853 return (comp_it != sc_Complement.end()) ? comp_it->second :
'\0';
4860 revcomp.reserve(sequence.length());
4861 string::const_reverse_iterator rend = sequence.rend();
4863 for (string::const_reverse_iterator rit = sequence.rbegin(); rit != rend; ++rit) {
4872 (
const string& name,
4873 const string& sequence,
4882 string pattern = sequence;
4887 bool symmetric = (pattern ==
revcomp);
4914 if (!
m_Fsa.IsPrimed()) {
4918 int next_state =
m_Fsa.GetNextState(current_state, ch);
4921 if (
m_Fsa.IsMatchFound(next_state)) {
4922 ITERATE(vector<TPatternInfo>, it,
m_Fsa.GetMatches(next_state)) {
4923 int start = position -
int(it->GetSequence().length()) + 1;
4926 if (start < length) {
5060 '\0',
'A',
'C',
'M',
'G',
'R',
'S',
'V',
'T',
'W',
'Y',
'H',
'K',
'D',
'B',
'N'
5065 (
const string& name,
5083 buffer.reserve(pattern.length());
5099 if (pos < sequence.length()) {
5102 for (
int i = 0;
i < 4; ++
i) {
5103 if ((
code & expansion[
i]) != 0) {
5138 m_Fsa.AddWord(sequence, pat_info);
5151 "Sequence of this type cannot be reverse-complemented.");
5154 inst.
SetExt().SetDelta().Set().reverse();
5157 switch ((*it)->Which()) {
5159 if ((*it)->GetLiteral().IsSetSeq_data()) {
5169 (*it)->SetLoc(*flip);
5180 "Sequence of this type cannot be reverse-complemented.");
User-defined methods of the data storage class.
User-defined methods of the data storage class.
LargeInt< 1 > revcomp(const LargeInt< 1 > &x, size_t sizeKmer)
User-defined methods of the data storage class.
bool IsReverse(ENa_strand s)
ENa_strand Reverse(ENa_strand s)
@ eExtreme_Positional
numerical value
@ eExtreme_Biological
5' and 3'
bool SameOrientation(ENa_strand a, ENa_strand b)
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.
size_t GetSize(void) const
CTime AsCTime(CTime::ETimeZone tz=CTime::eLocal) const
FASTA-format output; see also ReadFasta in <objtools/readers/fasta.hpp>
static const CTrans_table & GetTransTable(int id)
void GetLabel(string *label) const
bool IsSuppressed(void) const
CRef< CInt_fuzz > Negative(TSeqPos n) const
@ eAmplify
go for the largest possible range
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Base class for all object manager exceptions.
Exceptions for objmgr/util library.
bool operator()(const pair< Int8, CConstRef< CSeq_feat > > &gene1, const pair< Int8, CConstRef< CSeq_feat > > &gene2)
COverlapPairLess(CScope *scope_arg)
ESubtype GetSubtype(void) const
static E_Choice GetTypeFromSubtype(ESubtype subtype)
Holds information associated with a pattern, such as the name of the restriction enzyme,...
Client interface: ================== A class that uses the SeqSearch facility should implement the Cl...
SeqVector related exceptions.
namespace ncbi::objects::
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
const CGene_ref * GetGeneXref(void) const
See related function in util/feature.hpp.
static bool IsAa(EMol mol)
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
static TSeqPos ReverseComplement(CSeq_data *in_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
class CStaticArrayMap<> is an array adaptor that provides an STLish interface to statically-defined a...
TBase::const_iterator const_iterator
TSeq_feat_Handles GetGenesWithLocus(const string &locus, bool tag) const
TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
vector< CSeq_feat_Handle > TSeq_feat_Handles
CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
CScope & GetScope(void) const
Returns scope.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
char GetStartResidue(int state) const
char GetCodonResidue(int state) const
bool IsAltStart(int state) const
static int NextCodonState(int state, unsigned char ch)
char GetStopResidue(int state) const
Template class for iteration on objects of class C (non-medifiable version)
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
container_type::value_type value_type
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static const char location[]
API (CDeflineGenerator) for computing sequences' titles ("definitions").
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
std::ofstream out("events_result.xml")
main entry point for tests
Utility macros and typedefs for exploring NCBI objects from general.asn.
#define FOR_EACH_USERFIELD_ON_USEROBJECT(Itr, Var)
FOR_EACH_USERFIELD_ON_USEROBJECT EDIT_EACH_USERFIELD_ON_USEROBJECT.
void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)
Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...
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.
element_type * get(void) const
Get pointer.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
SStrictId_Tax::TId TTaxId
Taxon id type.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
@ ePositive
Value is positive.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#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)
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
CConstRef< CSeq_id > GetSeqId(void) const
void Reset(void)
Reset the handle (remove seq-id reference)
static CSeq_id_Handle GetGiHandle(TGi gi)
Faster way to create a handle for a gi.
E_SIC
Compare return values.
virtual void WriteAsFasta(ostream &out) const
Implement serializable interface.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
static int WorstRank(const CRef< CSeq_id > &id)
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
static int Score(const CRef< CSeq_id > &id)
Wrappers for use with FindBestChoice from <corelib/ncbiutil.hpp>
static int BestRank(const CRef< CSeq_id > &id)
CSeq_id::E_Choice Which(void) const
static int FastaNARank(const CRef< CSeq_id > &id)
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).
E_SIC Compare(const CSeq_id &sid2) const
Compare() - more general.
static int FastaAARank(const CRef< CSeq_id > &id)
@ e_NO
different SeqId types-can't compare
@ e_YES
SeqIds compared, but are different.
void SetPacked_int(TPacked_int &v)
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
void FlipStrand(void)
Flip the strand (e.g. plus to minus)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
EOpFlags
CSeq_loc operations.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool CheckId(const CSeq_id *&id, bool may_throw=true) const
check that the 'id' field in all parts of the location is the same as the specifies id.
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
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...
Int8 TestForOverlapEx(const CSeq_loc &loc1, const CSeq_loc &loc2, EOverlapType type, CScope *scope=0, TOverlapFlags flags=fOverlap_Default)
Updated version of TestForOverlap64().
TSeqPos LocationOffset(const CSeq_loc &outer, const CSeq_loc &inner, EOffsetType how=eOffset_FromStart, CScope *scope=0)
returns (TSeqPos)-1 if the locations don't overlap
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
Int8 TestForOverlap64(const CSeq_loc &loc1, const CSeq_loc &loc2, EOverlapType type, TSeqPos circular_len=kInvalidSeqPos, CScope *scope=0)
64-bit version of TestForOverlap() Check if the two locations have ovarlap of a given type.
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
bool IsOneBioseq(const CSeq_loc &loc, CScope *scope)
Returns true if all embedded CSeq_ids represent the same CBioseq, else false.
int TestForOverlap(const CSeq_loc &loc1, const CSeq_loc &loc2, EOverlapType type, TSeqPos circular_len=kInvalidSeqPos, CScope *scope=0)
Calls TestForOverlap64() and if the result is greater than kMax_Int truncates it to kMax_Int.
bool IsSameBioseq(const CSeq_id &id1, const CSeq_id &id2, CScope *scope, CScope::EGetBioseqFlag get_flag=CScope::eGetBioseq_All)
Determines if two CSeq_ids represent the same CBioseq.
CSeq_loc * SeqLocRevCmpl(const CSeq_loc &loc, CScope *scope)
Get reverse complement of the seq-loc (?)
ESeqLocCheck SeqLocCheck(const CSeq_loc &loc, CScope *scope)
Checks that a CSeq_loc is all on one strand on one CBioseq.
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eOverlap_SubsetRev
1st is a subset of 2nd ranges
@ eOverlap_CheckIntervals
2nd is a subset of 1st with matching boundaries
@ eOverlap_Contains
2nd contains 1st extremes
@ eOverlap_CheckIntRev
1st is a subset of 2nd with matching boundaries
@ eOverlap_Simple
any overlap of extremes
@ eOverlap_Interval
at least one pair of intervals must overlap
@ eOverlap_Contained
2nd contained within 1st extremes
@ eOverlap_Subset
2nd is a subset of 1st ranges
@ eContains
First CSeq_loc contains second.
@ eSame
CSeq_locs contain each other.
@ fOverlap_IgnoreTopology
Ignore sequence topology (circularity)
@ fOverlap_Default
Enable multi-id, multi-strand, check topology.
@ eOffset_FromStart
For positive-orientation strands, start = left and end = right; for reverse-orientation strands,...
void AddNucleotidePattern(const string &name, const string &sequence, Int2 cut_site, TSearchFlags flags=fNoFlags)
Add nucleotide pattern or restriction site to sequence search.
CRef< CSeq_loc > ProductToSource(const CSeq_feat &feat, const CSeq_loc &prod_loc, TP2SFlags flags, CScope *scope)
virtual void processSAnnotSelector(SAnnotSelector &sel)=0
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
CTextFsm< TPatternInfo > m_Fsa
CConstRef< CSeq_feat > GetOverlappingSource(const CSeq_loc &loc, CScope &scope)
virtual void setUpFeatureIterator(CBioseq_Handle &bioseq_handle, unique_ptr< CFeat_CI > &feat_ci, TSeqPos circular_length, CRange< TSeqPos > &range, const CSeq_loc &loc, SAnnotSelector &sel, CScope &scope, ENa_strand &strand)=0
void SetMask(EMaskType type, CConstRef< CSeq_loc > location)
CConstRef< CSeq_feat > GetOverlappingmRNA(const CSeq_loc &loc, CScope &scope)
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
CBioseq_Handle GetBioseqFromSeqLoc(const CSeq_loc &loc, CScope &scope, CScope::EGetBioseqFlag flag)
Retrieve the Bioseq Handle from a location.
static CRef< CBioseq > TranslateToProtein(const CSeq_feat &cds, CScope &scope)
virtual void processLoc(CBioseq_Handle &bioseq_handle, CRef< CSeq_loc > &loc, TSeqPos circular_length)=0
CConstRef< CSeq_feat > GetOverlappingGene(const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing)
CConstRef< CSeq_loc > m_HardMask
void x_WriteSequence(const CSeqVector &vec, const TMSMap &masking_state)
vector< CRef< TRange > > TRanges
string GetProteinName(const CBioseq_Handle &seq)
Return protein name from corresponding Prot-ref feature.
virtual bool SkipBioseq(const CBioseq &)
Used only by Write(CSeq_entry[_Handle], ...); permissive by default.
CConstRef< CSeq_feat > GetBestCdsForMrna(const CSeq_feat &mrna_feat, CScope &scope, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
void GetOrg_refForProduct(const CBioseq_Handle &bsh, const COrg_ref *pOrgRef)
static bool ChangeDeltaProteinToRawProtein(CRef< CBioseq > protein)
void x_ExpandPattern(string &sequence, string &buffer, size_t pos, TPatternInfo &pat_info, TSearchFlags flags)
TGi GetGiForAccession(const string &acc, CScope &scope, EGetIdType flags)
Given an accession string retrieve the GI id.
string GetAccessionForId(const objects::CSeq_id &id, CScope &scope, EAccessionVersion use_version, EGetIdType flags)
Retrieve the accession string for a Seq-id.
ETranslationLengthProblemOptions
CConstRef< CSeq_feat > GetSourceFeatForProduct(const CBioseq_Handle &bsh)
vector< string > gap_linkage_evidences
A vector representing the linkage-evidences of the gap.
virtual void WriteTitle(const CBioseq_Handle &handle, const CSeq_loc *location=0, const string &custom_title=kEmptyStr)
CConstRef< CSeq_loc > m_ParentLoc
virtual bool OnPatternFound(const TPatternInfo &pat_info, TSeqPos pos)=0
CRef< CSeq_loc > Resolve(CScope *scope=0, TFlags flags=0) const
CConstRef< CSeq_feat > GetOverlappingCDS(const CSeq_loc &loc, CScope &scope)
virtual void Write(const CSeq_entry_Handle &handle, const CSeq_loc *location=0)
Unspecified locations designate complete sequences; non-empty custom titles override the usual title ...
void x_StorePattern(TPatternInfo &pat_info, string &sequence)
ETransSplicing
Convenience functions for popular overlapping types.
pair< Int8, CConstRef< CSeq_feat > > TFeatScore
Storage for features and scores.
CConstRef< CSeq_feat > GetGeneForFeature(const CSeq_feat &feat, CScope &scope)
Finds gene for feature, but obeys SeqFeatXref directives.
TSeq_id_HandleSet m_PreviousWholeIds
CConstRef< CSeq_feat > GetBestGeneForMrna(const CSeq_feat &mrna_feat, CScope &scope, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
virtual void x_WriteSeqIds(const CBioseq &bioseq, const CSeq_loc *location)
CConstRef< CSeq_feat > GetBestMrnaForCds(const CSeq_feat &cds_feat, CScope &scope, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
virtual const char * GetErrCodeString(void) const override
string m_Sequence
user defined name
bool x_IsAllowMismatch(TSearchFlags flags) const
void SetWidth(TSeqPos width)
TTaxId GetTaxIdForProduct(const CBioseq_Handle &bsh)
CConstRef< CSeq_feat > GetBestOverlapForSNP(const CSeq_feat &snp_feat, CSeqFeatData::E_Choice type, CScope &scope, bool search_both_strands)
Get the best overlapping feature for a SNP (variation) feature.
~CSeqSearch(void)
destructor
CConstRef< CSeq_loc > m_SoftMask
EMaskType
Which residues to mask out in subsequent output.
const CBioSource * GetBioSource(const CBioseq &bioseq)
Retrieve the BioSource object for a given bioseq handle.
TGi GetGiForId(const objects::CSeq_id &id, CScope &scope, EGetIdType flags)
Given a Seq-id retrieve the corresponding GI.
void x_AddNucleotidePattern(const string &name, string &pattern, Int2 cut_site, ENa_strand strand, TSearchFlags flags)
virtual void WriteSequence(const CBioseq_Handle &handle, const CSeq_loc *location=0, CSeq_loc::EOpFlags merge_flags=CSeq_loc::fMerge_AbuttingOnly)
virtual void postProcessDiffAmount(Int8 &cur_diff, CRef< CSeq_loc > &cleaned_loc_this_iteration, CRef< CSeq_loc > &candidate_feat_loc, CScope &scope, SAnnotSelector &sel, TSeqPos circular_length)=0
CConstRef< CSeq_feat > GetOverlappingPub(const CSeq_loc &loc, CScope &scope)
CConstRef< CSeq_feat > GetOverlappingOperon(const CSeq_loc &loc, CScope &scope)
CBioseq_Handle GetParentForPart(const CBioseq_Handle &part)
Get the parent bioseq for a part of a segmented bioseq.
CConstRef< CSeq_loc > GetMask(EMaskType type) const
CSeqSearch(IClient *client=0, TSearchFlags flags=fNoFlags)
constructors
CConstRef< CSeq_id > FindLatestSequence(const CSeq_id &id, CScope &scope)
Given a seq-id check its replace history and try to find the latest revision.
string GetAccessionForGi(TGi gi, CScope &scope, EAccessionVersion use_version, EGetIdType flags)
Retrieve the accession for a given GI.
const CMolInfo * GetMolInfo(const CBioseq &bioseq)
Retrieve the MolInfo object for a given bioseq handle.
virtual void x_WriteSeqTitle(const CBioseq_Handle &handle, const string &custom_title)
void Search(const CBioseq_Handle &seq)
Search the sequence for patterns.
void GetMrnasForGene(const CSeq_feat &gene_feat, CScope &scope, list< CConstRef< CSeq_feat > > &mrna_feats, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
CRef< CSeq_loc > SourceToProduct(const CSeq_feat &feat, const CSeq_loc &source_loc, TS2PFlags flags, CScope *scope, int *frame)
const CSeq_feat * GetPROTForProduct(const CBioseq &product, CScope *scope)
Get the mature peptide feature of a protein.
static CCdregion::EFrame FindBestFrame(const CSeq_feat &cds, CScope &scope)
Find "best" frame for a coding region.
CSeq_id_Handle GetId(const CBioseq &seq, EGetIdType type)
Return a selected ID type from a Bioseq Arguments (except 'seq') and behavior is the same as of GetId...
CConstRef< CSeq_feat > GetBestGeneForCds(const CSeq_feat &cds_feat, CScope &scope, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
const COrg_ref * GetOrg_refOrNull(const CBioseq_Handle &handle)
Return the pointer to org-ref associated with a given sequence or null if there is no org-ref associa...
void x_GetMaskingStates(TMSMap &masking_states, const CSeq_id *base_seq_id, const CSeq_loc *location, CScope *scope)
string gap_type
String representing the gap type.
virtual void processMainLoop(bool &shouldContinueToNextIteration, CRef< CSeq_loc > &cleaned_loc_this_iteration, CRef< CSeq_loc > &candidate_feat_loc, EOverlapType &overlap_type_this_iteration, bool &revert_locations_this_iteration, CBioseq_Handle &bioseq_handle, const CMappedFeat &feat, TSeqPos circular_length, SAnnotSelector::EOverlapType annot_overlap_type)=0
CMappedFeat GetMappedCDSForProduct(const CBioseq_Handle &bsh)
CConstRef< CSeq_feat > GetmRNAforCDS(const CSeq_feat &cds, CScope &scope)
GetmRNAforCDS A function to find a CSeq_feat representing the appropriate mRNA for a given CDS.
virtual void x_GetBestId(CConstRef< CSeq_id > &gi_id, CConstRef< CSeq_id > &best_id, bool &hide_prefix, const CBioseq &bioseq)
const CBioSource * GetBioSourceForBioseq(const CBioseq_Handle &bsh)
Find a BioSource for the given Bioseq: If it's a protein then look for the source feature of the prod...
static void TranslateCdregion(string &prot, const CBioseq_Handle &bsh, const CSeq_loc &loc, const CCdregion &cdr, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=0, ETranslationLengthProblemOptions options=eThrowException)
translation coding region into ncbieaa protein sequence
vector< TFeatScore > TFeatScores
virtual void x_WriteBuffer(const char *buf, unsigned int count)
const CSeq_feat * GetmRNAForProduct(const CBioseq &product, CScope *scope)
Get the encoding mRNA feature of a given mRNA (cDNA) bioseq.
EGapMode
How to represent gaps with fInstantiateGaps enabled, as it is by default.
TTaxId GetTaxId(const CBioseq_Handle &handle)
return the tax-id associated with a given sequence.
bool x_IsExpandPattern(TSearchFlags flags) const
CConstRef< CSeq_feat > GetBestOverlappingFeat(const CSeq_loc &loc, CSeqFeatData::E_Choice feat_type, EOverlapType overlap_type, CScope &scope, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
See the note above on 'overlap_type' meaning.
void GetCdssForGene(const CSeq_feat &gene_feat, CScope &scope, list< CConstRef< CSeq_feat > > &cds_feats, TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
void ReverseComplement(CSeq_inst &inst, CScope *scope)
Reverse complement a Bioseq in place.
CMappedFeat GetMappedmRNAForProduct(const CBioseq_Handle &bsh)
unsigned int TSearchFlags
binary OR of ESearchFlag
void WriteAllModsAsFasta(CNcbiOstream &out) const
This will write the modifiers in FASTA format.
virtual void x_WriteAsFasta(const CBioseq &bioseq)
const CBioseq * GetNucleotideParent(const CBioseq &product, CScope *scope)
Get the encoding nucleotide sequnce of a protein.
const COrg_ref & GetOrg_ref(const CBioseq_Handle &handle)
Return the org-ref associated with a given sequence.
bool x_IsJustTopStrand(TSearchFlags flags) const
void GetOverlappingFeatures(const CSeq_loc &loc, CSeqFeatData::E_Choice feat_type, CSeqFeatData::ESubtype feat_subtype, EOverlapType overlap_type, TFeatScores &feats, CScope &scope, const TBestFeatOpts opts, CGetOverlappingFeaturesPlugin *plugin)
Find all features overlapping the location.
static void GetGapModText(const CSeq_gap &seq_gap, SGapModText &out_gap_mod_text)
Given a CSeq_gap object, this outputs the Gap information.
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
void x_AddPattern(TPatternInfo &pat_info, string &sequence, TSearchFlags flags)
const COrg_ref * GetOrg_refForBioseq(const CBioseq_Handle &bsh)
Find an Org-ref for the given Bioseq: If it's a protein then look on the source feature of the produc...
int TFlags
binary OR of EFlags
SRelLoc(const CSeq_loc &parent, const CSeq_loc &child, CScope *scope=0, TFlags flags=0)
Beware: treats locations corresponding to different sequences as disjoint, even if one is actually a ...
@ eWithAccessionVersion
accession.version (when possible)
@ fS2P_NoMerge
don't merge adjacent intervals on the product
@ fS2P_AllowTer
map the termination codon as a legal location
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
@ eGetId_Seq_id_FastaNARank
use CSeq_id::FastaNARank() as the scoring function
@ eGetId_Seq_id_WorstRank
use CSeq_id::WorstRank() as the scoring function
@ eGetId_ThrowOnError
Throw exception on errors. If not set, an empty value is returned.
@ eGetId_ForceAcc
return only an accession based seq-id
@ eGetId_ForceGi
return only a gi-based seq-id
@ eGetId_Seq_id_Score
use CSeq_id::Score() as the scoring function
@ eGetId_Seq_id_FastaAARank
use CSeq_id::FastaAARank() as the scoring function
@ eGetId_Seq_id_BestRank
use CSeq_id::BestRank() as the scoring function
@ eGetId_VerifyId
Check if the seq-id is present in the scope.
@ eGetId_TypeMask
Mask for requested id type.
@ eTransSplicing_Auto
Ignore overlap strand if the source location has mixed/both strand.
@ fInstantiateGaps
honor specifed gap mode; on by default
@ fHideGenBankPrefix
Hide gb| prefix for genbank only seq_id's.
@ fShowGapsOfSizeZero
Use this to show gaps of size zero as a lone hyphen at the end of a line.
@ fShowGnlAndAcc
Show general id and accession in the defline.
@ fKeepUnknGapNomLen
Keep unknown gap's nominal length. That is, when a gap has an unknown length but nominal length,...
@ fSuppressRange
never include location details in defline
@ fShowGapModifiers
show gap key-value pair modifiers (e.g. "[linkage-evidence=map;strobe]"). Only works if gap mode is e...
@ fNoDupCheck
skip check for duplicate sequence IDs
@ fEnableGI
Use this flag to enable GI output in the defline.
@ fReverseStrand
flip the (implicit) location
@ fAssembleParts
assemble FAR delta sequences; on by dflt
@ eHardMask
write as N for nucleotides, X for peptides
@ eSoftMask
write as lowercase rather than uppercase
@ fP2S_Extend
if hitting ends, extend to include partial codons
@ eGM_letters
Multiple inline Ns or Xs as appropriate (default).
@ eGM_count
>?N or >?unk100, as appropriate.
@ eGM_dashes
Multiple inline dashes.
@ eGM_one_dash
A single dash, followed by a line break.
@ fBestFeat_NoExpensive
don't perform any expensive tests, such as ones that require fetching additional sequences
@ fBestFeat_FavorLonger
favor longer features over shorter features
@ fBestFeat_StrictMatch
requires explicit association, rather than analysis based on overlaps
@ fBestFeat_IgnoreStrand
Pay no attention to strands when finding the best feat.
@ fNoMerge
don't merge adjacent intervals
TIds GetIds(const CSeq_id &id, TGetFlags flags=0)
Get "native" bioseq ids without filtering and matching.
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
CSeq_id_Handle GetAccVer(const CSeq_id_Handle &idh, TGetFlags flags=0)
Get accession.version Seq-id Returns null CSeq_id_Handle if the sequence is not found or if it doesn'...
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TGi GetGi(const CSeq_id_Handle &idh, TGetFlags flags=0)
Get GI of a sequence Returns ZERO_GI if the sequence is not found or if it doesn't have GI.
vector< CSeq_id_Handle > TIds
@ eGetBioseq_Loaded
Search in all loaded TSEs in the scope.
@ eGetBioseq_All
Search bioseq, load if not loaded yet.
const CTSE_Handle & GetTSE_Handle(void) const
Get CTSE_Handle of containing TSE.
bool IsSetInst_Seq_data(void) const
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
bool IsSetDbxref(void) const
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
CSeq_id_Handle GetAccessSeq_id_Handle(void) const
Get any CSeq_id_Handle handle that can be used to access this bioseq Use GetSeq_id_Handle() if it's n...
TSeqPos GetBioseqLength(void) const
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.
bool IsProtein(void) const
TInst_Topology GetInst_Topology(void) const
bool IsSetInst(void) const
void Reset(void)
Reset handle and make it not to point to any bioseq.
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeq_entry_Handle GetExactComplexityLevel(CBioseq_set::EClass cls) const
Return level with exact complexity, or empty handle if not found.
const CSeq_feat::TDbxref & GetDbxref(void) const
const CSeqMap & GetSeqMap(void) const
Get sequence map.
bool IsSetInst_Topology(void) const
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
const TId & GetId(void) const
bool IsSynonym(const CSeq_id &id) const
Check if this id can be used to obtain this bioseq handle.
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
const TInst & GetInst(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
CSeqVector_CI & SetPos(TSeqPos pos)
const char * GetBufferPtr(void) const
Get pointer to current char in the buffer.
ENa_strand GetStrand(void) const
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
SAnnotSelector & SetResolveTSE(void)
SetResolveTSE() is equivalent to SetResolveMethod(eResolve_TSE).
SAnnotSelector & SetFeatType(TFeatType type)
Set feature type (also set annotation type to feat)
SSeqMapSelector & SetLinkUsedTSE(bool link=true)
TSeqPos SkipGap(void)
skip current gap forward returns number of skipped gap symbols does nothing and returns 0 if current ...
TSeqPos GetPos(void) const
const CSeq_loc & GetLocation(void) const
SAnnotSelector & SetByProduct(bool byProduct=true)
Set flag indicating if the features should be searched by their product rather than location.
SAnnotSelector & SetOverlapType(EOverlapType overlap_type)
Set overlap type.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
TSeqPos GetGapSizeForward(void) const
returns number of gap symbols ahead including current symbol returns 0 if current position is not in ...
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
SAnnotSelector & SetSearchUnresolved(void)
EOverlapType
Flag to indicate location overlapping method.
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
TSeqPos GetBufferSize(void) const
Get number of chars from current position to the current buffer end.
const CSeq_loc & GetProduct(void) const
CSeqMap::ESegmentType GetType(void) const
bool HasZeroGapBefore(void)
true if there is zero-length gap before current position
bool IsUnknownLength(void) const
return true if current segment is a gap of unknown length
SAnnotSelector & SetOverlapIntervals(void)
Check overlapping of individual intervals.
void SetStrand(ENa_strand strand)
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 & SetIgnoreStrand(bool value=true)
Ignore strand when testing for range overlap.
CConstRef< CSeq_literal > GetRefGapLiteral(void) const
return CSeq_literal with gap data, or null if either the segment is not a gap, or an unspecified gap
const CSeqMap_CI & GetCurrentSeqMap_CI() const
@ eOverlap_Intervals
default - overlapping of individual intervals
@ eOverlap_TotalRange
overlapping of total ranges only
bool IsInGap(TSeqPos pos) const
true if sequence at 0-based position 'pos' has gap Note: this method is not MT-safe,...
const CSeqMap & GetSeqMap(void) const
bool IsProtein(void) const
void SetCoding(TCoding coding)
bool CanResolveRange(CScope *scope, const SSeqMapSelector &sel) const
const_iterator begin(void) const
TResidue GetGapChar(ECaseConversion case_cvt=eCaseConversion_none) const
Return gap symbol corresponding to the selected coding.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
NCBI_NS_STD::string::size_type SIZE_TYPE
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
CTempString & assign(const char *src_str, size_type len)
Assign new values to the content of the a string.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static 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.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static string & ToUpper(string &str)
Convert string to upper case – string& version.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
static string & ToLower(string &str)
Convert string to lower case – string& version.
ESign GetSign(void) const
Get sign of time span.
CTimeSpan DiffTimeSpan(const CTime &t) const
Difference in nanoseconds from specified time.
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[]
const TOrg & GetOrg(void) const
Get the Org member data.
bool IsSetPseudo(void) const
pseudogene Check if a value has been assigned to Pseudo data member.
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
bool IsSetLocus(void) const
Official gene symbol Check if a value has been assigned to Locus data member.
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
const TLocus & GetLocus(void) const
Get the Locus member data.
TPseudo GetPseudo(void) const
Get the Pseudo member data.
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetDb(void) const
name of database or system Check if a value has been assigned to Db data member.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
bool IsId(void) const
Check if variant Id is selected.
const TData & GetData(void) const
Get the Data member data.
const TDb & GetDb(void) const
Get the Db member data.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
TId GetId(void) const
Get the variant data.
vector< CRef< CDbtag > > TDbxref
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetQual(void) const
qualifiers Check if a value has been assigned to Qual data member.
bool IsSetCode(void) const
genetic code used Check if a value has been assigned to Code data member.
bool IsSetExt(void) const
user defined structure extension Check if a value has been assigned to Ext data member.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
const TLoc & GetLoc(void) const
Get the Loc member data.
const TQual & GetQual(void) const
Get the Qual member data.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TId & GetId(void) const
Get the Id member data.
bool IsGene(void) const
Check if variant Gene is selected.
list< CRef< CCode_break > > TCode_break
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetExcept(void) const
something funny about this? Check if a value has been assigned to Except data member.
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
const TCode & GetCode(void) const
Get the Code member data.
const TDbxref & GetDbxref(void) const
Get the Dbxref member data.
bool IsNcbieaa(void) const
Check if variant Ncbieaa is selected.
void SetData(TData &value)
Assign a value to Data data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
const TBiosrc & GetBiosrc(void) const
Get the variant data.
const TAa & GetAa(void) const
Get the Aa member data.
TPseudo GetPseudo(void) const
Get the Pseudo member data.
const TProduct & GetProduct(void) const
Get the Product member data.
TNcbieaa GetNcbieaa(void) const
Get the variant 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.
bool IsSetId(void) const
the feature copied Check if a value has been assigned to Id data member.
TExcept GetExcept(void) const
Get the Except member data.
const TXref & GetXref(void) const
Get the Xref member data.
vector< CRef< CSeqFeatXref > > TXref
vector< CRef< CGb_qual > > TQual
bool IsSetDbxref(void) const
support for xref to other databases Check if a value has been assigned to Dbxref data member.
const TCode_break & GetCode_break(void) const
Get the Code_break member data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsSetCode_break(void) const
individual exceptions Check if a value has been assigned to Code_break data member.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
@ eFrame_not_set
not set, code uses one
@ eFrame_three
reading frame
void SetTo(TTo value)
Assign a value to To data member.
void SetPoint(TPoint value)
Assign a value to Point data member.
void SetId(TId &value)
Assign a value to Id data member.
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
bool IsMix(void) const
Check if variant Mix is selected.
ENa_strand
strand of nucleic acid
bool IsPacked_pnt(void) const
Check if variant Packed_pnt is selected.
const TWhole & GetWhole(void) const
Get the variant data.
void SetId(TId &value)
Assign a value to Id data member.
void SetStrand(TStrand value)
Assign a value to Strand data member.
bool IsGeneral(void) const
Check if variant General is selected.
void SetFuzz(TFuzz &value)
Assign a value to Fuzz data member.
E_Choice Which(void) const
Which variant is currently selected.
void SetFrom(TFrom value)
Assign a value to From data member.
const Tdata & Get(void) const
Get the member data.
TVersion GetVersion(void) const
Get the Version member data.
void SetFuzz_to(TFuzz_to &value)
Assign a value to Fuzz_to data member.
void SetFuzz_from(TFuzz_from &value)
Assign a value to Fuzz_from data member.
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
Tdata & Set(void)
Assign a value to data member.
const TGeneral & GetGeneral(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.
bool IsInt(void) const
Check if variant Int is selected.
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
void SetStrand(TStrand value)
Assign a value to Strand data member.
bool IsPnt(void) const
Check if variant Pnt is selected.
const TAccession & GetAccession(void) const
Get the Accession member data.
@ eNa_strand_both
in forward orientation
@ e_Other
for historical reasons, 'other' = 'refseq'
@ e_Tpe
Third Party Annot/Seq EMBL.
@ e_Tpd
Third Party Annot/Seq DDBJ.
@ e_General
for other databases
@ e_Gi
GenInfo Integrated Database.
@ e_Tpg
Third Party Annot/Seq Genbank.
const TSeq & GetSeq(void) const
Get the variant data.
const TSet & GetSet(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
@ eClass_segset
segmented sequence + parts
TRepr GetRepr(void) const
Get the Repr member data.
list< CRef< CSeqdesc > > Tdata
bool IsSetReplaced_by(void) const
these seqs make this one obsolete Check if a value has been assigned to Replaced_by data member.
const TUser & GetUser(void) const
Get the variant data.
bool CanGetType(void) const
Check if it is safe to call GetType method.
TLinkage GetLinkage(void) const
Get the Linkage member data.
const TInst & GetInst(void) const
Get the Inst member data.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
bool IsOrg(void) const
Check if variant Org is selected.
void SetExt(TExt &value)
Assign a value to Ext data member.
TType GetType(void) const
Get the Type member data.
bool CanGetLinkage_evidence(void) const
Check if it is safe to call GetLinkage_evidence method.
const TSource & GetSource(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
const TId & GetId(void) const
Get the Id member data.
bool IsSetHist(void) const
sequence history Check if a value has been assigned to Hist data member.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
const Tdata & Get(void) const
Get the member data.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
TLength GetLength(void) const
Get the Length member data.
const TOrg & GetOrg(void) const
Get the variant data.
TLength GetLength(void) const
Get the Length member data.
list< CRef< CSeq_id > > TId
TMol GetMol(void) const
Get the Mol member data.
const TIds & GetIds(void) const
Get the Ids member data.
const TLinkage_evidence & GetLinkage_evidence(void) const
Get the Linkage_evidence member data.
TType GetType(void) const
Get the Type member data.
bool IsDelta(void) const
Check if variant Delta is selected.
void SetInst(TInst &value)
Assign a value to Inst data member.
const THist & GetHist(void) const
Get the Hist member data.
const TExt & GetExt(void) const
Get the Ext member data.
bool CanGetType(void) const
Check if it is safe to call GetType method.
ETopology
topology of molecule
const TDelta & GetDelta(void) const
Get the variant data.
bool CanGetLinkage(void) const
Check if it is safe to call GetLinkage method.
const Tdata & Get(void) const
Get the member data.
bool IsSetDate(void) const
Check if a value has been assigned to Date data member.
list< CRef< CDelta_seq > > Tdata
bool IsGap(void) const
Check if variant Gap is selected.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
const TDate & GetDate(void) const
Get the Date member data.
const TReplaced_by & GetReplaced_by(void) const
Get the Replaced_by member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
const TMolinfo & GetMolinfo(void) const
Get the variant data.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
list< CRef< CLinkage_evidence > > TLinkage_evidence
bool IsSetLinkage_evidence(void) const
Check if a value has been assigned to Linkage_evidence data member.
bool IsUser(void) const
Check if variant User is selected.
@ eRepr_delta
sequence made by changes (delta) to others
@ eRepr_raw
continuous sequence
@ e_Ncbieaa
extended ASCII 1 letter aa codes
@ e_Org
if all from one organism
@ e_Molinfo
info on the molecule and techniques
@ e_Source
source of materials, includes Org-ref
@ eType_clone
Deprecated. Used only for AGP 1.1.
@ eType_fragment
Deprecated. Used only for AGP 1.1.
@ eType_proximity_ligation
@ e_Literal
a piece of sequence
@ e_Loc
point to a sequence
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in objmgr libraries (xobjmgr.lib, xobjutil.lib and others).
range(_Ty, _Ty) -> range< _Ty >
double value_type
The numeric datatype used by the parser.
Int4 delta(size_t dimension_, const Int4 *score_)
double f(double x_, const double &y_)
static pcre_uint8 * buffer
Utility macros and typedefs for exploring NCBI objects from seq.asn.
#define FOR_EACH_SEQDESC_ON_BIOSEQ(Itr, Var)
FOR_EACH_SEQDESC_ON_BIOSEQ EDIT_EACH_SEQDESC_ON_BIOSEQ.
#define FOR_EACH_SEQID_ON_BIOSEQ(Itr, Var)
FOR_EACH_SEQID_ON_BIOSEQ EDIT_EACH_SEQID_ON_BIOSEQ.
DEFINE_STATIC_ARRAY_MAP(TComplement, sc_Complement, sc_comp_tbl)
map< CCdregion::EFrame, SFrameInfo > TFrameInfoMap
int FastaNARank_SeqIdHandle(const CSeq_id_Handle &idh)
static void AddGapToDeltaSeq(CRef< CBioseq >prot, bool unknown_length, TSeqPos add_len)
CSeq_id_Handle x_FindLatestSequence(const CSeq_id_Handle &idh, CScope &scope, const CTime *tlim)
static const char sc_EnumToChar[16]
void x_Translate(const Container &seq, string &prot, int frame, const CGenetic_code *code, bool is_5prime_complete, bool is_3prime_complete, bool include_stop, bool remove_trailing_X, bool *alt_start)
pair< Int8, CConstRef< CSeq_feat > > TFeatScore
int Score_SeqIdHandle(const CSeq_id_Handle &idh)
int FastaAARank_SeqIdHandle(const CSeq_id_Handle &idh)
static bool s_ShouldUseOriginalID(const CBioseq &seq)
int WorstRank_SeqIdHandle(const CSeq_id_Handle &idh)
static CConstRef< CSeq_feat > x_GetBestOverlapForSNP(const CSeq_feat &snp_feat, CSeqFeatData::E_Choice type, CSeqFeatData::ESubtype subtype, CScope &scope, bool search_both_strands=true)
static bool s_WriteGnlAndAcc(const CBioseq &bioseq, CNcbiOstream &ostr)
int BestRank_SeqIdHandle(const CSeq_id_Handle &idh)
static const TCharPair sc_comp_tbl[32]
bool IsTransSpliced(const CSeq_feat &feat)
static void AddAAToDeltaSeq(CRef< CBioseq > prot, char residue)
CSeq_id_Handle x_GetId(const CScope::TIds &ids, EGetIdType type)
CConstRef< CSeq_feat > GetLocalGeneByXref(const CGene_ref &gene, CBioseq_Handle bsh)
static string s_FastaGetOriginalID(const CBioseq &seq)
static char s_GetComplement(char c)
CConstRef< CSeq_feat > GetLocalGeneByLocus(const string &locus, bool use_tag, CBioseq_Handle bsh)
vector< TFeatScore > TFeatScores
const char * kRibosomalSlippageText
static string s_GetReverseComplement(const string &sequence)
CStaticPairArrayMap< Char, Char > TComplement
SStaticPair< Char, Char > TCharPair
static const EBaseCode sc_CharToEnum[256]
conversion table from Ncbi4na / Iupacna to EBaseCode
Generic utility macros and templates for exploring NCBI objects.
#define FIELD_IS_SET_AND_IS(Var, Fld, Chs)
FIELD_IS_SET_AND_IS base macro.
#define GET_FIELD(Var, Fld)
GET_FIELD base macro.
static CNamedPipeClient * client
This indicates the text of the modifiers of a gap.
bool operator()(const pair< T, U > &p1, const pair< T, U > &p2) 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.
Selector used in CSeqMap methods returning iterators.
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
static const struct type types[]