NCBI C++ ToolKit
blob_splitter_maker.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: blob_splitter_maker.cpp 91281 2020-10-05 15:22:06Z grichenk $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Eugene Vasilchenko
27 *
28 * File Description:
29 * Application for splitting blobs withing ID1 cache
30 *
31 * ===========================================================================
32 */
33 
34 #include <ncbi_pch.hpp>
36 
37 #include <serial/objostr.hpp>
38 #include <serial/serial.hpp>
39 #include <serial/iterator.hpp>
40 
42 
46 
49 
50 #include <objects/seq/seq__.hpp>
51 
56 
58 
59 #include <objmgr/scope.hpp>
69 
70 #ifdef OBJECTS_SEQSPLIT_ID2S_SEQ_FEAT_IDS_INFO_HPP
71 # define HAVE_FEAT_IDS
72 #endif
73 
76 
77 template<class C>
78 inline
79 C& NonConst(const C& c)
80 {
81  return const_cast<C&>(c);
82 }
83 
84 
85 /////////////////////////////////////////////////////////////////////////////
86 // CBlobSplitterImpl
87 /////////////////////////////////////////////////////////////////////////////
88 
89 
91  : m_Params(params)
92 {
93 }
94 
95 
97 {
98 }
99 
100 
102 {
103  m_SplitBlob.Reset();
106  m_Entries.clear();
107  m_Pieces.clear();
108  m_Chunks.clear();
109  m_Scope.Reset();
110  m_Master.Reset();
111 }
112 
113 
115 {
117  ITERATE ( TChunks, it, m_Chunks ) {
118  if ( it->first == 0 ) {
119  AttachToSkeleton(it->second);
120  }
121  else {
122  MakeID2Chunk(it->first, it->second);
123  }
124  }
126  ITERATE ( TID2Chunks, it, m_ID2_Chunks ) {
127  m_SplitBlob.AddChunk(it->first, *it->second);
128  }
129 }
130 
131 
132 namespace {
133 
134  struct SOneSeqAnnots
135  {
136  typedef set<SAnnotTypeSelector> TTypeSet;
137  typedef COneSeqRange TTotalLocation;
138 
139  void Add(const SAnnotTypeSelector& type, const COneSeqRange& loc)
140  {
141  m_TotalType.insert(type);
142  m_TotalLocation.Add(loc);
143  }
144 
145  TTypeSet m_TotalType;
146  TTotalLocation m_TotalLocation;
147  };
148 
149 
150  struct SSplitAnnotInfo
151  {
152  typedef vector<SAnnotTypeSelector> TTypeSet;
153  typedef CSeqsRange TLocation;
154 
155  TTypeSet m_TypeSet;
156  TLocation m_Location;
157  };
158 
159 
160  struct SAllAnnotTypes
161  {
162  typedef vector<SAnnotTypeSelector> TTypeSet;
163  typedef CSeqFeatData::ESubtype TSubtype;
164  typedef CSeqFeatData::E_Choice TFeatType;
165  typedef set<TSubtype> TSubtypes;
166  typedef map<TFeatType, TSubtypes> TFeatTypes;
167 
168  SAllAnnotTypes(void)
169  : m_Align(false), m_Graph(false)
170  {
171  }
172 
173  void Add(const SAnnotTypeSelector& t)
174  {
175  switch ( t.GetAnnotType() ) {
177  m_Align = true;
178  break;
180  m_Graph = true;
181  break;
183  m_FeatTypes[t.GetFeatType()].insert(t.GetFeatSubtype());
184  break;
186  m_FeatTypes[CSeqFeatData::e_not_set];
187  break;
188  default:
189  _ASSERT("bad annot type" && 0);
190  }
191  }
192  void Add(const TTypeSet& types)
193  {
194  ITERATE ( TTypeSet, it, types ) {
195  Add(*it);
196  }
197  }
198 
199  void SetFeatTypes(list<CRef<CID2S_Feat_type_Info> >& dst)
200  {
201  ITERATE ( TFeatTypes, tit, m_FeatTypes ) {
202  TFeatType t = tit->first;
203  const TSubtypes& subtypes = tit->second;
204  bool all_subtypes =
205  subtypes.find(CSeqFeatData::eSubtype_any) !=
206  subtypes.end();
207  if ( !all_subtypes ) {
208  all_subtypes = true;
209  for ( TSubtype st = CSeqFeatData::eSubtype_bad;
211  st = TSubtype(st+1) ) {
212  if ( CSeqFeatData::GetTypeFromSubtype(st) == t &&
213  subtypes.find(st) == subtypes.end() ) {
214  all_subtypes = false;
215  break;
216  }
217  }
218  }
220  (new CID2S_Feat_type_Info);
221  type_info->SetType(t);
222  if ( !all_subtypes ) {
223  ITERATE ( TSubtypes, stit, subtypes ) {
224  type_info->SetSubtypes().push_back(*stit);
225  }
226  }
227  dst.push_back(type_info);
228  }
229  }
230 
231  bool m_Align;
232  bool m_Graph;
233  TFeatTypes m_FeatTypes;
234  };
235 
236 
237  struct SAllAnnots
238  {
239  typedef map<CSeq_id_Handle, SOneSeqAnnots> TAllAnnots;
240  typedef vector<SAnnotTypeSelector> TTypeSet;
241  typedef map<TTypeSet, CSeqsRange> TSplitAnnots;
242 
243  void Add(const CSeq_annot& annot,
244  const CBlobSplitterImpl& impl)
245  {
246  switch ( annot.GetData().Which() ) {
248  Add(annot.GetData().GetFtable(), impl);
249  break;
251  Add(annot.GetData().GetAlign(), impl);
252  break;
254  Add(annot.GetData().GetGraph(), impl);
255  break;
257  Add(annot.GetData().GetSeq_table(), impl);
258  break;
259  default:
260  _ASSERT("bad annot type" && 0);
261  }
262  }
263 
264 
265  void Add(const CSeq_annot::C_Data::TGraph& objs,
266  const CBlobSplitterImpl& impl)
267  {
269  ITERATE ( CSeq_annot::C_Data::TGraph, it, objs ) {
270  CSeqsRange loc;
271  loc.Add(**it, impl);
272  Add(type, loc);
273  }
274  }
275  void Add(const CSeq_annot::C_Data::TAlign& objs,
276  const CBlobSplitterImpl& impl)
277  {
279  ITERATE ( CSeq_annot::C_Data::TAlign, it, objs ) {
280  CSeqsRange loc;
281  loc.Add(**it, impl);
282  Add(type, loc);
283  }
284  }
285  void Add(const CSeq_annot::C_Data::TFtable& objs,
286  const CBlobSplitterImpl& impl)
287  {
288  ITERATE ( CSeq_annot::C_Data::TFtable, it, objs ) {
289  const CSeq_feat& feat = **it;
291  CSeqsRange loc;
292  loc.Add(feat, impl);
293  Add(type, loc);
294  }
295  }
296  void Add(const CSeq_annot::C_Data::TSeq_table& table,
297  const CBlobSplitterImpl& impl)
298  {
301  type.SetFeatType
302  (CSeqFeatData::E_Choice(table.GetFeat_type()));
303  if ( table.IsSetFeat_subtype() ) {
304  type.SetFeatSubtype
305  (CSeqFeatData::ESubtype(table.GetFeat_subtype()));
306  }
307  }
308  else {
310  }
311  CSeqsRange loc;
312  loc.Add(table, impl);
313  Add(type, loc);
314  }
315 
316  void Add(const SAnnotTypeSelector& sel, const CSeqsRange& loc)
317  {
318  ITERATE ( CSeqsRange, it, loc ) {
319  m_AllAnnots[it->first].Add(sel, it->second);
320  }
321  }
322 
323  void SplitInfo(void)
324  {
325  ITERATE ( TAllAnnots, it, m_AllAnnots ) {
326  TTypeSet type_set;
328  it->second.m_TotalType) {
329  type_set.push_back(*tit);
330  }
331  m_SplitAnnots[type_set].Add(it->first,
332  it->second.m_TotalLocation);
333  }
334  }
335 
336  TAllAnnots m_AllAnnots;
337  TSplitAnnots m_SplitAnnots;
338  };
339 
340 
341 #ifdef HAVE_FEAT_IDS
342  struct SFeatIds
343  {
344  typedef int TFeatIdInt;
345  typedef string TFeatIdStr;
346  enum EIdType {
347  eFeatId,
348  eXrefId
349  };
350  typedef vector<SAnnotTypeSelector> TTypeSet;
351  typedef pair<TTypeSet, TTypeSet> TTypeSets;
352  typedef map<TFeatIdInt, TTypeSets> TAllIdsInt;
353  typedef vector<TFeatIdInt> TFeatIdsInt;
354  typedef map<TFeatIdStr, TTypeSets> TAllIdsStr;
355  typedef vector<TFeatIdStr> TFeatIdsStr;
357 
358  void Add(const SAnnotTypeSelector& feat_type,
359  const CFeat_id& feat_id,
360  EIdType id_type)
361  {
362  if ( feat_id.IsLocal() ) {
363  const CObject_id& id = feat_id.GetLocal();
364  if ( id.IsId() ) {
365  TTypeSets& types = m_AllIdsInt[id.GetId()];
366  (id_type == eFeatId? types.first: types.second)
367  .push_back(feat_type);
368  }
369  else {
370  TTypeSets& types = m_AllIdsStr[id.GetStr()];
371  (id_type == eFeatId? types.first: types.second)
372  .push_back(feat_type);
373  }
374  }
375  }
376 
377  void Add(const CSeq_annot::C_Data::TFtable& objs)
378  {
379  ITERATE ( CSeq_annot::C_Data::TFtable, it, objs ) {
380  const CSeq_feat& feat = **it;
382  if ( feat.IsSetId() ) {
383  Add(type, feat.GetId(), eFeatId);
384  }
385  if ( feat.IsSetIds() ) {
386  ITERATE ( CSeq_feat::TIds, id_it, feat.GetIds() ) {
387  Add(type, **id_it, eFeatId);
388  }
389  }
390  if ( feat.IsSetXref() ) {
391  ITERATE ( CSeq_feat::TXref, xref_it, feat.GetXref() ) {
392  if ( (*xref_it)->IsSetId() )
393  Add(type, (*xref_it)->GetId(), eXrefId);
394  }
395  }
396  }
397  }
398 
399  static void clean(TTypeSet& types)
400  {
401  sort(types.begin(), types.end());
402  types.erase(unique(types.begin(), types.end()), types.end());
403  }
404  static void clean(TFeatIdsInt& ids)
405  {
406  sort(ids.begin(), ids.end());
407  ids.erase(unique(ids.begin(), ids.end()), ids.end());
408  }
409  static void clean(TFeatIdsStr& ids)
410  {
411  sort(ids.begin(), ids.end());
412  ids.erase(unique(ids.begin(), ids.end()), ids.end());
413  }
414 
415  void SplitInfo(void)
416  {
417  NON_CONST_ITERATE ( TAllIdsInt, it, m_AllIdsInt ) {
418  clean(it->second.first);
419  clean(it->second.second);
420  m_SplitIds[it->second].first.push_back(it->first);
421  }
422  NON_CONST_ITERATE ( TAllIdsStr, it, m_AllIdsStr ) {
423  clean(it->second.first);
424  clean(it->second.second);
425  m_SplitIds[it->second].second.push_back(it->first);
426  }
427  NON_CONST_ITERATE ( TSplitIds, it, m_SplitIds ) {
428  clean(it->second.first);
429  clean(it->second.second);
430  }
431  }
432 
433  TAllIdsInt m_AllIdsInt;
434  TAllIdsStr m_AllIdsStr;
435  TSplitIds m_SplitIds;
436  };
437 #endif
438 
439  typedef set<TGi> TGiSet;
440  typedef set<CSeq_id_Handle> TIdSet;
441 
442  template<class Func>
443  void ForEachGiRange(const TGiSet& gis, Func func)
444  {
445  TGi gi_start = ZERO_GI;
446  int gi_count = 0;
447  ITERATE ( TGiSet, it, gis ) {
448  if ( gi_count == 0 || *it != gi_start + GI_FROM(int, gi_count) ) {
449  if ( gi_count > 0 ) {
450  func(gi_start, gi_count);
451  }
452  gi_start = *it;
453  gi_count = 0;
454  }
455  ++gi_count;
456  }
457  if ( gi_count > 0 ) {
458  func(gi_start, gi_count);
459  }
460  }
461 
463  typedef set<TRange> TRangeSet;
464  typedef map<CSeq_id_Handle, TRangeSet> TIntervalSet;
465 
466 
467  template<class C>
468  inline
469  void SetRange(C& obj, const TRange& range)
470  {
471  obj.SetStart(range.GetFrom());
472  obj.SetLength(range.GetLength());
473  }
474 
475 
476  void AddIntervals(CID2S_Gi_Ints::TInts& ints,
477  const TRangeSet& range_set)
478  {
479  ITERATE ( TRangeSet, it, range_set ) {
481  SetRange(*add, *it);
482  ints.push_back(add);
483  }
484  }
485 
486 
488  const TRangeSet& range_set)
489  {
491  if ( id.IsGi() ) {
492  TGi gi = id.GetGi();
493  if ( range_set.size() == 1 ) {
494  CID2S_Gi_Interval& interval = loc->SetGi_interval();
495  interval.SetGi(gi);
496  SetRange(interval, *range_set.begin());
497  }
498  else {
499  CID2S_Gi_Ints& seq_ints = loc->SetGi_ints();
500  seq_ints.SetGi(gi);
501  AddIntervals(seq_ints.SetInts(), range_set);
502  }
503  }
504  else {
505  if ( range_set.size() == 1 ) {
506  CID2S_Seq_id_Interval& interval = loc->SetSeq_id_interval();
507  interval.SetSeq_id(const_cast<CSeq_id&>(*id.GetSeqId()));
508  SetRange(interval, *range_set.begin());
509  }
510  else {
511  CID2S_Seq_id_Ints& seq_ints = loc->SetSeq_id_ints();
512  seq_ints.SetSeq_id(const_cast<CSeq_id&>(*id.GetSeqId()));
513  AddIntervals(seq_ints.SetInts(), range_set);
514  }
515  }
516  return loc;
517  }
518 
519 
521  {
523  if ( id.IsGi() ) {
524  loc->SetWhole_gi(id.GetGi());
525  }
526  else {
527  loc->SetWhole_seq_id(const_cast<CSeq_id&>(*id.GetSeqId()));
528  }
529  return loc;
530  }
531 
532 
534  {
535  if ( loc.Which() == CID2S_Seq_loc::e_not_set ) {
536  loc.Assign(*add);
537  }
538  else {
539  if ( loc.Which() != CID2S_Seq_loc::e_Loc_set &&
540  loc.Which() != CID2S_Seq_loc::e_not_set ) {
542  AddLoc(*copy, Ref(&loc));
543  loc.SetLoc_set().push_back(copy);
544  }
545  loc.SetLoc_set().push_back(add);
546  }
547  }
548 
549 
550  struct FAddGiRangeToSeq_loc
551  {
552  FAddGiRangeToSeq_loc(CID2S_Seq_loc& loc)
553  : m_Loc(loc)
554  {
555  }
556 
557  enum { SEPARATE = 3 };
558 
559  void operator()(TGi start, int count) const
560  {
561  _ASSERT(count > 0);
562  if ( count <= SEPARATE ) {
563  for ( ; count > 0; --count, ++start ) {
565  add->SetWhole_gi(start);
566  AddLoc(m_Loc, add);
567  }
568  }
569  else {
571  add->SetWhole_gi_range().SetStart(start);
572  add->SetWhole_gi_range().SetCount(count);
573  AddLoc(m_Loc, add);
574  }
575  }
576  CID2S_Seq_loc& m_Loc;
577  };
578 
579 
580  struct FAddGiRangeToBioseqIds
581  {
582  FAddGiRangeToBioseqIds(CID2S_Bioseq_Ids& ids)
583  : m_Ids(ids)
584  {
585  }
586 
587  enum { SEPARATE = 2 };
588 
589  void operator()(TGi start, int count) const
590  {
591  _ASSERT(count > 0);
592  if ( count <= SEPARATE ) {
593  // up to SEPARATE consequent gis will be encoded separately
594  for ( ; count > 0; --count, ++start ) {
596  (new CID2S_Bioseq_Ids::C_E);
597  elem->SetGi(start);
598  m_Ids.Set().push_back(elem);
599  }
600  }
601  else {
603  (new CID2S_Bioseq_Ids::C_E);
604  elem->SetGi_range().SetStart(start);
605  elem->SetGi_range().SetCount(count);
606  m_Ids.Set().push_back(elem);
607  }
608  }
609  CID2S_Bioseq_Ids& m_Ids;
610  };
611 
612 
613  void AddLoc(CID2S_Seq_loc& loc, const TGiSet& whole_gi_set)
614  {
615  ForEachGiRange(whole_gi_set, FAddGiRangeToSeq_loc(loc));
616  }
617 
618 
619  void AddLoc(CID2S_Seq_loc& loc, const TIdSet& whole_id_set)
620  {
621  ITERATE ( TIdSet, it, whole_id_set ) {
622  AddLoc(loc, MakeLoc(*it));
623  }
624  }
625 
626 
627  void AddLoc(CID2S_Seq_loc& loc, const TIntervalSet& interval_set)
628  {
629  ITERATE ( TIntervalSet, it, interval_set ) {
630  AddLoc(loc, MakeLoc(it->first, it->second));
631  }
632  }
633 
634  struct SLessSeq_id
635  {
636  bool operator()(const CConstRef<CSeq_id>& id1,
637  const CConstRef<CSeq_id>& id2) const
638  {
639  if ( id1->Which() != id2->Which() ) {
640  return id1->Which() < id2->Which();
641  }
642  return id1->AsFastaString() < id2->AsFastaString();
643  }
644  };
645 
646 
647  void AddBioseqIds(CID2S_Bioseq_Ids& ret, const set<CSeq_id_Handle>& ids)
648  {
649  TGiSet gi_set;
650  typedef set<CConstRef<CSeq_id>, SLessSeq_id> TLessIdSet;
651  TLessIdSet id_set;
652  ITERATE ( set<CSeq_id_Handle>, it, ids ) {
653  if ( it->IsGi() ) {
654  gi_set.insert(it->GetGi());
655  }
656  else {
657  id_set.insert(it->GetSeqId());
658  }
659  }
660 
661  ForEachGiRange(gi_set, FAddGiRangeToBioseqIds(ret));
662  ITERATE ( TLessIdSet, it, id_set ) {
664  elem->SetSeq_id(const_cast<CSeq_id&>(**it));
665  ret.Set().push_back(elem);
666  }
667  }
668 
669 
670  void AddBioseq_setIds(CID2S_Bioseq_set_Ids& ret, const set<int>& ids)
671  {
672  ITERATE ( set<int>, it, ids ) {
673  ret.Set().push_back(*it);
674  }
675  }
676 
677 
678  typedef set<CSeq_id_Handle> TBioseqs;
679  typedef set<int> TBioseq_sets;
680  typedef pair<TBioseqs, TBioseq_sets> TPlaces;
681 
682  void AddPlace(TPlaces& places, const CPlaceId& place)
683  {
684  if ( place.IsBioseq() ) {
685  places.first.insert(place.GetBioseqId());
686  }
687  else {
688  places.second.insert(place.GetBioseq_setId());
689  }
690  }
691 }
692 
693 
695 {
696  try {
698  if ( bh ) {
699  return bh.GetBioseqLength();
700  }
701  }
702  catch ( CException& /*ignored*/ ) {
703  }
704  return kInvalidSeqPos;
705 }
706 
707 
709  const TRange& range) const
710 {
711  return range == range.GetWhole() ||
712  (range.GetFrom() <= 0 && range.GetToOpen() >= GetLength(id));
713 }
714 
715 
717  const CSeqsRange& ranges) const
718 {
719  TGiSet whole_gi_set;
720  TIdSet whole_id_set;
721  TIntervalSet interval_set;
722 
723  ITERATE ( CSeqsRange, it, ranges ) {
724  TRange range = it->second.GetTotalRange();
725  if ( IsWhole(it->first, range) ) {
726  if ( it->first.IsGi() ) {
727  whole_gi_set.insert(it->first.GetGi());
728  }
729  else {
730  whole_id_set.insert(it->first);
731  }
732  }
733  else {
734  TSeqPos len = GetLength(it->first);
735  if ( range.GetToOpen() > len ) {
736  range.SetToOpen(len);
737  }
738  interval_set[it->first].insert(range);
739  }
740  }
741 
742  AddLoc(loc, whole_gi_set);
743  AddLoc(loc, whole_id_set);
744  AddLoc(loc, interval_set);
745  _ASSERT(loc.Which() != loc.e_not_set);
746 }
747 
748 
750  const CHandleRangeMap& ranges) const
751 {
752  TGiSet whole_gi_set;
753  TIdSet whole_id_set;
754  TIntervalSet interval_set;
755 
756  ITERATE ( CHandleRangeMap, id_it, ranges ) {
757  ITERATE ( CHandleRange, it, id_it->second ) {
758  TRange range = it->first;
759  if ( IsWhole(id_it->first, range) ) {
760  if ( id_it->first.IsGi() ) {
761  whole_gi_set.insert(id_it->first.GetGi());
762  }
763  else {
764  whole_id_set.insert(id_it->first);
765  }
766  }
767  else {
768  TSeqPos len = GetLength(id_it->first);
769  if ( range.GetToOpen() > len ) {
770  range.SetToOpen(len);
771  }
772  interval_set[id_it->first].insert(range);
773  }
774  }
775  }
776 
777  AddLoc(loc, whole_gi_set);
778  AddLoc(loc, whole_id_set);
779  AddLoc(loc, interval_set);
780  _ASSERT(loc.Which() != loc.e_not_set);
781 }
782 
783 
785  const CSeq_id_Handle& id,
786  TRange range) const
787 {
788  if ( IsWhole(id, range) ) {
789  if ( id.IsGi() ) {
790  loc.SetWhole_gi(id.GetGi());
791  }
792  else {
793  loc.SetWhole_seq_id(const_cast<CSeq_id&>(*id.GetSeqId()));
794  }
795  }
796  else {
797  TSeqPos len = GetLength(id);
798  if ( range.GetToOpen() > len ) {
799  range.SetToOpen(len);
800  }
801  if ( id.IsGi() ) {
802  CID2S_Gi_Interval& interval = loc.SetGi_interval();
803  interval.SetGi(id.GetGi());
804  SetRange(interval, range);
805  }
806  else {
807  CID2S_Seq_id_Interval& interval = loc.SetSeq_id_interval();
808  interval.SetSeq_id(const_cast<CSeq_id&>(*id.GetSeqId()));
809  SetRange(interval, range);
810  }
811  }
812 }
813 
814 
816 {
818  SetLoc(*loc, range);
819  return loc;
820 }
821 
822 
825 {
827  SetLoc(*loc, id, range);
828  return loc;
829 }
830 
831 
833  const CPlaceId& place_id)
834 {
835  CRef<CID2S_Chunk_Data>& data = chunk_data[place_id];
836  if ( !data ) {
837  data.Reset(new CID2S_Chunk_Data);
838  if ( place_id.IsBioseq_set() ) {
839  data->SetId().SetBioseq_set(place_id.GetBioseq_setId());
840  }
841  else if ( place_id.GetBioseqId().IsGi() ) {
842  data->SetId().SetGi(place_id.GetBioseqId().GetGi());
843  }
844  else {
845  CConstRef<CSeq_id> id = place_id.GetBioseqId().GetSeqId();
846  data->SetId().SetSeq_id(const_cast<CSeq_id&>(*id));
847  }
848  }
849  return *data;
850 }
851 
852 
855 {
857  AddBioseqIds(*ret, ids);
858  return ret;
859 }
860 
861 
864 {
866  AddBioseq_setIds(*ret, ids);
867  return ret;
868 }
869 
870 
872 {
873  TChunkData chunk_data;
874  TChunkContent chunk_content;
875 
876  typedef unsigned TDescTypeMask;
878  typedef map<TDescTypeMask, TPlaces> TDescPlaces;
879  TDescPlaces all_descrs;
880  TPlaces all_annot_places;
881  typedef map<CAnnotName, SAllAnnots> TAllAnnots;
882  TAllAnnots all_annots;
883 #ifdef HAVE_FEAT_IDS
884  SFeatIds feat_ids;
885 #endif
886  CHandleRangeMap all_data;
887  typedef set<CSeq_id_Handle> TBioseqIds;
888  typedef map<CPlaceId, TBioseqIds> TBioseqPlaces;
889  TBioseqPlaces all_bioseqs;
890  TPlaces all_assemblies;
891 
892  ITERATE ( SChunkInfo::TChunkSeq_descr, it, info.m_Seq_descr ) {
893  const CPlaceId& place_id = it->first;
894  TDescTypeMask desc_type_mask = 0;
896  GetChunkData(chunk_data, place_id).SetDescr();
897  ITERATE ( SChunkInfo::TPlaceSeq_descr, dit, it->second ) {
898  CSeq_descr& descr = const_cast<CSeq_descr&>(*dit->m_Descr);
899  ITERATE ( CSeq_descr::Tdata, i, descr.Get() ) {
900  dst.Set().push_back(*i);
901  desc_type_mask |= (1<<(**i).Which());
902  }
903  }
904  AddPlace(all_descrs[desc_type_mask], place_id);
905  }
906 
907  ITERATE ( SChunkInfo::TChunkAnnots, it, info.m_Annots ) {
908  const CPlaceId& place_id = it->first;
909  AddPlace(all_annot_places, place_id);
911  GetChunkData(chunk_data, place_id).SetAnnots();
912  ITERATE ( SChunkInfo::TPlaceAnnots, ait, it->second ) {
913  CRef<CSeq_annot> annot = MakeSeq_annot(*ait->first, ait->second);
914  dst.push_back(annot);
915 
916  // collect locations
917  CAnnotName name = CSeq_annot_SplitInfo::GetName(*ait->first);
918  all_annots[name].Add(*annot, *this);
919 #ifdef HAVE_FEAT_IDS
920  if ( annot->GetData().IsFtable() ) {
921  feat_ids.Add(annot->GetData().GetFtable());
922  }
923 #endif
924  }
925  }
926 
927  ITERATE ( SChunkInfo::TChunkSeq_data, it, info.m_Seq_data ) {
928  const CPlaceId& place_id = it->first;
929  _ASSERT(place_id.IsBioseq());
931  GetChunkData(chunk_data, place_id).SetSeq_data();
933  TSeqPos p_start = kInvalidSeqPos;
934  TSeqPos p_end = kInvalidSeqPos;
935  ITERATE ( SChunkInfo::TPlaceSeq_data, data_it, it->second ) {
936  const CSeq_data_SplitInfo& data = *data_it;
937  const TRange& range = data.GetRange();
938  TSeqPos start = range.GetFrom(), length = range.GetLength();
939  if ( !piece || start != p_end ) {
940  if ( piece ) {
941  all_data.AddRange(place_id.GetBioseqId(),
942  TRange(p_start, p_end-1),
944  dst.push_back(piece);
945  }
946  piece.Reset(new CID2S_Sequence_Piece);
947  p_start = p_end = start;
948  piece->SetStart(p_start);
949  }
951  literal->SetLength(length);
952  literal->SetSeq_data(const_cast<CSeq_data&>(*data.m_Data));
953  piece->SetData().push_back(literal);
954  p_end += length;
955  }
956  if ( piece ) {
957  all_data.AddRange(place_id.GetBioseqId(),
958  TRange(p_start, p_end-1),
960  dst.push_back(piece);
961  }
962  }
963 
964  ITERATE ( SChunkInfo::TChunkBioseq, it, info.m_Bioseq ) {
965  const CPlaceId& place_id = it->first;
966  _ASSERT(place_id.IsBioseq_set());
967  TBioseqIds& ids = all_bioseqs[place_id];
969  GetChunkData(chunk_data, place_id).SetBioseqs();
970  ITERATE ( SChunkInfo::TPlaceBioseq, bit, it->second ) {
971  const CBioseq& seq = *bit->m_Bioseq;
972  dst.push_back(Ref(const_cast<CBioseq*>(&seq)));
973  ITERATE ( CBioseq::TId, idit, seq.GetId() ) {
974  ids.insert(CSeq_id_Handle::GetHandle(**idit));
975  }
976  }
977  }
978 
979  ITERATE ( SChunkInfo::TChunkSeq_hist, it, info.m_Seq_hist ) {
980  const CPlaceId& place_id = it->first;
982  GetChunkData(chunk_data, place_id).SetAssembly();
983  ITERATE ( SChunkInfo::TPlaceSeq_hist, hit, it->second ) {
984  const CSeq_hist::TAssembly& assm = hit->m_Assembly;
985  ITERATE ( CSeq_hist::TAssembly, i, assm ) {
986  dst.push_back(*i);
987  }
988  }
989  AddPlace(all_assemblies, place_id);
990  }
991 
992  NON_CONST_ITERATE ( TAllAnnots, nit, all_annots ) {
993  nit->second.SplitInfo();
994  const CAnnotName& annot_name = nit->first;
995  ITERATE ( SAllAnnots::TSplitAnnots, it, nit->second.m_SplitAnnots ) {
997  CID2S_Seq_annot_Info& annot_info = content->SetSeq_annot();
998  if ( annot_name.IsNamed() ) {
999  annot_info.SetName(annot_name.GetName());
1000  }
1001  SAllAnnotTypes types;
1002  types.Add(it->first);
1003  if ( types.m_Align ) {
1004  annot_info.SetAlign();
1005  }
1006  if ( types.m_Graph ) {
1007  annot_info.SetGraph();
1008  }
1009  if ( !types.m_FeatTypes.empty() ) {
1010  types.SetFeatTypes(annot_info.SetFeat());
1011  }
1012  annot_info.SetSeq_loc(*MakeLoc(it->second));
1013  chunk_content.push_back(content);
1014  }
1015  }
1016 
1017 #ifdef HAVE_FEAT_IDS
1018  {
1019  feat_ids.SplitInfo();
1021  CID2S_Chunk_Content::TFeat_ids& store = content->SetFeat_ids();
1022  ITERATE ( SFeatIds::TSplitIds, it, feat_ids.m_SplitIds ) {
1024  if ( !it->first.first.empty() ) {
1025  SAllAnnotTypes types;
1026  types.Add(it->first.first);
1027  types.SetFeatTypes(info_ids->SetFeat_types());
1028  }
1029  if ( !it->first.second.empty() ) {
1030  SAllAnnotTypes types;
1031  types.Add(it->first.second);
1032  types.SetFeatTypes(info_ids->SetXref_types());
1033  }
1034  ITERATE ( SFeatIds::TFeatIdsInt, fit, it->second.first ) {
1035  info_ids->SetLocal_ids().push_back(*fit);
1036  }
1037  ITERATE ( SFeatIds::TFeatIdsStr, fit, it->second.second ) {
1038  info_ids->SetLocal_str_ids().push_back(*fit);
1039  }
1040  store.push_back(info_ids);
1041  }
1042  chunk_content.push_back(content);
1043  }
1044 #endif
1045 
1046  if ( !all_descrs.empty() ) {
1047  ITERATE ( TDescPlaces, tmit, all_descrs ) {
1049  CID2S_Seq_descr_Info& inf = content->SetSeq_descr();
1050  inf.SetType_mask(tmit->first);
1051  if ( !tmit->second.first.empty() ) {
1052  inf.SetBioseqs(*MakeBioseqIds(tmit->second.first));
1053  }
1054  if ( !tmit->second.second.empty() ) {
1055  inf.SetBioseq_sets(*MakeBioseq_setIds(tmit->second.second));
1056  }
1057  chunk_content.push_back(content);
1058  }
1059  }
1060 
1061  if ( !all_annot_places.first.empty() ||
1062  !all_annot_places.second.empty() ) {
1064  CID2S_Seq_annot_place_Info& inf = content->SetSeq_annot_place();
1065  if ( !all_annot_places.first.empty() ) {
1066  inf.SetBioseqs(*MakeBioseqIds(all_annot_places.first));
1067  }
1068  if ( !all_annot_places.second.empty() ) {
1069  inf.SetBioseq_sets(*MakeBioseq_setIds(all_annot_places.second));
1070  }
1071  chunk_content.push_back(content);
1072  }
1073 
1074  if ( !all_data.empty() ) {
1076  SetLoc(content->SetSeq_data(), all_data);
1077  chunk_content.push_back(content);
1078  }
1079 
1080  if ( !all_bioseqs.empty() ) {
1082  CID2S_Chunk_Content::TBioseq_place& places =content->SetBioseq_place();
1083  ITERATE ( TBioseqPlaces, it, all_bioseqs ) {
1085  place->SetBioseq_set(it->first.GetBioseq_setId());
1086  place->SetSeq_ids(*MakeBioseqIds(it->second));
1087  places.push_back(place);
1088  }
1089  chunk_content.push_back(content);
1090  }
1091 
1092  if ( !all_assemblies.first.empty() ) {
1094  CID2S_Seq_assembly_Info& inf = content->SetSeq_assembly();
1095  inf.SetBioseqs(*MakeBioseqIds(all_assemblies.first));
1096  chunk_content.push_back(content);
1097  }
1098 
1099  CRef<CID2S_Chunk> chunk(new CID2S_Chunk);
1100  CID2S_Chunk::TData& dst_chunk_data = chunk->SetData();
1101  ITERATE ( TChunkData, it, chunk_data ) {
1102  dst_chunk_data.push_back(it->second);
1103  }
1104  m_ID2_Chunks[CID2S_Chunk_Id(chunk_id)] = chunk;
1105 
1106  CRef<CID2S_Chunk_Info> chunk_info(new CID2S_Chunk_Info);
1107  chunk_info->SetId(CID2S_Chunk_Id(chunk_id));
1108  CID2S_Chunk_Info::TContent& dst_chunk_content = chunk_info->SetContent();
1109  ITERATE ( TChunkContent, it, chunk_content ) {
1110  dst_chunk_content.push_back(*it);
1111  }
1112  m_Split_Info->SetChunks().push_back(chunk_info);
1113 }
1114 
1115 
1117 {
1118  ITERATE ( SChunkInfo::TChunkSeq_descr, it, info.m_Seq_descr ) {
1119  TEntries::iterator seq_it = m_Entries.find(it->first);
1120  _ASSERT(seq_it != m_Entries.end());
1121  ITERATE ( SChunkInfo::TPlaceSeq_descr, dit, it->second ) {
1122  const CSeq_descr& src = const_cast<CSeq_descr&>(*dit->m_Descr);
1123  CSeq_descr* dst;
1124  if ( seq_it->second.m_Bioseq ) {
1125  dst = &seq_it->second.m_Bioseq->SetDescr();
1126  }
1127  else {
1128  dst = &seq_it->second.m_Bioseq_set->SetDescr();
1129  }
1130  dst->Set().insert(dst->Set().end(),
1131  src.Get().begin(), src.Get().end());
1132  }
1133  }
1134 
1135  ITERATE ( SChunkInfo::TChunkAnnots, it, info.m_Annots ) {
1136  TEntries::iterator seq_it = m_Entries.find(it->first);
1137  _ASSERT(seq_it != m_Entries.end());
1138  ITERATE ( SChunkInfo::TPlaceAnnots, annot_it, it->second ) {
1139  CRef<CSeq_annot> annot = MakeSeq_annot(*annot_it->first,
1140  annot_it->second);
1141  if ( seq_it->second.m_Bioseq ) {
1142  seq_it->second.m_Bioseq->SetAnnot().push_back(annot);
1143  }
1144  else {
1145  seq_it->second.m_Bioseq_set->SetAnnot().push_back(annot);
1146  }
1147  }
1148  }
1149 
1150  ITERATE ( SChunkInfo::TChunkSeq_data, i, info.m_Seq_data ) {
1151  TEntries::iterator seq_it = m_Entries.find(i->first);
1152  _ASSERT(seq_it != m_Entries.end());
1153  _ASSERT(seq_it->second.m_Bioseq);
1154  CSeq_inst& inst = seq_it->second.m_Bioseq->SetInst();
1155 
1156  TSeqPos seq_length = GetLength(inst);
1157  typedef map<TSeqPos, CRef<CSeq_literal> > TLiterals;
1158  TLiterals literals;
1159  if ( inst.IsSetExt() ) {
1160  _ASSERT(inst.GetExt().Which() == CSeq_ext::e_Delta);
1161  CDelta_ext& delta = inst.SetExt().SetDelta();
1162  TSeqPos pos = 0;
1163  NON_CONST_ITERATE ( CDelta_ext::Tdata, j, delta.Set() ) {
1164  CDelta_seq& seg = **j;
1165  if ( seg.Which() == CDelta_seq::e_Literal &&
1166  !seg.GetLiteral().IsSetSeq_data() ){
1167  literals[pos] = &seg.SetLiteral();
1168  }
1169  pos += GetLength(seg);
1170  }
1171  _ASSERT(pos == seq_length);
1172  }
1173  else {
1174  _ASSERT(!inst.IsSetSeq_data());
1175  }
1176 
1177  ITERATE ( SChunkInfo::TPlaceSeq_data, j, i->second ) {
1178  TRange range = j->GetRange();
1179  CSeq_data& data = const_cast<CSeq_data&>(*j->m_Data);
1180  if ( range.GetFrom() == 0 && range.GetLength() == seq_length ) {
1181  _ASSERT(!inst.IsSetSeq_data());
1182  inst.SetSeq_data(data);
1183  }
1184  else {
1185  TLiterals::iterator iter = literals.find(range.GetFrom());
1186  _ASSERT(iter != literals.end());
1187  CSeq_literal& literal = *iter->second;
1188  _ASSERT(!literal.IsSetSeq_data());
1189  literal.SetSeq_data(data);
1190  }
1191  }
1192  }
1193 
1194  ITERATE ( SChunkInfo::TChunkSeq_hist, it, info.m_Seq_hist ) {
1195  TEntries::iterator seq_it = m_Entries.find(it->first);
1196  _ASSERT(seq_it != m_Entries.end());
1197  _ASSERT( seq_it->second.m_Bioseq );
1198  ITERATE ( SChunkInfo::TPlaceSeq_hist, hit, it->second ) {
1199  const CSeq_hist::TAssembly& src = hit->m_Assembly;
1200  CSeq_hist::TAssembly* dst;
1201  dst = &seq_it->second.m_Bioseq->SetInst().SetHist().SetAssembly();
1202  dst->insert(dst->end(), src.begin(), src.end());
1203  }
1204  }
1205 }
1206 
1207 
1210  const TAnnotObjects& objs)
1211 {
1212  CRef<CSeq_annot> annot(new CSeq_annot);
1213  if ( src.IsSetId() ) {
1214  CSeq_annot::TId& id = annot->SetId();
1215  ITERATE ( CSeq_annot::TId, it, src.GetId() ) {
1216  id.push_back(Ref(&NonConst(**it)));
1217  }
1218  }
1219  if ( src.IsSetDb() ) {
1220  annot->SetDb(src.GetDb());
1221  }
1222  if ( src.IsSetName() ) {
1223  annot->SetName(src.GetName());
1224  }
1225  if ( src.IsSetDesc() ) {
1226  annot->SetDesc(NonConst(src.GetDesc()));
1227  }
1228  switch ( src.GetData().Which() ) {
1230  ITERATE ( CLocObjects_SplitInfo, it, objs ) {
1231  CObject& obj = NonConst(*it->m_Object);
1232  annot->SetData().SetFtable()
1233  .push_back(Ref(&dynamic_cast<CSeq_feat&>(obj)));
1234  }
1235  break;
1237  ITERATE ( CLocObjects_SplitInfo, it, objs ) {
1238  CObject& obj = NonConst(*it->m_Object);
1239  annot->SetData().SetAlign()
1240  .push_back(Ref(&dynamic_cast<CSeq_align&>(obj)));
1241  }
1242  break;
1244  ITERATE ( CLocObjects_SplitInfo, it, objs ) {
1245  CObject& obj = NonConst(*it->m_Object);
1246  annot->SetData().SetGraph()
1247  .push_back(Ref(&dynamic_cast<CSeq_graph&>(obj)));
1248  }
1249  break;
1251  _ASSERT(objs.size() == 1);
1252  {
1253  CObject& obj = NonConst(*objs.front().m_Object);
1254  annot->SetData().SetSeq_table(dynamic_cast<CSeq_table&>(obj));
1255  }
1256  break;
1257  default:
1258  _ASSERT("bad annot type" && 0);
1259  }
1260  return annot;
1261 }
1262 
1263 
1265 {
1266  size_t count = 0;
1267  ITERATE ( TID2Chunks, it, chunks ) {
1268  count += CountAnnotObjects(*it->second);
1269  }
1270  return count;
1271 }
1272 
1273 
1275 {
1276  size_t count = 0;
1277  for ( CTypeConstIterator<CSeq_annot> it(ConstBegin(chunk)); it; ++it ) {
1279  }
1280  return count;
1281 }
1282 
1283 
User-defined methods of the data storage class.
static void AddLoc(CRef< CSeq_loc > &loc, CRef< CSeq_loc > loc2)
Definition: Seq_loc.cpp:2297
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
Definition: base.hpp:115
C & NonConst(const C &c)
const string & GetName(void) const
Definition: annot_name.hpp:62
bool IsNamed(void) const
Definition: annot_name.hpp:58
CBioseq_Handle –.
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 &params)
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
CRef< CID2S_Seq_loc > MakeLoc(const CSeqsRange &range) const
CDelta_seq –.
Definition: Delta_seq.hpp:66
CFeat_id –.
Definition: Feat_id.hpp:66
void AddRange(const CSeq_id_Handle &h, const TRange &range, ENa_strand strand)
bool empty(void) const
CID2S_Bioseq_Ids –.
CID2S_Bioseq_place_Info –.
CID2S_Bioseq_set_Ids –.
CID2S_Chunk_Content –.
CID2S_Chunk_Data –.
CID2S_Chunk_Id –.
CID2S_Chunk_Info –.
CID2S_Chunk –.
Definition: ID2S_Chunk.hpp:66
CID2S_Feat_type_Info –.
CID2S_Gi_Interval –.
CID2S_Gi_Ints –.
CID2S_Interval –.
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_Seq_id_Ints –.
CID2S_Seq_loc –.
CID2S_Sequence_Piece –.
CID2S_Split_Info –.
CObject –.
Definition: ncbiobj.hpp:180
void Add(const COneSeqRange &range)
Definition: id_range.cpp:71
bool IsBioseq_set(void) const
Definition: place_id.hpp:71
bool IsBioseq(void) const
Definition: place_id.hpp:67
TBioseq_setId GetBioseq_setId(void) const
Definition: place_id.hpp:81
const TBioseqId & GetBioseqId(void) const
Definition: place_id.hpp:76
CRef –.
Definition: ncbiobj.hpp:618
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.
Definition: Seq_descr.hpp:55
Definition: Seq_entry.hpp:56
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
void Add(const CSeq_id_Handle &id, const COneSeqRange &loc)
Definition: id_range.cpp:131
void AddChunk(const CID2S_Chunk_Id &id, const CID2S_Chunk &chunk)
Definition: split_blob.cpp:100
void Reset(void)
Definition: split_blob.cpp:76
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
const_iterator end() const
Definition: map.hpp:152
void clear()
Definition: map.hpp:169
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: set.hpp:45
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
#define C(s)
Definition: common.h:231
#define false
Definition: bool.h:36
static int type
Definition: getdata.c:31
static const struct type types[]
Definition: type.c:22
char data[12]
Definition: iconv.c:80
#define GI_FROM(T, value)
Definition: ncbimisc.hpp:1086
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
#define ZERO_GI
Definition: ncbimisc.hpp:1088
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.
Definition: netstorage.hpp:86
const string AsFastaString(void) const
Definition: Seq_id.cpp:2266
CConstRef< CSeq_id > GetSeqId(void) const
bool IsGi(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
TGi GetGi(void) const
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
Definition: iterator.hpp:1012
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
TSeqPos GetBioseqLength(void) const
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
TObjectType & GetNCObject(void) const
Get object.
Definition: ncbiobj.hpp:1187
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
CTempString literal(const char(&str)[Size])
Templatized initialization from a string literal.
Definition: tempstr.hpp:441
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
Definition: ID2S_Chunk_.hpp:90
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.
Definition: Seq_feat_.hpp:1452
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_feat_.hpp:904
const TLocal & GetLocal(void) const
Get the variant data.
Definition: Feat_id_.cpp:134
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
Definition: Seq_feat_.hpp:1296
E_Choice
Choice variants.
bool IsLocal(void) const
Check if variant Local is selected.
Definition: Feat_id_.hpp:353
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
list< CRef< CFeat_id > > TIds
Definition: Seq_feat_.hpp:126
bool IsSetIds(void) const
set of Ids; will replace 'id' field Check if a value has been assigned to Ids data member.
Definition: Seq_feat_.hpp:1440
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
Definition: Seq_feat_.hpp:892
const TXref & GetXref(void) const
Get the Xref member data.
Definition: Seq_feat_.hpp:1308
vector< CRef< CSeqFeatXref > > TXref
Definition: Seq_feat_.hpp:122
@ e_not_set
No variant selected.
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_id_.hpp:746
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
TLiteral & SetLiteral(void)
Select the variant.
Definition: Delta_seq_.cpp:130
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
list< CRef< CSeqdesc > > Tdata
Definition: Seq_descr_.hpp:91
list< CRef< CSeq_align > > TAssembly
Definition: Seq_hist_.hpp:248
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
Definition: Seq_inst_.hpp:805
const TGraph & GetGraph(void) const
Get the variant data.
Definition: Seq_annot_.hpp:661
void SetName(const TName &value)
Assign a value to Name data member.
Definition: Seq_annot_.hpp:814
list< CRef< CSeq_graph > > TGraph
Definition: Seq_annot_.hpp:195
void SetDesc(TDesc &value)
Assign a value to Desc data member.
Definition: Seq_annot_.cpp:223
void SetExt(TExt &value)
Assign a value to Ext data member.
Definition: Seq_inst_.cpp:147
const TName & GetName(void) const
Get the Name member data.
Definition: Seq_annot_.hpp:805
list< CRef< CAnnot_id > > TId
Definition: Seq_annot_.hpp:356
const TLiteral & GetLiteral(void) const
Get the variant data.
Definition: Delta_seq_.cpp:124
bool IsSetName(void) const
source if "other" above Check if a value has been assigned to Name data member.
Definition: Seq_annot_.hpp:793
const TId & GetId(void) const
Get the Id member data.
Definition: Bioseq_.hpp:290
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
Definition: Seq_inst_.hpp:826
list< CRef< CSeq_align > > TAlign
Definition: Seq_annot_.hpp:194
const Tdata & Get(void) const
Get the member data.
Definition: Seq_descr_.hpp:166
bool IsSetDb(void) const
Check if a value has been assigned to Db data member.
Definition: Seq_annot_.hpp:746
const TDesc & GetDesc(void) const
Get the Desc member data.
Definition: Seq_annot_.hpp:852
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
bool IsSetDesc(void) const
used only for stand alone Seq-annots Check if a value has been assigned to Desc data member.
Definition: Seq_annot_.hpp:840
const TAlign & GetAlign(void) const
Get the variant data.
Definition: Seq_annot_.hpp:641
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
Definition: Seq_annot_.hpp:721
void SetDb(TDb value)
Assign a value to Db data member.
Definition: Seq_annot_.hpp:774
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_inst_.hpp:838
E_Choice Which(void) const
Which variant is currently selected.
Definition: Delta_seq_.hpp:228
TDb GetDb(void) const
Get the Db member data.
Definition: Seq_annot_.hpp:765
const TSeq_table & GetSeq_table(void) const
Get the variant data.
Definition: Seq_annot_.cpp:153
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_annot_.hpp:733
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_ext_.hpp:289
const TFtable & GetFtable(void) const
Get the variant data.
Definition: Seq_annot_.hpp:621
list< CRef< CSeq_feat > > TFtable
Definition: Seq_annot_.hpp:193
bool IsFtable(void) const
Check if variant Ftable is selected.
Definition: Seq_annot_.hpp:615
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_annot_.hpp:873
Tdata & Set(void)
Assign a value to data member.
Definition: Seq_descr_.hpp:172
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
Definition: Delta_ext_.hpp:89
TId & SetId(void)
Assign a value to Id data member.
Definition: Seq_annot_.hpp:739
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
Definition: Seq_inst_.cpp:130
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_annot_.hpp:586
@ e_MaxChoice
== e_Modelev+1
Definition: Seqdesc_.hpp:139
@ e_Literal
a piece of sequence
Definition: Delta_seq_.hpp:90
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
int i
int len
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
EIPRangeType t
Definition: ncbi_localip.c:101
ENetStorageObjectLocation TLocation
Int4 delta(size_t dimension_, const Int4 *score_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
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)
vector< CBioseq_SplitInfo > TPlaceBioseq
Definition: chunk_info.hpp:74
vector< CSeq_data_SplitInfo > TPlaceSeq_data
Definition: chunk_info.hpp:72
vector< CSeq_hist_SplitInfo > TPlaceSeq_hist
Definition: chunk_info.hpp:76
vector< CSeq_descr_SplitInfo > TPlaceSeq_descr
Definition: chunk_info.hpp:67
Definition: type.c:6
#define _ASSERT
Modified on Wed Apr 17 13:08:28 2024 by modify_doxy.py rev. 669887