114 #define NCBI_USE_ERRCODE_X Objtools_Fmt_Gather
130 if( subtypevalue1 != subtypevalue2 ) {
136 if( name1 != name2 ) {
152 return obj1->
Match( *obj2 );
166 return obj1->
Equals( *obj2 );
200 "This format is currently not supported");
249 x_GatherSeqEntry(
ctx, entry, bsh, useSeqEntryIndexing, topLevelSeqEntryContext, doNuc, doProt);
267 bool useSeqEntryIndexing,
269 bool doNuc,
bool doProt)
const
278 if (( bsh.
IsNa() && doNuc ) || ( bsh.
IsAa() && doProt )) {
322 bool doNuc,
bool doProt)
const
337 for ( ; seq_iter; ++seq_iter ) {
340 x_GatherBioseq(prev_seq, this_seq, next_seq, topLevelSeqEntryContext);
346 next_seq = *seq_iter;
351 x_GatherBioseq(prev_seq, this_seq, next_seq, topLevelSeqEntryContext);
394 if (it->IsSet() && it->GetSet().IsSetClass() &&
427 "Release mode failure: Given sequence is not contig" );
433 "FlatFileGeneration canceled by ICancel callback");
449 (topLevelSeqEntryContext ? &*topLevelSeqEntryContext :
nullptr)));
521 if (!
ctx.IsCrossKingdom())
break;
522 if (!
ctx.IsRSUniqueProt())
break;
529 src->
SetOrg().SetTaxname(
"Unknown.");
530 src->
SetOrg().SetOrgname().SetLineage(
"Unclassified.");
547 switch( (*it)->Which() ) {
568 if ( ( !
ctx.CanGetTLSeqEntryCtx() ||
ctx.GetTLSeqEntryCtx().GetCanSourcePubsBeFused() ) &&
s_IsJustUids(pubdesc) ) {
633 if( ! it.GetSeq_entry_Handle().HasParentEntry() ) {
654 annot_it; ++annot_it) {
655 if ( !annot_it->Seq_annot_IsSetDesc() ) {
659 annot_it->Seq_annot_GetDesc().Get()) {
660 if ( !(*it)->IsPub() ) {
690 for (
CSeqMap_CI smit(seqmap, &scope, mapsel); smit; ++smit) {
725 for ( ; fci; ++fci) {
762 const CPubdesc& pubdesc = sd.GetPub();
763 if ( s_FilterPubdesc(pubdesc, *m_Current) ) {
779 annot_it; ++annot_it) {
780 if ( !annot_it->Seq_annot_IsSetDesc() ) {
784 annot_it->Seq_annot_GetDesc().Get()) {
785 if ( !(*it)->IsPub() ) {
798 desc->SetPub(
const_cast<CPubdesc&
>((*it)->GetPub()));
807 for ( ; fci; ++fci) {
808 const CSeq_feat& sf = fci->GetOriginalFeature();
836 if (m_Current->GetSubmitBlock()) {
868 if( primary_seq_id ) {
870 if( potential_cds_seq ) {
871 cds_seq = potential_cds_seq;
881 if( (*coreSeqSet_iter)->IsSeq() ) {
882 const CSeq_id* coreSeqId = (*coreSeqSet_iter)->GetSeq().GetFirstId();
885 if( potential_cds_seq ) {
886 cds_seq = potential_cds_seq;
896 const CSeq_feat& feat = it->GetOriginalFeature();
915 if( ! it.GetSeq_entry_Handle().HasParentEntry() ) {
941 if (
ctx.UsingSeqEntryIndex() ) {
1026 if (
ctx.ShowGBBSource() ) {
1036 if(
ctx.ShowAnnotCommentAsCOMMENT() ) {
1053 if ( !com->Skip() ) {
1064 if ( !gsdb_comment->Skip() ) {
1079 if( setCommentsSeen.
find((*com_iter)->GetCommentList()) == setCommentsSeen.
end() ) {
1081 setCommentsSeen.
insert((*com_iter)->GetCommentList());
1082 newComments.push_back(*com_iter);
1099 for(
size_t idx = 0; idx < (
m_Comments.size() - 1); ++idx ) {
1121 (*it)->RemovePeriodAfterURL();
1131 if (gsdb && it !=
last) {
1162 static const TUnverifiedElem sc_unverified_map[] = {
1164 "source organism" },
1166 "sequence and/or annotation" },
1168 "sequence assembly" }
1173 vector<string> arr_type_string;
1174 ITERATE( TUnverifiedMap, map_iter, sc_UnverifiedMap ) {
1175 if( (
ctx.GetUnverifiedType() & map_iter->first) != 0 ) {
1176 arr_type_string.push_back(map_iter->second);
1181 if (arr_type_string.empty() && !is_contaminated) {
1186 if (!arr_type_string.empty()) {
1187 type_string +=
"GenBank staff is unable to verify ";
1188 for(
size_t ii = 0; ii < arr_type_string.size(); ++ii ) {
1191 }
else if( ii == (arr_type_string.size() - 1) ) {
1200 if (is_contaminated) {
1201 if (arr_type_string.size() > 0) {
1204 type_string +=
"GenBank staff has noted that the sequence(s) may be contaminated.";
1222 if (!is_unannotated) {
1226 string type_string =
"GenBank staff has not reviewed this submission because annotation was not provided.";
1245 item->SetNeedPeriod(
false);
1255 item->SetNeedPeriod(
false);
1263 string sAuthorizedAccess =
1276 string genome_build_number =
1282 const CSeq_id&
id = **id_iter;
1284 switch (
id.Which() ) {
1287 if (
ctx.IsRSCompleteGenomic() ) {
1288 if ( !genome_build_number.empty() &&
1289 !has_ref_track_status
1298 else if (
ctx.IsRSContig() ||
ctx.IsRSIntermedWGS() ) {
1299 if (
ctx.IsEncode() ) {
1304 }
else if ( !has_ref_track_status ) {
1312 if (
ctx.IsRSPredictedProtein() ||
1313 ctx.IsRSPredictedMRna() ||
1314 ctx.IsRSPredictedNCRna() ||
1320 if ( !
str.empty() ) {
1322 item->SetNeedPeriod(
false);
1327 if(
ctx.IsRSUniqueProt() ) {
1329 if( !
str.empty() ) {
1337 const CDbtag& dbtag =
id.GetGeneral();
1344 file_id = &(
id.GetGeneral().GetTag());
1350 local_id = &(
id.GetLocal());
1358 if (
ctx.IsTPA() ||
ctx.IsGED() ) {
1359 if (
ctx.Config().IsModeGBench() ||
ctx.Config().IsModeDump() ) {
1374 bool did_tpa =
false, did_ref_track =
false, did_genome =
false;
1384 if ( !
str.empty() ) {
1393 if ( !
ctx.Config().HideBankItComment() ) {
1396 if ( !
str.empty() ) {
1404 if ( !did_ref_track ) {
1409 if ( !
str.empty() ) {
1411 did_ref_track =
true;
1418 if ( !did_genome ) {
1429 if( (*hist_iter) && (*hist_iter)->IsGi() && (*hist_iter)->GetGi() == gi ) {
1447 if (
r.CanGetDate() && !
r.GetIds().empty() &&
1457 if (
r.CanGetDate() && !
r.GetIds().empty() &&
1473 if ( !
str.empty() ) {
1484 if ( !
ctx.IsWGSMaster() ||
ctx.GetWGSMasterName().empty() ) {
1490 if ( !
str.empty() ) {
1508 if ( !
str.empty() ) {
1525 if ( !
str.empty() ) {
1533 if (!
ctx.ShowGBBSource()) {
1538 const CGB_block& gbb = it->GetGenbank();
1540 string comment =
"Original source text: " + gbb.
GetSource();
1550 if (
ctx.UsePDBCompoundForComment()) {
1551 for (
auto id_handle :
ctx.GetHandle().GetId()) {
1610 chs1 = desc1->
Which();
1611 chs2 = desc2->
Which();
1619 const string& str1 = typ1.
GetStr();
1620 const string& str2 = typ2.
GetStr();
1621 bool issc1 = (
bool) (str1 ==
"StructuredComment");
1622 bool issc2 = (
bool) (str2 ==
"StructuredComment");
1623 if (issc1 && issc2) {
1632 return (val1 < val2);
1651 vector<CConstRef<CSeqdesc> > vdesc;
1656 vdesc.push_back(dsc);
1660 for (
size_t ii = 0; ii < vdesc.size(); ii++) {
1683 const list<string>* keywords =
nullptr;
1688 ITERATE (list<string>, kwd, *keywords) {
1707 if (
ctx.IsRefSeq() &&
1710 if ( !
str.empty() ) {
1735 for( ; annot_ci; ++annot_ci ) {
1741 if( ! descr.
IsSet() ) {
1762 if( ! firstGenAnnotSCAD &&
ctx.IsNcbiGenomes() &&
1765 ctx.GetHandle().IsSetInst_Ext() &&
1766 ctx.GetHandle().GetInst_Ext().IsDelta() &&
1767 ctx.GetHandle().GetInst_Ext().GetDelta().IsSet() )
1771 if( ! (*ext_iter)->IsLoc() ) {
1775 const CSeq_loc & loc = (*ext_iter)->GetLoc();
1787 if( firstGenAnnotSCAD ) {
1788 return firstGenAnnotSCAD;
1793 return firstGenAnnotSCAD;
1800 for( ; curr_entry_h ; curr_entry_h = curr_entry_h.
GetParentEntry() ) {
1804 for( ; annot_ci; ++annot_ci ) {
1810 if( ! annot_descr.
IsSet() ) {
1816 if( ! (*descr_iter)->IsUser() ) {
1820 const CUser_object & descr_user = (*descr_iter)->GetUser();
1891 from = ( from >= 1 ? from : 1 );
1923 bool loop = (
bool) (
ctx.IsSP() || (
ctx.IsCrossKingdom() &&
ctx.IsRSUniqueProt()));
1931 sf->SetObject(*dit);
1944 for (; smit; ++smit) {
1953 for (; src_it; ++src_it) {
2015 if (
ctx.IsProt() ) {
2037 if ( !
ctx.IsProt() ) {
2053 ctx.GetLocation().GetTotalRange(),
2085 bool need_to_normalize =
false;
2086 if( force_adding_nulls ) {
2088 need_to_normalize =
true;
2092 bool saw_multiple_non_nulls_in_a_row =
false;
2093 bool last_was_null =
true;
2094 bool any_null_seen =
false;
2095 for ( ; loc_ci ; ++loc_ci ) {
2097 last_was_null =
true;
2098 any_null_seen =
true;
2100 if( last_was_null ) {
2101 last_was_null =
false;
2104 saw_multiple_non_nulls_in_a_row =
true;
2109 need_to_normalize = ( any_null_seen && saw_multiple_non_nulls_in_a_row );
2112 if( ! need_to_normalize ) {
2124 for( ; loc_ci ; ++loc_ci ) {
2125 if( ! mix_data.empty() ) {
2126 mix_data.push_back( null_loc );
2130 mix_data.push_back( loc_piece );
2139 if ( srcs.size() < 2 ) {
2145 const CSeq_loc & focus_seq_loc = focus->GetLoc();
2147 unique_ptr<CSeq_loc> copyOfOriginalSeqLocOfFocus(
new CSeq_loc() );
2148 copyOfOriginalSeqLocOfFocus->Assign( focus_seq_loc );
2164 if (it != srcs.begin()) {
2170 if( focus->GetLoc().GetTotalRange().GetLength() == 0 ) {
2171 focus->SetLoc( *copyOfOriginalSeqLocOfFocus );
2172 copyOfOriginalSeqLocOfFocus.release();
2177 CSeq_loc_CI focus_loc_iter = focus->GetLoc().begin();
2178 if( focus_loc_iter != focus->GetLoc().end() ) {
2180 if( focus_loc_iter != focus->GetLoc().end() ) {
2183 focus->SetLoc( *new_focus );
2195 if (sfp1->WasDesc() && !sfp2->WasDesc()) {
2197 }
else if (!sfp1->WasDesc() && sfp2->WasDesc()) {
2223 if ( srcs.empty() ) {
2236 if (srcs.front()->IsFocus() && !srcs.front()->IsSynthetic()) {
2241 if ( srcs.front()->GetLoc().GetTotalRange().GetLength() == 0 &&
2257 if ( srcs.size() < 2 ) {
2265 bool sourcePubFuse =
false;
2271 switch( seqId->
Which() ) {
2285 sourcePubFuse =
true;
2292 sourcePubFuse =
true;
2310 if( ! sourcePubFuse ) {
2322 TSourceFeatSet::iterator item_outer = srcs.begin();
2323 for( ; item_outer != srcs.end(); ++item_outer ) {
2324 if( item_outer->IsNull() ) {
2327 TSourceFeatSet::iterator item_inner = item_outer;
2329 while ( item_inner != srcs.end() ) {
2330 if( item_inner->IsNull() ) {
2336 Seq_loc_Add((*item_outer)->GetLoc(), (*item_inner)->GetLoc(),
2339 (*item_outer)->SetLoc(*merged_loc);
2340 item_inner->Release();
2349 TSourceFeatSet::iterator copy_iter = srcs.begin();
2350 for( ; copy_iter != srcs.end(); ++copy_iter ) {
2351 if( ! copy_iter->IsNull() ) {
2352 newSrcs.push_back( *copy_iter );
2355 srcs.swap( newSrcs );
2378 if( taxname1 != taxname2 ) {
2385 if( comment1 != comment2 ) {
2412 if( orgmod1.size() != orgmod2.size() ) {
2416 if( ! equal( orgmod1.begin(), orgmod1.end(),
2431 if( db1.size() != db2.size() ) {
2435 if( ! equal( db1.begin(), db1.end(),
2450 if( subtype1.size() != subtype2.size() ) {
2454 if( ! equal( subtype1.begin(), subtype1.end(),
2462 const bool locations_overlap_or_touch =
2465 if( ! locations_overlap_or_touch ) {
2527 if (!
ctx.GetAnnotSelector()) {
2559 const bool showOutOfBoundsFeats =
ctx.Config().ShowOutOfBoundsFeats();
2560 const bool is_part =
ctx.IsPart();
2568 const bool is_small_genome_set =
ctx.GetSGS();
2571 if( showOutOfBoundsFeats && ! is_part && ! is_small_genome_set ) {
2582 bool any_piece_is_on_bioseq =
false;
2584 if( ! any_piece_is_on_bioseq ) {
2586 any_piece_is_on_bioseq =
true;
2598 if(
ctx.IsSeqIdInSameTopLevelSeqEntry(it.GetSeq_id()) ) {
2599 if( ! first_non_far ) {
2605 if( ! first_non_far || ! any_piece_is_on_bioseq ) {
2614 if( is_small_genome_set ) {
2616 const bool first_is_on_bioseq = (
2617 first == first_non_far &&
2620 if( first_is_on_bioseq ) {
2627 ctx.IsSeqIdInSameTopLevelSeqEntry(
first.GetSeq_id()) )
2634 if(
first != first_non_far &&
2655 CSeq_loc_CI part_to_check = ( bMinus ? first_non_far : last_non_far );
2657 const bool endsOnThisBioseq = ( part_to_check &&
2660 return endsOnThisBioseq;
2662 if( endsOnThisBioseq ) {
2704 return ctx.IsInGPS() && !
ctx.IsInNucProt() &&
ctx.Config().CopyCDSFromCDNA();
2711 if ( !
ctx.IsDelta() ) {
2715 if (
ctx.Config().HideGapFeatures()) {
2721 ERR_POST_X(1,
"Failed to create CSeqMap for gap iteration");
2725 int gapDepth =
ctx.Config().GetGapDepth();
2741 const static string kRegularGap =
"gap";
2742 const static string kAssemblyGap =
"assembly_gap";
2753 if( pSeqLiteral && pSeqLiteral->IsSetSeq_data() )
2755 const CSeq_data & seq_data = pSeqLiteral->GetSeq_data();
2756 if( seq_data.
IsGap() ) {
2757 pGap = &seq_data.
GetGap();
2767 const string & sType = gap_mod_text.
gap_type;
2771 const bool bIsAssemblyGap = ( ! sType.empty() || ! sEvidence.empty() );
2772 const string & sFeatName = ( bIsAssemblyGap ? kAssemblyGap : kRegularGap );
2775 new CGapItem(pos, end_pos,
ctx, sFeatName, sType, sEvidence) :
2776 new CGapItem(pos, end_pos,
ctx, sFeatName, sType, sEvidence,
2784 const vector<string>& evidence,
2785 bool isUnknownLength,
bool isAssemblyGap,
2788 const static string kRegularGap =
"gap";
2789 const static string kAssemblyGap =
"assembly_gap";
2792 const bool bIsAssemblyGap = ( ! gap_type.empty() || ! evidence.empty() );
2793 const string & sFeatName = ( bIsAssemblyGap ? kAssemblyGap : kRegularGap );
2796 new CGapItem(gap_start, gap_end,
ctx, sFeatName, gap_type, evidence) :
2797 new CGapItem(gap_start, gap_end,
ctx, sFeatName, gap_type, evidence,
2807 const bool feats_have_same_structure =
2812 if( ! feats_have_same_structure ) {
2819 if( f1_annot && f2_annot ) {
2820 if( (f1_annot == f2_annot) ||
2841 if (loc_label.size() > 100) {
2842 loc_label.replace(97,
NPOS,
"...");
2845 return desc.c_str();
2858 if (feat.
GetComment().find_last_not_of(
" ") !=
2862 const string& comment =
2865 typedef pair<const char*, CSeqFeatData::ESite>
TPair;
2891 static const size_t kMaxPair =
sizeof(
sc_Pairs) /
sizeof(
TPair);
2892 for (
size_t i = 0;
i < kMaxPair; ++
i) {
2918 f.SetData().SetRegion(x);
2945 if( featIsGap && (feat_start == gap_start) && (feat_end == gap_end) ) {
2950 if( feat_start > gap_start ) {
2962 temp_annot->
SetData().SetFtable().push_back(feat);
2982 return (name ==
"Annot:CDD" || name ==
"CDDSearch" || name ==
"CDD");
3006 gapdat.
gap_end = sgr->GetEnd();
3008 gapdat.
gap_type = sgr->GetGapType();
3055 gap_data.next_gap = 0;
3057 if (gap_data.num_gaps > 0 && !
ctx.Config().HideGapFeatures()) {
3063 bool load_cdd =
false;
3064 if (!
ctx.Config().HideCDDFeatures()) {
3065 switch (
ctx.Config().GetPolicy()) {
3070 load_cdd =
ctx.Config().ShowCDDFeatures();
3084 for (
CFeat_CI cds_it(hdl, sel); cds_it; ++cds_it) {
3085 cdd_ids.push_back(cds_it->GetProductId());
3092 gaps, &gap_data, showGapsOfSizeZero, bsx](
CFeatureIndex& sfx) {
3120 CSeq_id_Handle rna =
3121 sequence::GetIdHandle(original_feat.GetProduct(), &scope);
3122 CSeq_id_Handle prot =
3123 sequence::GetIdHandle(children.front().GetProduct(),
3126 CBioseq_Handle rna_bsh;
3127 CBioseq_Handle prot_bsh;
3128 GetResolveOrder(scope,
3149 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3159 if( feat_start > feat_end ) {
3160 feat_start -= loc_len;
3165 bool has_gap = gap_data.has_gap;
3166 int gap_start = gap_data.gap_start;
3167 int gap_end = gap_data.gap_end - 1;
3171 while (has_gap && gap_start < feat_start) {
3172 const bool noGapSizeProblem = ( showGapsOfSizeZero || (gap_start <= gap_end + 1) );
3174 if ( noGapSizeProblem && ! gapMatch ) {
3175 item.
Reset(
s_NewGapItem(gap_data.gap_start, gap_data.gap_end, gap_data.gap_length, gap_data.gap_type,
3176 gap_data.gap_evidence, gap_data.is_unknown_length, gap_data.is_assembly_gap,
ctx) );
3179 if (gap_data.next_gap < gap_data.num_gaps) {
3181 has_gap = gap_data.has_gap;
3182 gap_start = gap_data.gap_start;
3183 gap_end = gap_data.gap_end;
3185 gap_data.has_gap =
false;
3192 if (gap_end > feat_end) {
3194 }
else if (gap_data.next_gap < gap_data.num_gaps) {
3196 has_gap = gap_data.has_gap;
3197 gap_start = gap_data.gap_start;
3198 gap_end = gap_data.gap_end;
3200 gap_data.has_gap =
false;
3225 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3244 <<
" [" << e <<
"]; flatfile may be truncated");
3256 <<
" [" << e <<
"]");
3261 while (gap_data.has_gap) {
3262 const bool noGapSizeProblem = ( showGapsOfSizeZero || (gap_data.gap_start <= gap_data.gap_end) );
3263 if( noGapSizeProblem ) {
3264 item.
Reset(
s_NewGapItem(gap_data.gap_start, gap_data.gap_end, gap_data.gap_length, gap_data.gap_type,
3265 gap_data.gap_evidence, gap_data.is_unknown_length, gap_data.is_assembly_gap,
ctx) );
3268 if (gap_data.next_gap < gap_data.num_gaps) {
3271 gap_data.has_gap =
false;
3300 ctx.GetFeatTree().AddFeatures(it);
3321 vector<CMappedFeat> children =
3322 ctx.GetFeatTree().GetChildren(*it);
3323 if (children.size() == 1 &&
3324 children.front().IsSetProduct()) {
3355 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3365 if( feat_start > feat_end ) {
3366 feat_start -= loc_len;
3378 if ( feat_start >= gap_start ) {
3381 const bool noGapSizeProblem = ( showGapsOfSizeZero || (gap_start <= gap_end) );
3409 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3427 <<
" [" << e <<
"]; flatfile may be truncated");
3439 <<
" [" << e <<
"]");
3458 static size_t s_UniqueIdOffset = 0;
3483 seq->SetId().push_back(s_MakeUniqueId(scope));
3484 seq->SetInst().Assign(bsh.
GetInst());
3485 seq->SetInst().ResetSeq_data();
3486 seq->SetInst().ResetExt();
3489 element->SetLoc().Assign(loc);
3490 seq->SetInst().SetExt().SetDelta().Set().push_back(element);
3498 bool any_change =
false;
3500 new_loc->Assign(loc);
3503 const CSeq_id&
id = it.GetSeq_id();
3504 if (
id.
Equals(temporary)) {
3510 new_loc->
Assign(*it.MakeSeq_loc());
3520 seq_id.
Assign( *
ctx.GetHandle().GetSeqId() );
3525 old_loc.
SetInt().SetId( seq_id );
3526 old_loc.
SetInt().SetFrom( 0 );
3527 old_loc.
SetInt().SetTo( new_len - 1 );
3532 return slice_mapper;
3549 bool isWhole =
ctx.GetLocation().IsWhole();
3552 if (
ctx.GetMasterLocation()) {
3555 loc.
Assign(*
ctx.GetHandle().GetRangeSeq_loc(0, 0));
3561 TSeqPos start =
fi->GetLocation().GetTotalRange().GetFrom();
3562 TSeqPos stop =
fi->GetLocation().GetTotalRange().GetTo();
3565 if ( to >= start && from <= stop ) {
3622 ctx.GetFeatTree().AddFeatures(it);
3652 vector<CMappedFeat> children =
3653 ctx.GetFeatTree().GetChildren(*it);
3654 if (children.size() == 1 &&
3655 children.front().IsSetProduct()) {
3692 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3706 if( feat_start > feat_end ) {
3707 feat_start -= loc_len;
3719 if ( feat_start >= gap_start ) {
3722 const bool noGapSizeProblem = ( showGapsOfSizeZero || (gap_start <= gap_end) );
3723 if( noGapSizeProblem ) {
3764 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3782 <<
" [" << e <<
"]; flatfile may be truncated");
3794 <<
" [" << e <<
"]");
3840 ctx.GetFeatTree().AddFeatures(it);
3868 vector<CMappedFeat> children =
3869 ctx.GetFeatTree().GetChildren(*it);
3870 if (children.size() == 1 &&
3871 children.front().IsSetProduct()) {
3898 feat_loc = s_FixId(*feat_loc, *(
ctx.GetBioseqIds().front()), *(
delta->GetId().front()));
3912 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3936 if (( !
ctx.Config().IsFormatFTable() ||
ctx.Config().ShowFtablePeptides() )) {
3954 <<
" [" << e <<
"]; flatfile may be truncated");
3972 <<
" [" << e <<
"]");
3987 if(
ctx.GetLocation().IsWhole() ) {
3988 if (
ctx.UsingSeqEntryIndex() ) {
3994 if (
ctx.UsingSeqEntryIndex() ) {
4081 if (
ctx.GetAnnotSelector()) {
4082 selp = &
ctx.SetAnnotSelector();
4104 if (
ctx.GetMasterLocation()) {
4107 loc.
Assign(*
ctx.GetHandle().GetRangeSeq_loc(0, 0));
4111 if (
ctx.GetLocation().IsWhole()) {
4117 if (
ctx.IsProt() ) {
4150 if (cds_prod_seq_id) {
4151 CBioseq_Handle prod_bioseq_handle =
ctx.GetScope().GetBioseqHandle( *cds_prod_seq_id );
4152 if( prod_bioseq_handle ) {
4155 cds_prod->
SetInt().SetTo( bioseq_len - 1 );
4189 ctx.GetFeatTree().AddFeatures(it);
4217 if (
ctx.GetAnnotSelector()) {
4218 selp = &
ctx.SetAnnotSelector();
4240 if (
ctx.GetMasterLocation()) {
4243 loc.
Assign(*
ctx.GetHandle().GetRangeSeq_loc(0, 0));
4249 if (
ctx.IsProt() ) {
4282 if (cds_prod_seq_id) {
4283 CBioseq_Handle prod_bioseq_handle =
ctx.GetScope().GetBioseqHandle( *cds_prod_seq_id );
4284 if( prod_bioseq_handle ) {
4287 cds_prod->
SetInt().SetTo( bioseq_len - 1 );
4321 ctx.GetFeatTree().AddFeatures(it);
4357 if ( ! pDestLoc->
IsInt() ) {
4362 if ( ! srcLoc.
IsInt() ) {
4372 if ( ! featLoc.
IsInt() ) {
4418 if ( 3 + featInt.
GetTo() - destInt.
GetTo() < 6 ) {
4442 if (!feat.GetData().IsCdregion() || !feat.CanGetProduct()) {
4470 ctx.GetFeatTree().AddFeatures( it );
4477 for ( ; it; ++it ) {
4516 x_GiveOneResidueIntervalsBogusFuzz(*loc);
4520 x_RemoveBogusFuzzFromIntervals(*loc);
4523 if (!loc || loc->
IsNull()) {
4533 if( slice_mapper && loc ) {
4536 if( mapped_loc->
IsNull() ) {
4571 if (!feat.GetData().IsCdregion() || !feat.CanGetProduct()) {
4596 ctx.GetFeatTree().AddFeatures( it );
4603 for ( ; it; ++it ) {
4629 x_GiveOneResidueIntervalsBogusFuzz(*loc);
4633 x_RemoveBogusFuzzFromIntervals(*loc);
4636 if (!loc || loc->
IsNull()) {
4646 if( slice_mapper && loc ) {
4649 if( mapped_loc->
IsNull() ) {
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_Positional
numerical value
@ 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.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Seq-loc and seq-align mapper exceptions.
const string & GetTaxname(void) const
bool IsSetTaxname(void) const
CBioseq_Handle & GetHandle(void)
CScope & GetScope(void) const
@ fUnreviewed_Unannotated
SAnnotSelector & SetAnnotSelector(void)
const CFlatFileConfig & Config(void) const
const CSubmit_block * GetSubmitBlock(void) const
CSeq_inst::TRepr GetRepr(void) const
CSeq_id * GetPrimaryId(void)
const CSeq_entry_Handle & GetTopLevelEntry(void) const
TReferences & SetReferences(void)
void SetRefCache(vector< string > *rc)
const CSeq_loc & GetLocation(void) const
@ fUnverified_Contaminant
@ fUnverified_SequenceOrAnnotation
@ fUnverified_Misassembled
const vector< CRef< CGapIndex > > & GetGapIndices(void)
void GetSelector(SAnnotSelector &sel)
size_t IterateDescriptors(Fnc m)
size_t IterateFeatures(Fnc m)
const CSeq_loc & GetLoc(void) const
bool operator()(const CRef< CDbtag > &obj1, const CRef< CDbtag > &obj2)
bool Match(const CDbtag &dbt2) const
CSeqdesc::E_Choice GetType(void) const
const CSeqdesc & GetSeqDesc(void) const
static CRef< CSeq_feat > Apply(const CSeq_feat &feat, const CRange< TSeqPos > &range)
CSeq_feat_Handle GetSeqFeatHandle(void) const
const CMappedFeat GetMappedFeat(void) const
CConstRef< CSeq_loc > GetMappedLocation(void) const
const CMappedFeat & GetFeat(void) const
const CSeq_loc & GetLoc(void) const
bool IsPolicyInternal(void) const
bool IsStyleSegment(void) const
bool CopyGeneToCDNA(void) const
bool HideRemoteImpFeatures(void) const
bool HideGapFeatures(void) const
bool HideImpFeatures(void) const
bool DisableReferenceCache(void) const
bool ShowCDDFeatures(void) const
bool IsPolicyFtp(void) const
bool UseSeqEntryIndexer(void) const
bool ShowContigFeatures(void) const
bool HideEmptySource(void) const
bool ShowContigSources(void) const
bool ForGBRelease(void) const
bool IsPolicyGenomes(void) const
bool LatestGeneRIFs(void) const
bool IsFormatFTable(void) const
bool OnlyGeneRIFs(void) const
bool HideCDSProdFeatures(void) const
bool HideSNPFeatures(void) const
bool HideMiscFeatures(void) const
bool HideCDDFeatures(void) const
bool ShowFtablePeptides(void) const
bool IsModeRelease(void) const
bool IsModeDump(void) const
bool DisableAnnotRefs(void) const
bool HideExonFeatures(void) const
bool IsShownGenbankBlock(FGenbankBlocks fTGenbankBlocksMask) const
bool IsStyleNormal(void) const
bool IsStyleContig(void) const
bool HideGeneRIFs(void) const
bool HideIntronFeatures(void) const
const CRef< CSeqEntryIndex > GetSeqEntryIndex(void) const
bool UsingSeqEntryIndex(void) const
const CSeq_loc * GetLocation(void) const
void AddSection(TSection §ion)
void x_WGSComment(CBioseqContext &ctx) const
void x_RegionComments(CBioseqContext &ctx) const
virtual void Gather(CFlatFileContext &ctx, CFlatItemOStream &os, bool doNuc=true, bool doProt=true) const
void x_GatherFeatures(void) const
void x_GatherFeaturesOnWholeLocationIdx(const CSeq_loc &loc, SAnnotSelector &sel, CBioseqContext &ctx) const
void x_TSAComment(CBioseqContext &ctx) const
void x_GBBSourceComment(CBioseqContext &ctx) const
void x_FlushComments(void) const
void x_GatherComments(void) const
CRef< CFlatItemOStream > m_ItemOS
void x_NameComments(CBioseqContext &ctx) const
CRef< CBioseqContext > m_Current
virtual void x_GatherFeaturesOnLocation(const CSeq_loc &loc, SAnnotSelector &sel, CBioseqContext &ctx) const
void x_FeatComments(CBioseqContext &ctx) const
const ICanceled * m_pCanceledCallback
void x_GatherReferences(void) const
void x_MaplocComments(CBioseqContext &ctx) const
void x_GetFeatsOnCdsProductIdx(const CSeq_feat &feat, CBioseqContext &ctx, CRef< CSeq_loc_Mapper > slice_mapper, CConstRef< CFeatureItem > cdsFeatureItem=CConstRef< CFeatureItem >()) const
CBioseqContext::TReferences TReferences
void x_GatherSourceFeatures(void) const
void x_RefSeqGenomeComments(CBioseqContext &ctx) const
virtual CFeatureItem * x_NewFeatureItem(const CMappedFeat &feat, CBioseqContext &ctx, const CSeq_loc *loc, CRef< feature::CFeatTree > ftree, CFeatureItem::EMapped mapped=CFeatureItem::eMapped_not_mapped, bool suppressAccession=false, CConstRef< CFeatureItem > parentFeatureItem=CConstRef< CFeatureItem >()) const
void x_IdComments(CBioseqContext &ctx, EGenomeAnnotComment eGenomeAnnotComment) const
bool x_BiosourcesEqualForMergingPurposes(const CSourceFeatureItem &src1, const CSourceFeatureItem &src2) const
@ eGenomeAnnotComment_Yes
void x_GatherFeaturesOnRangeIdx(const CSeq_loc &loc, SAnnotSelector &sel, CBioseqContext &ctx) const
void x_RemoveExcessNewlines(void) const
void x_GatherSequence(void) const
vector< string > & RefCache(void) const
void x_GatherCDSReferences(TReferences &refs) const
CConstRef< CUser_object > m_FirstGenAnnotSCAD
virtual void x_GatherSeqEntry(CFlatFileContext &ctx, CRef< CTopLevelSeqEntryContext > topLevelSeqEntryContext=CRef< CTopLevelSeqEntryContext >(), bool doNuc=true, bool doProt=true) const
void x_HistoryComments(CBioseqContext &ctx) const
deque< TSFItem > TSourceFeatSet
void x_MergeEqualBioSources(TSourceFeatSet &srcs) const
void x_CollectSourceDescriptors(const CBioseq_Handle &bh, CBioseqContext &ctx, TSourceFeatSet &srcs) const
void x_AddGSDBComment(const CDbtag &dbtag, CBioseqContext &ctx) const
void x_UnorderedComments(CBioseqContext &ctx) const
void x_TLSComment(CBioseqContext &ctx) const
CRef< feature::CFeatTree > m_Feat_Tree
CRef< CFlatFileContext > m_Context
vector< string > m_RefCache
CSeq_entry_Handle m_TopSEH
void x_RefSeqComments(CBioseqContext &ctx, EGenomeAnnotComment eGenomeAnnotComment) const
void x_UnverifiedComment(CBioseqContext &ctx) const
virtual void x_GatherBioseq(const CBioseq_Handle &prev_seq, const CBioseq_Handle &this_seq, const CBioseq_Handle &next_seq, CRef< CTopLevelSeqEntryContext > topLevelSeqEntryContext=CRef< CTopLevelSeqEntryContext >()) const
void x_DescComments(CBioseqContext &ctx) const
void x_BasemodComment(CBioseqContext &ctx) const
virtual void x_DoMultipleSections(const CBioseq_Handle &seq) const
static void x_GiveOneResidueIntervalsBogusFuzz(CSeq_loc &loc)
void x_StructuredComments(CBioseqContext &ctx) const
vector< CRef< CCommentItem > > TCommentVec
CConstRef< CUser_object > x_GetAnnotDescStrucCommentFromBioseqHandle(CBioseq_Handle bsh) const
static void x_RemoveBogusFuzzFromIntervals(CSeq_loc &loc)
void x_HTGSComments(CBioseqContext &ctx) const
static CFlatGatherer * New(CFlatFileConfig::TFormat format)
virtual void x_DoSingleSection(CBioseqContext &ctx) const =0
void x_AddComment(CCommentItem *comment) const
void x_GetFeatsOnCdsProduct(const CSeq_feat &feat, CBioseqContext &ctx, CRef< CSeq_loc_Mapper > slice_mapper, CConstRef< CFeatureItem > cdsFeatureItem=CConstRef< CFeatureItem >()) const
virtual ~CFlatGatherer(void)
void x_CollectBioSourcesOnBioseq(const CBioseq_Handle &bh, const TRange &range, CBioseqContext &ctx, TSourceFeatSet &srcs) const
const CFlatFileConfig & Config(void) const
void x_CollectBioSources(TSourceFeatSet &srcs) const
void x_GatherFeaturesIdx(void) const
void x_CollectSourceFeatures(const CBioseq_Handle &bh, const TRange &range, CBioseqContext &ctx, TSourceFeatSet &srcs) const
void x_AnnotComments(CBioseqContext &ctx) const
void x_AuthorizedAccessComment(CBioseqContext &ctx) const
void x_CopyCDSFromCDNA(const CSeq_feat &feat, CBioseqContext &ctx) const
void x_GatherFeaturesOnRange(const CSeq_loc &loc, SAnnotSelector &sel, CBioseqContext &ctx) const
void x_SubtractFromFocus(TSourceFeatSet &srcs) const
void x_GatherSourceOrganism(void) const
void x_GatherFeaturesOnWholeLocation(const CSeq_loc &loc, SAnnotSelector &sel, CBioseqContext &ctx) const
void x_RemoveDupComments(void) const
void x_UnreviewedComment(CBioseqContext &ctx) const
CConstRef< CUser_object > x_PrepareAnnotDescStrucComment(CBioseqContext &ctx) const
void x_GatherAlignments(void) const
void x_GatherReferencesIdx(const CSeq_loc &loc, TReferences &refs) const
void x_MapComment(CBioseqContext &ctx) const
CBioseqContext * GetContext(void)
bool operator()(const CRef< COrgMod > &obj1, const CRef< COrgMod > &obj2)
@Pubdesc.hpp User-defined methods of the data storage class.
static void Rearrange(TReferences &refs, CBioseqContext &ctx)
bool DistributedReferences(void)
CRef< CBioseqIndex > GetBioseqIndex(void)
@ eSubtype_transit_peptide_aa
@ eSubtype_non_std_residue
@ eSubtype_sig_peptide_aa
@ eSubtype_mat_peptide_aa
namespace ncbi::objects::
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Base class for all serializable objects.
const CBioSource & GetSource(void) const
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
bool operator()(const CRef< CSubSource > &obj1, const CRef< CSubSource > &obj2)
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
string Tag(const string &name, int value)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const TPair sc_Pairs[]
SStaticPair< const char *, const char * > TPair
std::ofstream out("events_result.xml")
main entry point for tests
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
static void s_GiveOneResidueIntervalsBogusFuzz_Helper(CSeq_interval &interval)
static bool s_LocationsOverlap(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *p_scope)
bool s_FilterPubdesc(const CPubdesc &pubdesc, CBioseqContext &ctx)
static bool s_CopyCDSFromCDNA(CBioseqContext &ctx)
static bool s_SeqLocEndsOnBioseq(const CSeq_loc &loc, CBioseqContext &ctx, EEndsOnBioseqOpt mode, CSeqFeatData::E_Choice feat_type)
static string s_GetFeatDesc(const CSeq_feat_Handle &feat)
CRef< CSeq_loc_Mapper > s_MakeSliceMapper(const CSeq_loc &loc, CBioseqContext &ctx)
static bool s_GiInCSeq_hist_ids(const TGi gi, const CSeq_hist_rec_Base::TIds &ids)
static CRef< CGapItem > s_NewGapItem(CSeqMap_CI &gap_it, CBioseqContext &ctx)
static bool s_IsCDD(const CSeq_feat_Handle &feat)
@ eEndsOnBioseqOpt_AnyPartOfSeqLoc
@ eEndsOnBioseqOpt_LastPartOfSeqLoc
CSeqMap_CI s_CreateGapMapIter(const CSeq_loc &loc, CBioseqContext &ctx)
static bool s_HasSegments(const CBioseq_Handle &seq)
static CMappedFeat s_GetTrimmedMappedFeat(const CSeq_feat &feat, const CRange< TSeqPos > &range, CScope &scope)
static void s_CleanCDDFeature(const CSeq_feat &feat)
static void s_RemoveBogusFuzzFromIntervals_Helper(CSeq_interval &interval)
bool s_HasRefTrackStatus(const CBioseq_Handle &bsh)
static CConstRef< CSeq_loc > s_NormalizeNullsBetween(CConstRef< CSeq_loc > loc, bool force_adding_nulls=false)
static int s_StrucCommOrder(const string &str)
static bool s_NsAreGaps(const CBioseq_Handle &seq, CBioseqContext &ctx)
void s_FixIntervalProtToCds(const CSeq_feat &srcFeat, const CSeq_loc &srcLoc, CRef< CSeq_loc > pDestLoc)
static bool s_LocationsTouch(const CSeq_loc &loc1, const CSeq_loc &loc2)
static void s_SetGapIdxData(SGapIdxData &gapdat, const vector< CRef< CGapIndex >> &gaps)
static bool s_SeqDescCompare(const CConstRef< CSeqdesc > &desc1, const CConstRef< CSeqdesc > &desc2)
static bool s_IsSegmented(const CBioseq_Handle &seq)
static bool s_IsCircularTopology(CBioseqContext &ctx)
static CMappedFeat s_GetMappedFeat(CRef< CSeq_feat > &feat, CScope &scope)
static bool s_ContainsGaps(const CSeq_loc &loc)
bool s_CoincidingGapFeatures(CFeat_CI it, const TSeqPos gap_start, const TSeqPos gap_end)
bool s_IsJustUids(const CPubdesc &pubdesc)
bool s_BioSeqHasContig(const CBioseq_Handle &seq, CFlatFileContext &ctx)
static bool s_IsDuplicateFeatures(const CSeq_feat_Handle &f1, const CSeq_feat_Handle &f2)
SAnnotSelector s_GetCdsProductSel(CBioseqContext &ctx)
void s_SetSelection(SAnnotSelector &sel, CBioseqContext &ctx)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERASE_ITERATE(Type, Var, Cont)
Non-constant version with ability to erase current element, if container permits.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT EUrlEncode encode
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
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.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
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.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string GetLabel(const CSeq_id &id)
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
void SetPacked_int(TPacked_int &v)
ENa_strand GetStrand(void) const
Get the location's strand.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
TRange GetTotalRange(void) const
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
CConstRef< CSeq_loc > GetRangeAsSeq_loc(void) const
Get seq-loc for the current iterator position.
CRef< CSeq_loc > Merge(TOpFlags flags, ISynonymMapper *syn_mapper) const
All functions create and return a new seq-loc object.
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.
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.
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
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...
void SetPartialStop(bool val, ESeqLocExtremes ext)
void SetNull(void)
Override all setters to incorporate cache invalidation.
TSeqPos GetStop(ESeqLocExtremes ext) const
@ eOrder_Biological
Iterate sub-locations in positional order.
@ eEmpty_Allow
ignore empty locations
CMappedFeat GetBestGeneForMrna(const CMappedFeat &mrna_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
TSeqPos GetStop(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the stop of the location.
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...
TSeqPos GetStart(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the start of the location.
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
CSeq_id_Handle GetIdHandle(const CSeq_loc &loc, CScope *scope)
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
CRef< CSeq_loc > Seq_loc_Add(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Add two seq-locs.
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.
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eOverlap_SubsetRev
1st is a subset of 2nd ranges
@ eOverlap_Simple
any overlap of extremes
@ eContains
First CSeq_loc contains second.
@ eSame
CSeq_locs contain each other.
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
CBioseq_Handle GetBioseqFromSeqLoc(const CSeq_loc &loc, CScope &scope, CScope::EGetBioseqFlag flag=CScope::eGetBioseq_Loaded)
Retrieve the Bioseq Handle from a location.
CConstRef< CSeq_feat > GetSourceFeatForProduct(const CBioseq_Handle &bsh)
vector< string > gap_linkage_evidences
A vector representing the linkage-evidences of the gap.
string gap_type
String representing the gap type.
CMappedFeat GetMappedmRNAForProduct(const CBioseq_Handle &product)
static void GetGapModText(const CSeq_gap &seq_gap, SGapModText &out_gap_mod_text)
Given a CSeq_gap object, this outputs the Gap information.
CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id &id, const CTSE_Handle &tse)
Get bioseq handle for sequence withing one TSE.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
CSeq_loc_Mapper_Base & TruncateNonmappingRanges(void)
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
void RemoveBioseq(const CBioseq_Handle &seq)
Revoke Bioseq previously added using AddBioseq().
TCDD_Entries GetCDDAnnots(const TIds &idhs)
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TBioseqHandles GetBioseqHandles(const TIds &ids)
Get bioseq handles for all ids.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
vector< CBioseq_Handle > TBioseqHandles
CSeq_annot_Handle AddSeq_annot(CSeq_annot &annot, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add Seq-annot, return its CSeq_annot_Handle.
vector< CTSE_Handle > TCDD_Entries
Get CDD annotations for all ids.
vector< CSeq_id_Handle > TIds
void SetFuzzOption(TFuzzOption newOption)
@ fFuzzOption_RemoveLimTlOrTr
@ eProductToLocation
Map from the feature's product to location.
@ eLocationToProduct
Map from the feature's location to product.
vector< CSeq_id_Handle > TId
bool IsSetComment(void) const
const CTSE_Handle & GetTSE_Handle(void) const
Get CTSE_Handle of containing TSE.
const TInst_Hist & GetInst_Hist(void) const
TClass GetClass(void) const
const TInst_Ext & GetInst_Ext(void) const
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
bool CanGetClass(void) const
CConstRef< CSeq_id > GetInitialSeqIdOrNull(void) const
Get id used to obtain this bioseq handle.
bool IsSetInst_Hist(void) const
bool IsSetInst_Ext(void) const
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
const CSeqFeatData & GetData(void) const
TSeqPos GetBioseqLength(void) const
bool IsSetProduct(void) const
virtual const CSeq_loc & GetLocation(void) const
TInst_Topology GetInst_Topology(void) const
const string & GetComment(void) const
const CSeq_annot::TDesc & Seq_annot_GetDesc(void) const
bool Seq_annot_CanGetDesc(void) const
bool IsSetInst(void) const
bool IsSetInst_Repr(void) const
bool IsTableSNP(void) const
Check if this is SNP table feature.
bool CanGetInst_Topology(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
TInst_Repr GetInst_Repr(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
bool CanGetId(void) const
CSeq_entry_Handle GetExactComplexityLevel(CBioseq_set::EClass cls) const
Return level with exact complexity, or empty handle if not found.
CSeqFeatData::ESubtype GetFeatSubtype(void) const
const CSeqMap & GetSeqMap(void) const
Get sequence map.
const string & GetName(void) const
bool IsPlainFeat(void) const
Check if this is plain feature.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
const TId & GetId(void) const
CConstRef< CBioseq_set > GetBioseq_setCore(void) const
Return core data for the bioseq-set.
bool Seq_annot_IsSetDesc(void) const
bool IsSynonym(const CSeq_id &id) const
Check if this id can be used to obtain this bioseq handle.
const TInst & GetInst(void) const
TSeqPos GetEndPosition(void) const
return end position of current segment in sequence (exclusive)
SSeqMapSelector & SetResolveCount(size_t res_cnt)
Set max depth of resolving seq-map.
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)
SAnnotSelector & ExcludeFeatSubtype(TFeatSubtype subtype)
Exclude feature subtype from the search.
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
SAnnotSelector & ExcludeFeatType(TFeatType type)
Exclude feature type from the search.
SAnnotSelector & SetResolveMethod(EResolveMethod resolve_method)
SetResolveMethod() controls visibility of subsegments depending on whether it's packaged together wit...
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 & ExcludeTSE(const CTSE_Handle &tse)
const CSeq_data & GetData(void) const
will allow only regular data segments (whole, plus strand)
SSeqMapSelector & SetFlags(TFlags flags)
Select segment type(s)
SAnnotSelector & SetOverlapType(EOverlapType overlap_type)
Set overlap type.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
SAnnotSelector & SetLimitNone(void)
Remove restrictions on the parent object of annotations.
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
SAnnotSelector & SetNoMapping(bool value=true)
SAnnotSelector & SetResolveDepth(int depth)
SetResolveDepth sets the limit of subsegment resolution in searching annotations.
SAnnotSelector & SetFeatComparator(IFeatComparator *comparator)
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
const CSeq_loc & GetProduct(void) const
bool IsSetData(void) const
SSeqMapSelector & SetLimitTSE(const CSeq_entry_Handle &tse)
Limit TSE to resolve references.
CSeq_id_Handle GetRefSeqid(void) const
The following function makes sense only when the segment is a reference to another seq.
bool IsUnknownLength(void) const
return true if current segment is a gap of unknown length
SAnnotSelector & SetOverlapIntervals(void)
Check overlapping of individual intervals.
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 & SetLimitTSE(const CTSE_Handle &limit)
Limit annotations to those from the TSE only.
SAnnotSelector & SetIgnoreStrand(bool value=true)
Ignore strand when testing for range overlap.
SAnnotSelector & SetSortOrder(ESortOrder sort_order)
Set sort order of annotations.
TSeqPos GetPosition(void) const
return position of current segment in sequence
TSeqPos GetLength(void) const
return length of current segment
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
@ eSortOrder_Reverse
decresing end, decreasing length
@ eSortOrder_Normal
default - increasing start, decreasing length
@ eOverlap_Intervals
default - overlapping of individual intervals
@ eResolve_TSE
default - search only on segments in the same TSE
CSeqMap_CI BeginResolved(CScope *scope) const
static CRef< CSeqMap > CreateSeqMapForSeq_loc(const CSeq_loc &loc, CScope *scope)
@ eSeqRef
reference to Bioseq
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
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().
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
TObjectType * GetNonNullPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null.
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
position_type GetToOpen(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
virtual bool IsCanceled(void) const =0
static string HtmlDecode(const CTempString str, EEncoding encoding=eEncoding_Unknown, THtmlDecode *result_flags=NULL)
Decode HTML entities and character references.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
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 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 bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
static int CompareCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive compare of a substring with another string.
@ eNocase
Case insensitive compare.
#define DEFINE_STATIC_MUTEX(id)
Define static mutex and initialize it.
const TKeywords & GetKeywords(void) const
Get the Keywords member data.
const TSource & GetSource(void) const
Get the Source member data.
bool CanGetSource(void) const
Check if it is safe to call GetSource method.
bool CanGetKeywords(void) const
Check if it is safe to call GetKeywords method.
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
bool CanGetOrg(void) const
Check if it is safe to call GetOrg method.
list< CRef< CSubSource > > TSubtype
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
const TOrg & GetOrg(void) const
Get the Org member data.
TSubtype GetSubtype(void) const
Get the Subtype member data.
bool CanGetName(void) const
Check if it is safe to call GetName method.
void SetOrg(TOrg &value)
Assign a value to Org data member.
bool CanGetSubtype(void) const
Check if it is safe to call GetSubtype method.
const TName & GetName(void) const
Get the Name member data.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsLim(void) const
Check if variant Lim is selected.
const TData & GetData(void) const
Get the Data member data.
TLim GetLim(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant 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.
@ eLim_circle
artificial break at origin of circle
const TMod & GetMod(void) const
Get the Mod member data.
bool CanGetMod(void) const
Check if it is safe to call GetMod method.
vector< CRef< CDbtag > > TDb
const TDb & GetDb(void) const
Get the Db member data.
list< CRef< COrgMod > > TMod
bool CanGetOrgname(void) const
Check if it is safe to call GetOrgname method.
bool CanGetDb(void) const
Check if it is safe to call GetDb method.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
list< CRef< CPub > > Tdata
const Tdata & Get(void) const
Get the member data.
@ e_Gen
general or generic unparsed
@ e_Proc
proceedings of a meeting
@ e_Man
manuscript, thesis, or letter
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
const TPub & GetPub(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
const TRegion & GetRegion(void) const
Get the variant data.
const TLocation & GetLocation(void) const
Get the Location member data.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
bool IsPub(void) const
Check if variant Pub is selected.
const TCdregion & GetCdregion(void) const
Get the variant data.
const TProduct & GetProduct(void) const
Get the Product member data.
const TComment & GetComment(void) const
Get the Comment member data.
bool CanGetFrame(void) const
Check if it is safe to call GetFrame method.
TSite GetSite(void) const
Get the variant data.
void ResetLocation(void)
Reset Location data member.
bool IsSite(void) const
Check if variant Site is selected.
bool IsRna(void) const
Check if variant Rna is selected.
bool IsRegion(void) const
Check if variant Region is selected.
@ e_Het
cofactor, prosthetic grp, etc, bound to seq
@ e_Region
named region (globin locus)
@ e_Pub
publication applies to this seq
@ e_Comment
just a comment
@ eFrame_not_set
not set, code uses one
bool IsSet(void) const
Check if a value has been assigned to data member.
void SetTo(TTo value)
Assign a value to To data member.
const TFuzz_from & GetFuzz_from(void) const
Get the Fuzz_from member data.
void ResetFuzz_to(void)
Reset Fuzz_to data member.
bool IsMix(void) const
Check if variant Mix is selected.
bool CanGetFuzz_to(void) const
Check if it is safe to call GetFuzz_to method.
list< CRef< CSeq_interval > > Tdata
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
const TId & GetId(void) const
Get the Id member data.
const TFuzz_to & GetFuzz_to(void) const
Get the Fuzz_to member data.
TFrom GetFrom(void) const
Get the From member data.
list< CRef< CSeq_loc > > Tdata
E_Choice Which(void) const
Which variant is currently selected.
E_Choice Which(void) const
Which variant is currently selected.
bool IsSet(void) const
Check if a value has been assigned to data member.
void SetFrom(TFrom value)
Assign a value to From data member.
const Tdata & Get(void) const
Get the member data.
void ResetFuzz_from(void)
Reset Fuzz_from data member.
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.
bool IsSetTo(void) const
Check if a value has been assigned to To data member.
bool IsSetFuzz_to(void) const
Check if a value has been assigned to Fuzz_to data member.
TStrand GetStrand(void) const
Get the Strand member data.
TTo GetTo(void) const
Get the To member data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsNull(void) const
Check if variant Null is selected.
bool IsSetFuzz_from(void) const
Check if a value has been assigned to Fuzz_from data member.
void SetStrand(TStrand value)
Assign a value to Strand data member.
const TMix & GetMix(void) const
Get the variant data.
bool IsPnt(void) const
Check if variant Pnt is selected.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
const TAccession & GetAccession(void) const
Get the Accession member data.
bool CanGetFuzz_from(void) const
Check if it is safe to call GetFuzz_from method.
@ e_Gibbmt
Geninfo backbone moltype.
@ e_Giim
Geninfo import id.
@ e_Other
for historical reasons, 'other' = 'refseq'
@ e_Gpipe
Internal NCBI genome pipeline processing ID.
@ e_Tpe
Third Party Annot/Seq EMBL.
@ e_Tpd
Third Party Annot/Seq DDBJ.
@ e_Gibbsq
Geninfo backbone seqid.
@ e_General
for other databases
@ e_Gi
GenInfo Integrated Database.
@ e_not_set
No variant selected.
@ e_Tpg
Third Party Annot/Seq Genbank.
@ e_not_set
No variant selected.
bool CanGetSeq_set(void) const
Check if it is safe to call GetSeq_set method.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
@ eClass_parts
parts for 2 or 3
@ eClass_segset
segmented sequence + parts
void SetData(TData &value)
Assign a value to Data data member.
const Tdata & Get(void) const
Get the member data.
const TUser & GetUser(void) const
Get the variant data.
ERepr
representation class
TPub & SetPub(void)
Select the variant.
const TGap & GetGap(void) const
Get the variant data.
const TComment & GetComment(void) const
Get the Comment member data.
const TSource & GetSource(void) const
Get the variant data.
const TLiteral & GetLiteral(void) const
Get the variant data.
TTech GetTech(void) const
Get the Tech member data.
bool CanGetReplaced_by(void) const
Check if it is safe to call GetReplaced_by method.
bool IsSetReplaces(void) const
seq makes these seqs obsolete Check if a value has been assigned to Replaces data member.
TLength GetLength(void) const
Get the Length member data.
list< CRef< CSeq_id > > TId
const TGenbank & GetGenbank(void) const
Get the variant data.
bool IsComment(void) const
Check if variant Comment is selected.
list< CRef< CSeq_id > > TIds
bool CanGetLength(void) const
Check if it is safe to call GetLength method.
bool IsDelta(void) const
Check if variant Delta is selected.
bool IsSet(void) const
Check if a value has been assigned to data member.
TSource & SetSource(void)
Select the variant.
bool IsPub(void) const
Check if variant Pub is selected.
const TDelta & GetDelta(void) const
Get the variant data.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
TCompleteness GetCompleteness(void) const
Get the Completeness member data.
bool CanGetSeq_data(void) const
Check if it is safe to call GetSeq_data method.
const Tdata & Get(void) const
Get the member data.
E_Choice Which(void) const
Which variant is currently selected.
bool IsLiteral(void) const
Check if variant Literal is selected.
list< CRef< CDelta_seq > > Tdata
const TReplaces & GetReplaces(void) const
Get the Replaces member data.
bool IsGap(void) const
Check if variant Gap is selected.
const TComment & GetComment(void) const
Get the variant data.
const TPub & GetPub(void) const
Get the Pub member data.
const TReplaced_by & GetReplaced_by(void) const
Get the Replaced_by member data.
list< CRef< CAnnotdesc > > Tdata
bool IsUser(void) const
Check if variant User is selected.
@ eRepr_seg
segmented sequence
@ eRepr_delta
sequence made by changes (delta) to others
@ eRepr_raw
continuous sequence
@ eRepr_virtual
no seq data
@ eTech_htgs_2
ordered High Throughput sequence contig
@ eTech_targeted
targeted locus sets/studies
@ eTech_htgs_1
unordered High Throughput sequence contig
@ eTech_tsa
transcriptome shotgun assembly
@ eTech_wgs
whole genome shotgun sequencing
@ eTech_htgs_0
single genomic reads for coordination
@ eBiomol_transcribed_RNA
transcribed RNA other than existing classes
@ e_User
user defined object
@ e_Pub
a reference to the publication
@ e_Genbank
GenBank specific info.
@ e_Comment
a more extensive comment
@ e_Region
overall region (globin locus)
@ e_Molinfo
info on the molecule and techniques
@ e_Maploc
map location of this sequence
@ e_Pdb
PDB specific information.
@ e_Name
a name for this sequence
@ e_Source
source of materials, includes Org-ref
bm::gap_word_t gap_length(const bm::gap_word_t *buf) noexcept
Returs GAP block length.
unsigned int
A callback function used to compare two keys in a database.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
static bool Equals(const CVariation::TPlacements &p1, const CVariation::TPlacements &p2)
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
void AddPeriod(string &str)
const string & GetTechString(int tech)
EResolveOrder GetResolveOrder(CScope &scope, const CSeq_id_Handle &mrna, const CSeq_id_Handle &prot, CBioseq_Handle &mrna_bsh, CBioseq_Handle &prot_bsh)
bool GetModelEvidance(const CBioseq_Handle &bsh, SModelEvidance &me)
#define FOR_EACH_COMPOUND_ON_PDBBLOCK(Itr, Var)
FOR_EACH_COMPOUND_ON_PDBBLOCK EDIT_EACH_COMPOUND_ON_PDBBLOCK.
#define FIELD_IS_SET_AND_IS(Var, Fld, Chs)
FIELD_IS_SET_AND_IS base macro.
#define RAW_FIELD_IS_EMPTY_OR_UNSET(Var, Fld)
RAW_FIELD_IS_EMPTY_OR_UNSET macro.
#define STRING_FIELD_MATCH(Var, Fld, Str)
STRING_FIELD_MATCH base macro.
#define FIELD_CHOICE_EQUALS(Var, Fld, Chs, Value)
FIELD_CHOICE_EQUALS base macro.
#define STRING_FIELD_CHOICE_MATCH(Var, Fld, Chs, Value)
STRING_FIELD_CHOICE_MATCH base macro.
#define DEFINE_STATIC_ARRAY_MAP(Type, Var, Array)
This indicates the text of the modifiers of a gap.
vector< string > gap_evidence
Selector used in CSeqMap methods returning iterators.
bool operator()(const CRef< CSourceFeatureItem > &sfp1, const CRef< CSourceFeatureItem > &sfp2)
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...