&
>(c);
118 if( it->first == 0 ) {
141m_TotalType.insert(
type);
142m_TotalLocation.
Add(loc);
145TTypeSet m_TotalType;
146TTotalLocation m_TotalLocation;
150 structSSplitAnnotInfo
152 typedefvector<SAnnotTypeSelector> TTypeSet;
160 structSAllAnnotTypes
162 typedefvector<SAnnotTypeSelector> TTypeSet;
168SAllAnnotTypes(
void)
175 switch(
t.GetAnnotType() ) {
183m_FeatTypes[
t.GetFeatType()].insert(
t.GetFeatSubtype());
189 _ASSERT(
"bad annot type"&& 0);
192 voidAdd(
constTTypeSet&
types)
201 ITERATE( TFeatTypes, tit, m_FeatTypes ) {
202TFeatType
t= tit->first;
203 constTSubtypes& subtypes = tit->second;
207 if( !all_subtypes ) {
208all_subtypes =
true;
211 st= TSubtype(
st+1) ) {
213subtypes.find(
st) == subtypes.end() ) {
214all_subtypes =
false;
221type_info->SetType(
t);
222 if( !all_subtypes ) {
223 ITERATE( TSubtypes, stit, subtypes ) {
224type_info->SetSubtypes().push_back(*stit);
227dst.push_back(type_info);
233TFeatTypes m_FeatTypes;
240 typedefvector<SAnnotTypeSelector> TTypeSet;
260 _ASSERT(
"bad annot type"&& 0);
303 if(
table.IsSetFeat_subtype() ) {
319m_AllAnnots[it->first].Add(sel, it->second);
323 voidSplitInfo(
void)
325 ITERATE( TAllAnnots, it, m_AllAnnots ) {
328it->second.m_TotalType) {
329type_set.push_back(*tit);
331m_SplitAnnots[type_set].Add(it->first,
332it->second.m_TotalLocation);
336TAllAnnots m_AllAnnots;
337TSplitAnnots m_SplitAnnots;
344 typedef intTFeatIdInt;
345 typedef stringTFeatIdStr;
350 typedefvector<SAnnotTypeSelector> TTypeSet;
351 typedefpair<TTypeSet, TTypeSet> TTypeSets;
353 typedefvector<TFeatIdInt> TFeatIdsInt;
355 typedefvector<TFeatIdStr> TFeatIdsStr;
365TTypeSets&
types= m_AllIdsInt[
id.GetId()];
366(id_type == eFeatId?
types.first:
types.second)
367.push_back(feat_type);
370TTypeSets&
types= m_AllIdsStr[
id.GetStr()];
371(id_type == eFeatId?
types.first:
types.second)
372.push_back(feat_type);
387Add(
type, **id_it, eFeatId);
392 if( (*xref_it)->IsSetId() )
393Add(
type, (*xref_it)->GetId(), eXrefId);
399 static voidclean(TTypeSet&
types)
404 static voidclean(TFeatIdsInt& ids)
406 sort(ids.begin(), ids.end());
407ids.erase(unique(ids.begin(), ids.end()), ids.end());
409 static voidclean(TFeatIdsStr& ids)
411 sort(ids.begin(), ids.end());
412ids.erase(unique(ids.begin(), ids.end()), ids.end());
415 voidSplitInfo(
void)
418clean(it->second.first);
419clean(it->second.second);
420m_SplitIds[it->second].first.push_back(it->first);
423clean(it->second.first);
424clean(it->second.second);
425m_SplitIds[it->second].second.push_back(it->first);
428clean(it->second.first);
429clean(it->second.second);
433TAllIdsInt m_AllIdsInt;
434TAllIdsStr m_AllIdsStr;
435TSplitIds m_SplitIds;
442 template<
classFunc>
443 voidForEachGiRange(
constTGiSet& gis, Func func)
448 if( gi_count == 0 || *it != gi_start +
GI_FROM(
int, gi_count) ) {
449 if( gi_count > 0 ) {
450func(gi_start, gi_count);
457 if( gi_count > 0 ) {
458func(gi_start, gi_count);
469 voidSetRange(
C& obj,
const TRange& range)
471obj.SetStart(range.
GetFrom());
477 constTRangeSet& range_set)
479 ITERATE( TRangeSet, it, range_set ) {
488 constTRangeSet& range_set)
492 TGigi =
id.GetGi();
493 if( range_set.size() == 1 ) {
495interval.
SetGi(gi);
496SetRange(interval, *range_set.begin());
500seq_ints.
SetGi(gi);
501AddIntervals(seq_ints.
SetInts(), range_set);
505 if( range_set.size() == 1 ) {
508SetRange(interval, *range_set.begin());
513AddIntervals(seq_ints.
SetInts(), range_set);
524loc->SetWhole_gi(
id.GetGi());
550 structFAddGiRangeToSeq_loc
557 enum{ SEPARATE = 3 };
559 voidoperator()(
TGistart,
int count)
const 562 if(
count<= SEPARATE ) {
580 structFAddGiRangeToBioseqIds
587 enum{ SEPARATE = 2 };
589 voidoperator()(
TGistart,
int count)
const 592 if(
count<= SEPARATE ) {
598m_Ids.Set().push_back(elem);
604elem->SetGi_range().SetStart(start);
605elem->SetGi_range().SetCount(
count);
606m_Ids.Set().push_back(elem);
615ForEachGiRange(whole_gi_set, FAddGiRangeToSeq_loc(loc));
629 ITERATE( TIntervalSet, it, interval_set ) {
654gi_set.insert(it->GetGi());
657id_set.insert(it->GetSeqId());
661ForEachGiRange(gi_set, FAddGiRangeToBioseqIds(ret));
662 ITERATE( TLessIdSet, it, id_set ) {
664elem->SetSeq_id(
const_cast<CSeq_id&
>(**it));
665ret.
Set().push_back(elem);
673ret.
Set().push_back(*it);
680 typedefpair<TBioseqs, TBioseq_sets> TPlaces;
682 voidAddPlace(TPlaces& places,
const CPlaceId& place)
709 const TRange& range)
const 711 returnrange == range.
GetWhole() ||
721TIntervalSet interval_set;
724 TRangerange = it->second.GetTotalRange();
725 if(
IsWhole(it->first, range) ) {
726 if( it->first.IsGi() ) {
727whole_gi_set.insert(it->first.GetGi());
730whole_id_set.
insert(it->first);
738interval_set[it->first].insert(range);
742 AddLoc(loc, whole_gi_set);
743 AddLoc(loc, whole_id_set);
744 AddLoc(loc, interval_set);
754TIntervalSet interval_set;
759 if(
IsWhole(id_it->first, range) ) {
760 if( id_it->first.IsGi() ) {
761whole_gi_set.insert(id_it->first.GetGi());
764whole_id_set.
insert(id_it->first);
772interval_set[id_it->first].insert(range);
777 AddLoc(loc, whole_gi_set);
778 AddLoc(loc, whole_id_set);
779 AddLoc(loc, interval_set);
803interval.
SetGi(
id.GetGi());
804SetRange(interval, range);
809SetRange(interval, range);
827 SetLoc(*loc,
id, range);
846 data->SetId().SetSeq_id(
const_cast<CSeq_id&
>(*
id));
857AddBioseqIds(*ret, ids);
866AddBioseq_setIds(*ret, ids);
876 typedef unsignedTDescTypeMask;
879TDescPlaces all_descrs;
880TPlaces all_annot_places;
882TAllAnnots all_annots;
889TBioseqPlaces all_bioseqs;
890TPlaces all_assemblies;
893 const CPlaceId& place_id = it->first;
894TDescTypeMask desc_type_mask = 0;
900dst.
Set().push_back(*
i);
901desc_type_mask |= (1<<(**i).Which());
904AddPlace(all_descrs[desc_type_mask], place_id);
908 const CPlaceId& place_id = it->first;
909AddPlace(all_annot_places, place_id);
914dst.push_back(annot);
918all_annots[name].Add(*annot, *
this);
928 const CPlaceId& place_id = it->first;
939 if( !piece || start != p_end ) {
942 TRange(p_start, p_end-1),
944dst.push_back(piece);
947p_start = p_end = start;
948piece->SetStart(p_start);
953piece->SetData().push_back(
literal);
958 TRange(p_start, p_end-1),
960dst.push_back(piece);
965 const CPlaceId& place_id = it->first;
967TBioseqIds& ids = all_bioseqs[place_id];
971 const CBioseq& seq = *bit->m_Bioseq;
972dst.push_back(
Ref(
const_cast<CBioseq*
>(&seq)));
980 const CPlaceId& place_id = it->first;
989AddPlace(all_assemblies, place_id);
993nit->second.SplitInfo();
998 if( annot_name.
IsNamed() ) {
1001SAllAnnotTypes
types;
1002 types.Add(it->first);
1003 if(
types.m_Align ) {
1006 if(
types.m_Graph ) {
1009 if( !
types.m_FeatTypes.empty() ) {
1013chunk_content.push_back(content);
1017 #ifdef HAVE_FEAT_IDS 1019feat_ids.SplitInfo();
1022 ITERATE( SFeatIds::TSplitIds, it, feat_ids.m_SplitIds ) {
1024 if( !it->first.first.empty() ) {
1025SAllAnnotTypes
types;
1026 types.Add(it->first.first);
1027 types.SetFeatTypes(info_ids->SetFeat_types());
1029 if( !it->first.second.empty() ) {
1030SAllAnnotTypes
types;
1031 types.Add(it->first.second);
1032 types.SetFeatTypes(info_ids->SetXref_types());
1034 ITERATE( SFeatIds::TFeatIdsInt, fit, it->second.first ) {
1035info_ids->SetLocal_ids().push_back(*fit);
1037 ITERATE( SFeatIds::TFeatIdsStr, fit, it->second.second ) {
1038info_ids->SetLocal_str_ids().push_back(*fit);
1040store.push_back(info_ids);
1042chunk_content.push_back(content);
1046 if( !all_descrs.empty() ) {
1047 ITERATE( TDescPlaces, tmit, all_descrs ) {
1051 if( !tmit->second.first.empty() ) {
1054 if( !tmit->second.second.empty() ) {
1057chunk_content.push_back(content);
1061 if( !all_annot_places.first.empty() ||
1062!all_annot_places.second.empty() ) {
1065 if( !all_annot_places.first.empty() ) {
1068 if( !all_annot_places.second.empty() ) {
1071chunk_content.push_back(content);
1074 if( !all_data.
empty() ) {
1076 SetLoc(content->SetSeq_data(), all_data);
1077chunk_content.push_back(content);
1080 if( !all_bioseqs.empty() ) {
1083 ITERATE( TBioseqPlaces, it, all_bioseqs ) {
1085place->SetBioseq_set(it->first.GetBioseq_setId());
1087places.push_back(place);
1089chunk_content.push_back(content);
1092 if( !all_assemblies.first.empty() ) {
1096chunk_content.push_back(content);
1102dst_chunk_data.push_back(it->second);
1110dst_chunk_content.push_back(*it);
1124 if( seq_it->second.m_Bioseq ) {
1125dst = &seq_it->second.m_Bioseq->SetDescr();
1128dst = &seq_it->second.m_Bioseq_set->SetDescr();
1130dst->
Set().insert(dst->
Set().end(),
1131src.
Get().begin(), src.
Get().end());
1141 if( seq_it->second.m_Bioseq ) {
1142seq_it->second.m_Bioseq->SetAnnot().push_back(annot);
1145seq_it->second.m_Bioseq_set->SetAnnot().push_back(annot);
1153 _ASSERT(seq_it->second.m_Bioseq);
1154 CSeq_inst& inst = seq_it->second.m_Bioseq->SetInst();
1178 TRangerange = j->GetRange();
1185TLiterals::iterator iter = literals.find(range.
GetFrom());
1186 _ASSERT(iter != literals.end());
1197 _ASSERT( seq_it->second.m_Bioseq );
1201dst = &seq_it->second.m_Bioseq->SetInst().SetHist().SetAssembly();
1202dst->insert(dst->end(), src.begin(), src.end());
1232annot->
SetData().SetFtable()
1258 _ASSERT(
"bad annot type"&& 0);
User-defined methods of the data storage class.
static void AddLoc(CRef< CSeq_loc > &loc, CRef< CSeq_loc > loc2)
User-defined methods of the data storage class.
set< CRef< CSeq_id >, PPtrLess< CRef< CSeq_id > >> TIdSet
CLocalRange< TOffset > TRange
define for the fundamental building block of sequence ranges
const string & GetName(void) const
CID2S_Chunk_Data & GetChunkData(TChunkData &chunk_data, const CPlaceId &place_id)
void AttachToSkeleton(const SChunkInfo &info)
CRef< CMasterSeqSegments > m_Master
static size_t CountAnnotObjects(const CSeq_annot &annot)
vector< CAnnotObject_SplitInfo > TAnnotObjects
CRef< CSeq_annot > MakeSeq_annot(const CSeq_annot &src, const TAnnotObjects &objs)
void SetLoc(CID2S_Seq_loc &loc, const CHandleRangeMap &ranges) const
CBlobSplitterImpl(const SSplitterParams ¶ms)
void MakeID2Chunk(TChunkId id, const SChunkInfo &info)
CRef< CID2S_Bioseq_set_Ids > MakeBioseq_setIds(const set< int > &ids) const
TSeqPos GetLength(const CSeq_data &src) const
bool IsWhole(const CSeq_id_Handle &id, const TRange &range) const
CRef< CSeq_entry > m_Skeleton
vector< CRef< CID2S_Chunk_Content > > TChunkContent
CRef< CID2S_Split_Info > m_Split_Info
CRef< CID2S_Bioseq_Ids > MakeBioseqIds(const set< CSeq_id_Handle > &ids) const
void MakeID2SObjects(void)
CRef< CID2S_Seq_loc > MakeLoc(const CSeqsRange &range) const
void AddRange(const CSeq_id_Handle &h, const TRange &range, ENa_strand strand)
CID2S_Bioseq_place_Info â.
CID2S_Bioseq_set_Ids â.
CID2S_Feat_type_Info â.
CID2S_Seq_annot_Info â.
CID2S_Seq_annot_place_Info â.
CID2S_Seq_assembly_Info â.
CID2S_Seq_descr_Info â.
CID2S_Seq_feat_Ids_Info â.
CID2S_Seq_id_Interval â.
CID2S_Sequence_Piece â.
void Add(const COneSeqRange &range)
bool IsBioseq_set(void) const
bool IsBioseq(void) const
TBioseq_setId GetBioseq_setId(void) const
const TBioseqId & GetBioseqId(void) const
ESubtype GetSubtype(void) const
static E_Choice GetTypeFromSubtype(ESubtype subtype)
@ eSubtype_bad
These no longer need to match the FEATDEF values in the C toolkit's objfdef.h.
static bool IsGoodFeatTable(const CSeq_table &table)
static CAnnotName GetName(const CSeq_annot &annot)
static size_t CountAnnotObjects(const CSeq_annot &annot)
@Seq_descr.hpp User-defined methods of the data storage class.
namespace ncbi::objects::
void Add(const CSeq_id_Handle &id, const COneSeqRange &loc)
void AddChunk(const CID2S_Chunk_Id &id, const CID2S_Chunk &chunk)
Template class for iteration on objects of class C (non-medifiable version)
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
static const struct type types[]
#define GI_FROM(T, value)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
ENetStorageObjectLocation
Enumeration that indicates the current location of the object.
const string AsFastaString(void) const
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TSeqPos GetBioseqLength(void) const
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
TObjectType & GetNCObject(void) const
Get object.
position_type GetLength(void) const
TThisType & SetToOpen(position_type toOpen)
position_type GetToOpen(void) const
static TThisType GetWhole(void)
#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.
CTempString literal(const char(&str)[Size])
Templatized initialization from a string literal.
TFrom GetFrom(void) const
Get the From member data.
list< CRef< CSeq_align > > TAssembly
void SetName(const TName &value)
Assign a value to Name data member.
TBioseqs & SetBioseqs(void)
Assign a value to Bioseqs data member.
TLoc_set & SetLoc_set(void)
Select the variant.
Tdata & Set(void)
Assign a value to data member.
void SetType_mask(TType_mask value)
Assign a value to Type_mask data member.
void SetBioseq_sets(TBioseq_sets &value)
Assign a value to Bioseq_sets data member.
list< CRef< CID2S_Interval > > TInts
TSeq_id_interval & SetSeq_id_interval(void)
Select the variant.
TAnnots & SetAnnots(void)
Assign a value to Annots data member.
void SetBioseqs(TBioseqs &value)
Assign a value to Bioseqs data member.
TWhole_gi_range & SetWhole_gi_range(void)
Select the variant.
list< CRef< CID2S_Bioseq_place_Info > > TBioseq_place
TGi_interval & SetGi_interval(void)
Select the variant.
list< CRef< CID2S_Chunk_Data > > TData
void SetGi(TGi value)
Assign a value to Gi data member.
void SetSeq_id(TSeq_id &value)
Assign a value to Seq_id data member.
void SetSeq_loc(TSeq_loc &value)
Assign a value to Seq_loc data member.
TAssembly & SetAssembly(void)
Assign a value to Assembly data member.
TInts & SetInts(void)
Assign a value to Ints data member.
void SetBioseqs(TBioseqs &value)
Assign a value to Bioseqs data member.
void SetCount(TCount value)
Assign a value to Count data member.
list< CRef< CBioseq > > TBioseqs
void SetBioseq_sets(TBioseq_sets &value)
Assign a value to Bioseq_sets data member.
TChunks & SetChunks(void)
Assign a value to Chunks data member.
void SetStart(TStart value)
Assign a value to Start data member.
TData & SetData(void)
Assign a value to Data data member.
TWhole_gi & SetWhole_gi(void)
Select the variant.
TFeat & SetFeat(void)
Assign a value to Feat data member.
TWhole_seq_id & SetWhole_seq_id(void)
Select the variant.
list< CRef< CSeq_annot > > TAnnots
list< CRef< CID2S_Seq_feat_Ids_Info > > TFeat_ids
void SetGi(TGi value)
Assign a value to Gi data member.
TSeq_data & SetSeq_data(void)
Assign a value to Seq_data data member.
void SetSeq_id(TSeq_id &value)
Assign a value to Seq_id data member.
void SetGraph(void)
Set NULL data member (assign 'NULL' value to Graph data member).
list< CRef< CID2S_Sequence_Piece > > TSeq_data
void SetDescr(TDescr &value)
Assign a value to Descr data member.
TInts & SetInts(void)
Assign a value to Ints data member.
void SetAlign(void)
Set NULL data member (assign 'NULL' value to Align data member).
void SetBioseqs(TBioseqs &value)
Assign a value to Bioseqs data member.
list< CRef< CID2S_Chunk_Content > > TContent
E_Choice Which(void) const
Which variant is currently selected.
Tdata & Set(void)
Assign a value to data member.
@ e_Loc_set
combination of locations
@ e_not_set
No variant selected.
const TIds & GetIds(void) const
Get the Ids member data.
const TId & GetId(void) const
Get the Id member data.
const TLocal & GetLocal(void) const
Get the variant data.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
E_Choice
Choice variants.
bool IsLocal(void) const
Check if variant Local is selected.
const TData & GetData(void) const
Get the Data member data.
list< CRef< CFeat_id > > TIds
bool IsSetIds(void) const
set of Ids; will replace 'id' field Check if a value has been assigned to Ids data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TXref & GetXref(void) const
Get the Xref member data.
vector< CRef< CSeqFeatXref > > TXref
@ e_not_set
No variant selected.
E_Choice Which(void) const
Which variant is currently selected.
TLiteral & SetLiteral(void)
Select the variant.
void SetData(TData &value)
Assign a value to Data data member.
list< CRef< CSeqdesc > > Tdata
list< CRef< CSeq_align > > TAssembly
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
const TGraph & GetGraph(void) const
Get the variant data.
void SetName(const TName &value)
Assign a value to Name data member.
list< CRef< CSeq_graph > > TGraph
void SetDesc(TDesc &value)
Assign a value to Desc data member.
void SetExt(TExt &value)
Assign a value to Ext data member.
const TName & GetName(void) const
Get the Name member data.
list< CRef< CAnnot_id > > TId
const TLiteral & GetLiteral(void) const
Get the variant data.
bool IsSetName(void) const
source if "other" above Check if a value has been assigned to Name data member.
const TId & GetId(void) const
Get the Id member data.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
list< CRef< CSeq_align > > TAlign
const Tdata & Get(void) const
Get the member data.
bool IsSetDb(void) const
Check if a value has been assigned to Db data member.
const TDesc & GetDesc(void) const
Get the Desc member data.
list< CRef< CSeq_id > > TId
bool IsSetDesc(void) const
used only for stand alone Seq-annots Check if a value has been assigned to Desc data member.
const TAlign & GetAlign(void) const
Get the variant data.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
void SetDb(TDb value)
Assign a value to Db data member.
const TExt & GetExt(void) const
Get the Ext member data.
E_Choice Which(void) const
Which variant is currently selected.
TDb GetDb(void) const
Get the Db member data.
const TSeq_table & GetSeq_table(void) const
Get the variant data.
const TId & GetId(void) const
Get the Id member data.
E_Choice Which(void) const
Which variant is currently selected.
const TFtable & GetFtable(void) const
Get the variant data.
list< CRef< CSeq_feat > > TFtable
bool IsFtable(void) const
Check if variant Ftable is selected.
const TData & GetData(void) const
Get the Data member data.
Tdata & Set(void)
Assign a value to data member.
bool IsSetSeq_data(void) const
may have the data Check if a value has been assigned to Seq_data data member.
list< CRef< CDelta_seq > > Tdata
TId & SetId(void)
Assign a value to Id data member.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
E_Choice Which(void) const
Which variant is currently selected.
@ e_MaxChoice
== e_Modelev+1
@ e_Literal
a piece of sequence
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
constexpr auto sort(_Init &&init)
ENetStorageObjectLocation TLocation
Int4 delta(size_t dimension_, const Int4 *score_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
CRef< CSeq_loc > MakeLoc(const char *text)
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
vector< CBioseq_SplitInfo > TPlaceBioseq
vector< CSeq_data_SplitInfo > TPlaceSeq_data
vector< CSeq_hist_SplitInfo > TPlaceSeq_hist
vector< CSeq_descr_SplitInfo > TPlaceSeq_descr
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4