NCBI C++ ToolKit
annot_collector.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef ANNOT_COLLECTOR__HPP
2 #define ANNOT_COLLECTOR__HPP
3 
4 /* $Id: annot_collector.hpp 78316 2017-06-09 19:21:33Z vasilche $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Aleksey Grichenko, Michael Kimelman, Eugene Vasilchenko
30 *
31 * File Description:
32 * Annotation collector for annot iterators
33 *
34 */
35 
36 #include <corelib/ncbiobj.hpp>
37 #include <corelib/ncbimtx.hpp>
39 #include <objmgr/tse_handle.hpp>
44 
49 
50 #include <set>
51 #include <vector>
52 #include <memory>
53 
55 
57 
58 class CHandleRangeMap;
59 class CHandleRange;
60 struct SAnnotObject_Index;
61 class CSeq_entry_Info;
62 class CSeq_annot_Info;
65 class CSeqTableInfo;
66 struct SSNP_Info;
67 struct SIdAnnotObjs;
70 class CSeq_feat_Handle;
71 class CMappedFeat;
72 class CAnnot_CI;
73 class CSeqMap_CI;
74 class CGraphRanges;
75 
77 {
78 public:
79  enum FMappedFlags {
80  fMapped_Partial = 1<<0,
81  fMapped_Product = 1<<1,
82  fMapped_Seq_point = 1<<2,
83  fMapped_Partial_from = 1<<3,
84  fMapped_Partial_to = 1<<4,
85  fFromOtherTSE = 1<<5
86  };
87 
95  eMappedObjType_Seq_loc_Conv_Set
96  };
97 
98  CAnnotMapping_Info(void);
99  CAnnotMapping_Info(Int1 mapped_flags, Int1 mapped_type, Int1 mapped_strand);
100 
101  void Reset(void);
102 
103  Int1 GetMappedFlags(void) const;
104  bool IsMapped(void) const;
105  bool IsPartial(void) const;
106  bool IsProduct(void) const;
107  EMappedObjectType GetMappedObjectType(void) const;
108 
109  void SetPartial(bool value);
110  void SetProduct(bool product);
111 
112  bool IsMappedLocation(void) const;
113  bool IsMappedProduct(void) const;
114  bool IsMappedPoint(void) const;
115 
117 
118  TSeqPos GetFrom(void) const;
119  TSeqPos GetToOpen(void) const;
120  const TRange& GetTotalRange(void) const;
121  void SetTotalRange(const TRange& range);
122 
123  const CSeq_id* GetLocationId(void) const;
124  const CSeq_id* GetProductId(void) const;
125 
126  ENa_strand GetMappedStrand(void) const;
127  void SetMappedStrand(ENa_strand strand);
128 
129  bool IsFromOtherTSE(void) const;
130  void SetFromOtherTSE(bool from_other_tse = true);
131 
132  const CSeq_loc& GetMappedSeq_loc(void) const;
133  const CSeq_id& GetMappedSeq_id(void) const;
134  CSeq_loc_Conversion& GetMappedSeq_loc_Conv(void) const;
135  const CSeq_feat& GetMappedSeq_feat(void) const;
136  const CSeq_align& GetMappedSeq_align(const CSeq_align& orig) const;
137 
138  void SetMappedSeq_loc(CSeq_loc& loc);
139  void SetMappedSeq_loc(CSeq_loc* loc);
140  void SetMappedSeq_id(CSeq_id& id);
141  void SetMappedPoint(bool point);
142  void SetMappedPartial_from(void);
143  void SetMappedPartial_to(void);
144  void SetMappedSeq_id(CSeq_id& id, bool point);
145  void SetMappedConverstion(CSeq_loc_Conversion& cvt);
146  void SetMappedSeq_feat(CSeq_feat& feat);
147  void SetMappedSeq_align(CSeq_align* align);
148  void SetMappedSeq_align_Cvts(CSeq_loc_Conversion_Set& cvts);
149 
150  void SetGraphRanges(CGraphRanges* ranges);
151  const CGraphRanges* GetGraphRanges(void) const;
152 
153  bool MappedSeq_locNeedsUpdate(void) const;
154  void UpdateMappedSeq_loc(CRef<CSeq_loc>& loc,
155  CRef<CSeq_point>& pnt_ref,
156  CRef<CSeq_interval>& int_ref,
157  const CSeq_feat* orig_feat) const;
158 
159  // Copy non-modified members from original feature
160  // (all except partial flag and location/product, depending on mode.
161  void InitializeMappedSeq_feat(const CSeq_feat& src, CSeq_feat& dst) const;
162 
163  void SetAnnotObjectRange(const TRange& range, bool product);
164 
165  void Swap(CAnnotMapping_Info& info);
166 
167 private:
168  CRef<CObject> m_MappedObject; // master sequence coordinates
169  TRange m_TotalRange;
170  Int1 m_MappedFlags; // partial, product
174 };
175 
176 
178 {
179 public:
181  typedef Int4 TAnnotIndex;
182  enum EAnnotType {
183  fAnnot_NoAnnotInfo = 1<<0,
184  fAnnot_SNPTable = 1<<1,
185  fAnnot_SeqTable = 1<<2,
186 
187  eAnnot_Regular = 0,
188  eAnnot_SNPTable = fAnnot_NoAnnotInfo | fAnnot_SNPTable,
189  eAnnot_SeqTable = fAnnot_SeqTable,
190  eAnnot_SortedSeqTable = fAnnot_NoAnnotInfo | fAnnot_SeqTable,
191  };
192 
193  CAnnotObject_Ref(void);
194  CAnnotObject_Ref(const CAnnotObject_Info& object,
195  const CSeq_annot_Handle& annot_handle);
196  CAnnotObject_Ref(const CSeq_annot_SNP_Info& snp_annot,
197  const CSeq_annot_Handle& annot_handle,
198  const SSNP_Info& snp_info,
199  CSeq_loc_Conversion* cvt);
200  CAnnotObject_Ref(const CSeq_annot_Handle& annot_handle,
201  const CSeq_annot_SortedIter& iter,
202  CSeq_loc_Conversion* cvt);
203 
204  // the annotation has CAnnotObject_Info object and entry in annot index
205  bool HasAnnotObject_Info(void) const;
206  // the annotation has CSeq_feat, CAnnotObject_Info, and annot index
207  bool IsPlainFeat(void) const;
208 
209  // the feature is from parsed SNP table (GenBank SNP external annotations)
210  // it doesn't have corresponding CAnnotObject_Info and entry in annot index
211  bool IsSNPTableFeat(void) const;
212  // the feature is from Seq-table
213  // it may or may not have corresponding CAnnotObject_Info and annot index
214  bool IsAnySeqTableFeat(void) const;
215  // the feature is from pre-sorted Seq-table
216  // it doesn't have corresponding CAnnotObject_Info and entry in annot index
217  bool IsSortedSeqTableFeat(void) const;
218 
219  // replaced with IsSNPTableFeat() and IsSortedSeqTableFeat()
220  NCBI_DEPRECATED bool IsSNPFeat(void) const;
221  // replaced with IsAnySeqTableFeat() and IsSortedSeqTableFeat()
222  NCBI_DEPRECATED bool IsTableFeat(void) const;
223 
224  const CSeq_annot_Handle& GetSeq_annot_Handle(void) const;
225  const CSeq_annot_Info& GetSeq_annot_Info(void) const;
226  const CSeq_annot_SNP_Info& GetSeq_annot_SNP_Info(void) const;
227  const CSeqTableInfo& GetSeqTableInfo(void) const;
228  TAnnotIndex GetAnnotIndex(void) const;
229 
230  const CAnnotObject_Info& GetAnnotObject_Info(void) const;
231  const SSNP_Info& GetSNP_Info(void) const;
232 
233  bool IsFeat(void) const;
234  bool IsGraph(void) const;
235  bool IsAlign(void) const;
236  const CSeq_feat& GetFeat(void) const;
237  const CSeq_graph& GetGraph(void) const;
238  const CSeq_align& GetAlign(void) const;
239 
240  CAnnotMapping_Info& GetMappingInfo(void) const;
241 
242  bool IsFromOtherTSE(void) const;
243  void SetFromOtherTSE(bool from_other_tse = true);
244 
245  void ResetLocation(void);
246  bool operator<(const CAnnotObject_Ref& ref) const; // sort by object
247  bool operator==(const CAnnotObject_Ref& ref) const; // sort by object
248  bool operator!=(const CAnnotObject_Ref& ref) const; // sort by object
249 
250  void Swap(CAnnotObject_Ref& ref);
251 
252 private:
253  friend class CAnnot_Collector;
254 
256  mutable CAnnotMapping_Info m_MappingInfo; // 20 or 32
257  TAnnotIndex m_AnnotIndex; // 4 or 4
259  // total size:
260  // 32 B on 32-bit system (can be packed into 28 B)
261  // 48 B on 64-bit system (can be packed into 40 B)
262 };
263 
264 
265 class CCreatedFeat_Ref : public CObject
266 {
267 public:
268  CCreatedFeat_Ref(void);
269  ~CCreatedFeat_Ref(void);
270 
271  void ResetRefs(void);
272  void ReleaseRefsTo(CRef<CSeq_feat>* feat,
273  CRef<CSeq_loc>* loc,
274  CRef<CSeq_point>* point,
275  CRef<CSeq_interval>* interval);
276  void ResetRefsFrom(CRef<CSeq_feat>* feat,
277  CRef<CSeq_loc>* loc,
278  CRef<CSeq_point>* point,
279  CRef<CSeq_interval>* interval);
280 
283  const CSeq_feat& orig_feat);
285  const CMappedFeat& feat);
287  const CSeq_feat& orig_feat);
289  const CMappedFeat& feat);
290 private:
295 };
296 
297 
298 class CSeq_annot_Handle;
299 
300 
302 
303 
305 {
306 public:
308  typedef vector<CAnnotObject_Ref> TAnnotSet;
309 
310  CAnnot_Collector(CScope& scope);
311  ~CAnnot_Collector(void);
312 
313 private:
316 
317 
318  const TAnnotSet& GetAnnotSet(void) const;
319  CScope& GetScope(void) const;
320 
321  const SAnnotSelector& GetSelector(void) const;
322  bool CanResolveId(const CSeq_id_Handle& idh, const CBioseq_Handle& bh);
323 
324  void x_Initialize0(const SAnnotSelector& selector);
325  void x_Initialize(const SAnnotSelector& selector,
326  const CBioseq_Handle& bioseq,
327  const CRange<TSeqPos>& range,
328  ENa_strand strand);
329  void x_Initialize(const SAnnotSelector& selector,
330  const CHandleRangeMap& master_loc);
331  void x_Initialize(const SAnnotSelector& selector);
332  void x_GetTSE_Info(void);
333 
334  // Search annotations directly referencing the master sequence.
335  // The master_range specifies region of master sequence to search.
336  // Called by: x_Initialize()
337  // Calls: x_SearchTSE()
338  void x_SearchMaster(const CBioseq_Handle& bh,
339  const CSeq_id_Handle& master_id,
340  const CHandleRange& master_range);
341 
342  // Collect segment conversions used by correspondging x_SearchSegments().
343  // Called by: x_Initialize()
344  void x_CollectSegments(const CBioseq_Handle& bh,
345  const CSeq_id_Handle& master_id,
346  const CHandleRange& master_range,
347  CSeq_loc& master_loc_empty,
348  int level,
349  CSeq_loc_Conversion_Set& cvt_set);
350 
351  // Search annotations referencing sequence segments on level 'level'.
352  // The master_range specifies region of master sequence to search.
353  // The master_loc_empty is empty Seq-loc with master Seq-id for sharing.
354  // Called by: x_Initialize()
355  bool x_SearchSegments(const CBioseq_Handle& bh,
356  const CSeq_id_Handle& master_id,
357  const CHandleRange& master_range,
358  CSeq_loc& master_loc_empty,
359  int level);
360 
361  // Collect segment conversions used by correspondging x_SearchSegments().
362  // Called by: x_Initialize()
363  void x_CollectSegments(const CHandleRangeMap& master_loc,
364  int level,
365  CSeq_loc_Conversion_Set& cvt_set);
366 
367  // Search annotations referencing complex sequence location
368  // on level 'level'.
369  // The master_loc_empty is empty Seq-loc with master Seq-id for sharing.
370  // Called by: x_Initialize()
371  // Calls: x_SearchMapped()
372  bool x_SearchSegments(const CHandleRangeMap& master_loc,
373  int level);
374 
375  // Collect conversion that is used by corresponding x_SearchMapped().
376  // Called by: x_CollectSegments()
377  void x_CollectMapped(const CSeqMap_CI& seg,
378  CSeq_loc& master_loc_empty,
379  const CSeq_id_Handle& master_id,
380  const CHandleRange& master_hr,
381  CSeq_loc_Conversion_Set& cvt_set);
382 
383  // Search annotations directly referencing segment of master sequence.
384  // The master_loc_empty is empty Seq-loc with master Seq-id for sharing.
385  // The master_hr specifies region of master sequence to search.
386  // Called by: x_SearchSegments()
387  // Calls: x_SearchLoc()
388  bool x_SearchMapped(const CSeqMap_CI& seg,
389  CSeq_loc& master_loc_empty,
390  const CSeq_id_Handle& master_id,
391  const CHandleRange& master_hr);
392 
393  // Search annotations directly on a complex sequence location with mapping.
394  // The optional mapping is in agument 'cvt'.
395  // The method finds relevant set of TSEs and calls x_SearchTSE() for each.
396  // Called by: x_SearchMapped(), x_SearchRange()
397  // Calls: x_SearchTSE()
398  bool x_SearchLoc(const CHandleRangeMap& loc,
399  CSeq_loc_Conversion* cvt,
400  const CTSE_Handle* using_tse,
401  bool top_level = false);
402 
403  CBioseq_Handle x_GetBioseqHandle(const CSeq_id_Handle& id,
404  bool top_level = false) const;
405  // returns if adaptive depth heuristics should be checked for a segment
406  bool x_CheckAdaptive(const CSeq_id_Handle& id) const;
407  bool x_CheckAdaptive(const CBioseq_Handle& bh) const;
408 
409  // Search annotations within tse before filtering by source location.
410  // Called by: x_SearchLoc(), x_SearchMaster()
411  // Calls: x_SearchTSE2()
412  bool x_SearchTSE(const CTSE_Handle& tse,
413  const CSeq_id_Handle& id,
414  const CHandleRange& hr,
415  CSeq_loc_Conversion* cvt,
416  bool check_adaptive);
417 
418  // Search annotations within tse after filtering by source location.
419  // Called by: x_SearchTSE()
420  // Calls: x_SearchObjects()
421  bool x_SearchTSE2(const CTSE_Handle& tse,
422  const CSeq_id_Handle& id,
423  const CHandleRange& hr,
424  CSeq_loc_Conversion* cvt,
425  bool check_adaptive);
426 
427  // Called by: x_SearchTSE2()
428  // Calls: x_SearchRange()
429  void x_SearchObjects(const CTSE_Handle& tse,
430  const SIdAnnotObjs* objs,
431  CMutexGuard& guard,
432  const CAnnotName& name,
433  const CSeq_id_Handle& id,
434  const CHandleRange& hr,
435  CSeq_loc_Conversion* cvt);
436 
437  // Called by: x_SearchObjects()
438  // Calls: x_SearchLoc() for annotations of type locs.
439  void x_SearchRange(const CTSE_Handle& tse,
440  const SIdAnnotObjs* objs,
441  CMutexGuard& guard,
442  const CAnnotName& name,
443  const CSeq_id_Handle& id,
444  const CHandleRange& hr,
445  CSeq_loc_Conversion* cvt);
446 
447  // The x_SearchAll() is set of methods to search for annotations without
448  // specified location. They collect all matching annotations contained
449  // in argument object (Seq-entry or Seq-annot).
450  void x_SearchAll(void);
451  void x_SearchAll(const CSeq_entry_Info& entry_info);
452  void x_SearchAll(const CSeq_annot_Info& annot_info);
453 
454  // Order collected annotations by requested criteria.
455  void x_Sort(void);
456 
457  void x_AddObjectMapping(CAnnotObject_Ref& object_ref,
458  CSeq_loc_Conversion* cvt,
459  unsigned int loc_index);
460  void x_AddObject(CAnnotObject_Ref& object_ref);
461  void x_AddObject(CAnnotObject_Ref& object_ref,
462  CSeq_loc_Conversion* cvt,
463  unsigned int loc_index);
464 
465  // Release all locked resources TSE etc
466  void x_ReleaseAll(void);
467 
468  bool x_NeedSNPs(void) const;
469  bool x_MatchLimitObject(const CAnnotObject_Info& annot_info) const;
470  bool x_MatchRange(const CHandleRange& hr,
471  const CRange<TSeqPos>& range,
472  const SAnnotObject_Index& index) const;
473  bool x_MatchLocIndex(const SAnnotObject_Index& index) const;
474 
475  bool x_NoMoreObjects(void) const;
476 
477  void x_AddPostMappings(void);
478  void x_AddPostMappingsCvt(CSeq_loc_Conversion_Set& cvt);
479  void x_AddTSE(const CTSE_Handle& tse);
480 
481  CConstRef<CSerialObject> x_GetMappedObject(const CAnnotObject_Ref& obj);
482 
483  // Set of processed annot-locs to avoid duplicates
486  typedef vector<CSeq_annot_Handle> TAnnotLocks;
489 
490  const TAnnotNames& x_GetAnnotNames(void) const;
491 
492  Uint8 x_GetCostOfLoadingInBytes(void) const;
493  double x_GetCostOfLoadingInSeconds(void) const;
494 
495  void x_StopSearchLimits(void);
497  {
498  return m_SearchSegments == 0;
499  }
500 
503  // TSE set to keep all the TSEs locked
504  TTSE_LockMap m_TSE_LockMap;
505  auto_ptr<CAnnotMappingCollector> m_MappingCollector;
506  // Set of all the annotations found
507  TAnnotSet m_AnnotSet;
508 
509  // Temporary objects to be re-used by iterators
512 
513  auto_ptr<TAnnotLocsSet> m_AnnotLocsSet;
514  TAnnotTypesBitset m_AnnotTypes;
515  TAnnotTypesBitset m_TriggerTypes;
516  TAnnotTypesBitset m_UnseenAnnotTypes;
517  TAnnotTypesBitset m_CollectAnnotTypes;
518  mutable auto_ptr<TAnnotNames> m_AnnotNames;
521 
525  TMaxSearchSegments m_SearchSegments;
528 
529  friend class CAnnotTypes_CI;
530  friend class CMappedFeat;
531  friend class CMappedGraph;
532  friend class CAnnot_CI;
533  friend class CFeat_CI;
534 };
535 
536 
537 /////////////////////////////////////////////////////////////////////////////
538 // CAnnotMapping_Info
539 /////////////////////////////////////////////////////////////////////////////
540 
541 
542 inline
544  : m_MappedFlags(0),
545  m_MappedObjectType(eMappedObjType_not_set),
546  m_MappedStrand(eNa_strand_unknown)
547 {
548 }
549 
550 
551 inline
553  Int1 mapped_type,
554  Int1 mapped_strand)
555  : m_MappedFlags(mapped_flags),
556  m_MappedObjectType(mapped_type),
557  m_MappedStrand(mapped_strand)
558 {
559 }
560 
561 
562 inline
564 {
565  return m_TotalRange.GetFrom();
566 }
567 
568 
569 inline
571 {
572  return m_TotalRange.GetToOpen();
573 }
574 
575 
576 inline
579 {
580  return m_TotalRange;
581 }
582 
583 
584 inline
586 {
587  m_TotalRange = range;
588 }
589 
590 
591 inline
593 {
594  return (m_MappedFlags & fMapped_Partial) != 0;
595 }
596 
597 
598 inline
600 {
601  return (m_MappedFlags & fMapped_Product) != 0;
602 }
603 
604 
605 inline
607 {
608  return ENa_strand(m_MappedStrand);
609 }
610 
611 
612 inline
614 {
615  _ASSERT(IsMapped());
616  m_MappedStrand = strand;
617 }
618 
619 
620 inline
622 {
623  return m_MappedFlags;
624 }
625 
626 
627 inline
630 {
632 }
633 
634 
635 inline
637 {
639  !m_MappedObject);
641 }
642 
643 
644 inline
646 {
649 }
650 
651 
652 inline
654 {
655  return IsMapped() && !IsProduct();
656 }
657 
658 
659 inline
661 {
662  return IsMapped() && IsProduct();
663 }
664 
665 
666 inline
668 {
670  return IsProduct() ? GetMappedSeq_feat().GetProduct()
672  }
674  return static_cast<const CSeq_loc&>(*m_MappedObject);
675 }
676 
677 
678 inline
680 {
682  return static_cast<const CSeq_id&>(*m_MappedObject);
683 }
684 
685 
686 inline
688 {
690  return static_cast<const CSeq_feat&>(*m_MappedObject);
691 }
692 
693 
694 inline
696 {
697  _ASSERT(!IsMapped());
698  m_MappedObject.Reset(loc);
699  m_MappedObjectType = loc ?
701 }
702 
703 
704 inline
706 {
707  _ASSERT(!IsMapped());
708  m_MappedObject.Reset(&loc);
710 }
711 
712 
713 inline
715 {
716  _ASSERT(!IsMapped());
717  m_MappedObject.Reset(&id);
719 }
720 
721 
722 inline
724 {
726  if ( point ) {
728  }
729  else {
731  }
732 }
733 
734 
735 inline
737 {
740 }
741 
742 
743 inline
745 {
748 }
749 
750 
751 inline
753 {
755  return (m_MappedFlags & fMapped_Seq_point) != 0;
756 }
757 
758 
759 inline
761 {
762  SetMappedSeq_id(id);
763  SetMappedPoint(point);
764 }
765 
766 
767 inline
769 {
770  if ( partial ) {
772  }
773  else {
775  }
776 }
777 
778 
779 inline
781 {
782  if ( product ) {
784  }
785  else {
787  }
788 }
789 
790 
791 inline
793 {
794  return (m_MappedFlags & fFromOtherTSE) != 0;
795 }
796 
797 
798 inline
799 void CAnnotMapping_Info::SetFromOtherTSE(bool from_other_tse)
800 {
801  if ( from_other_tse ) {
803  }
804  else {
806  }
807 }
808 
809 
810 inline
811 void CAnnotMapping_Info::SetAnnotObjectRange(const TRange& range, bool product)
812 {
813  m_TotalRange = range;
814  SetProduct(product);
815 }
816 
817 
818 inline
820 {
827 }
828 
829 
830 /////////////////////////////////////////////////////////////////////////////
831 // CAnnotObject_Ref
832 /////////////////////////////////////////////////////////////////////////////
833 
834 
835 inline
837  : m_AnnotIndex(0), m_AnnotType(eAnnot_Regular)
838 {
839 }
840 
841 
842 inline
844 {
845  return m_AnnotIndex;
846 }
847 
848 
849 inline
851 {
852  return (m_AnnotType & fAnnot_NoAnnotInfo) == 0;
853 }
854 
855 
856 inline
858 {
859  return m_AnnotType == eAnnot_Regular;
860 }
861 
862 
863 inline
865 {
866  return m_AnnotType == eAnnot_SNPTable;
867 }
868 
869 
870 inline
872 {
874 }
875 
876 
877 inline
879 {
880  return (m_AnnotType & fAnnot_SeqTable) != 0;
881 }
882 
883 
884 inline
886 {
887  return IsSNPTableFeat();
888 }
889 
890 
891 inline
893 {
894  return IsAnySeqTableFeat();
895 }
896 
897 
898 inline
900 {
901  return m_Seq_annot;
902 }
903 
904 
905 inline
907 {
908  return m_Seq_annot.x_GetInfo();
909 }
910 
911 
912 inline
914 {
915  if ( m_Seq_annot != ref.m_Seq_annot ) {
917  }
918  if ( m_AnnotType != ref.m_AnnotType ) {
919  return m_AnnotType < ref.m_AnnotType;
920  }
921  return m_AnnotIndex < ref.m_AnnotIndex;
922 }
923 
924 
925 inline
927 {
928  return (m_AnnotIndex == ref.m_AnnotIndex &&
929  m_AnnotType == ref.m_AnnotType &&
930  m_Seq_annot == ref.m_Seq_annot);
931 }
932 
933 
934 inline
936 {
937  return !(*this == ref);
938 }
939 
940 
941 inline
943 {
944  return m_MappingInfo;
945 }
946 
947 
948 inline
950 {
951  return m_MappingInfo.IsFromOtherTSE();
952 }
953 
954 
955 inline
956 void CAnnotObject_Ref::SetFromOtherTSE(bool from_other_tse)
957 {
958  m_MappingInfo.SetFromOtherTSE(from_other_tse);
959 }
960 
961 
962 /////////////////////////////////////////////////////////////////////////////
963 // CAnnot_Collector
964 /////////////////////////////////////////////////////////////////////////////
965 
966 
967 inline
970 {
971  return m_AnnotSet;
972 }
973 
974 
975 inline
977 {
978  return m_Scope.GetScope();
979 }
980 
981 
982 inline
984 {
985  return *m_Selector;
986 }
987 
988 
989 inline
991 {
996 }
997 
1000 
1001 
1003 inline
1006 {
1007  info1.Swap(info2);
1008 }
1009 
1010 
1011 inline
1012 void swap(NCBI_NS_NCBI::objects::CAnnotObject_Ref& ref1,
1013  NCBI_NS_NCBI::objects::CAnnotObject_Ref& ref2)
1014 {
1015  ref1.Swap(ref2);
1016 }
1017 
1019 
1020 #endif // ANNOT_COLLECTOR__HPP
BEGIN_STD_SCOPE void swap(NCBI_NS_NCBI::objects::CAnnotMapping_Info &info1, NCBI_NS_NCBI::objects::CAnnotMapping_Info &info2)
CBioseq_Handle –.
#define BEGIN_STD_SCOPE
Place it for adding new funtionality to STD scope.
Definition: ncbistl.hpp:90
CStopWatch –.
Definition: ncbitime.hpp:1891
Iterator over CSeqMap.
Definition: seq_map_ci.hpp:251
SAnnotSelector::TMaxSearchSegments TMaxSearchSegments
const SAnnotSelector * m_Selector
void SetMappedPoint(bool point)
TSeqPos GetToOpen(void) const
SAnnotSelector::TMaxSize TMaxSize
void SetMappedStrand(ENa_strand strand)
void Swap(CSeq_annot_Handle &annot)
CConstRef< CSeq_feat > GetMappedFeature(const CAnnotMapping_Info &map, const CSeq_feat &orig_feat)
unsigned NCBI_INT8_TYPE Uint8
Unsigned 8 byte sized integer.
Definition: ncbitype.h:146
signed int Int4
Alias for signed int.
Definition: ncbitype.h:120
TTSE_LockMap m_TSE_LockMap
void SetFromOtherTSE(bool from_other_tse=true)
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:73
void SetMappedPartial_from(void)
const CSeq_annot_Info & GetSeq_annot_Info(void) const
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:855
const CSeq_id & GetMappedSeq_id(void) const
CRange< TSeqPos > TRange
CRef< CCreatedFeat_Ref > m_CreatedOriginal
bool IsTableFeat(void) const
bool IsPlainFeat(void) const
TAnnotTypesBitset m_AnnotTypes
bool operator==(const CAnnotObject_Ref &ref) const
const TProduct & GetProduct(void) const
Get the Product member data.
Definition: Seq_feat_.hpp:1086
#define NCBI_XOBJMGR_EXPORT
Definition: ncbi_export.h:1290
TMaxSearchSegments m_SearchSegments
TAnnotTypesBitset m_TriggerTypes
void Swap(CAnnotObject_Ref &ref)
void SetAnnotObjectRange(const TRange &range, bool product)
CAnnotMapping_Info m_MappingInfo
void SetFromOtherTSE(bool from_other_tse=true)
bool IsSNPFeat(void) const
const CSeq_annot_Info & x_GetInfo(void) const
const NCBI_NS_NCBI::CEnumeratedTypeValues *ENUM_METHOD_NAME() ENa_strand(void)
Access to ENa_strand's attributes (values, names) as defined in spec.
SAnnotSelector –.
void Swap(T &a, T &b) RAPIDJSON_NOEXCEPT
Custom swap() to avoid dependency on C++ header.
Definition: swap.h:33
CAnnotMapping_Info & GetMappingInfo(void) const
set< CAnnotName > TAnnotNames
position_type GetToOpen(void) const
Definition: range.hpp:138
CSeq_annot::C_Data::E_Choice TAnnotType
bool IsFromOtherTSE(void) const
SAnnotSelector::TAnnotType TAnnotType
void SetPartial(bool value)
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1107
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
void SetMappedSeq_loc(CSeq_loc &loc)
bool MappedSeq_locNeedsUpdate(void) const
auto_ptr< TAnnotLocsSet > m_AnnotLocsSet
#define NCBI_NS_NCBI
Define the name for the NCBI namespace.
Definition: ncbistl.hpp:87
CRef< CCreatedFeat_Ref > m_CreatedMapped
CAnnot_CI –.
Definition: annot_ci.hpp:58
CRange< TSeqPos > TRange
CFeat_CI –.
Definition: feat_ci.hpp:63
bool OrderedBefore(const CSeq_annot_Handle &annot) const
More stable comparison - takes loading order in account.
bool IsFromOtherTSE(void) const
bool IsPartial(void) const
bool IsMappedLocation(void) const
CRef< CSeq_point > m_CreatedSeq_point
TAnnotTypesBitset m_UnseenAnnotTypes
bitset< CSeqFeatData::eSubtype_max+3 > TAnnotTypesBitset
vector< CAnnotObject_Ref > TAnnotSet
CScope & GetScope()
Definition: wgs_utils.cpp:48
CSeq_annot_Handle –.
SAnnotSelector::EMaxSearchSegmentsAction m_SearchSegmentsAction
Int1 GetMappedFlags(void) const
CRef< CSeq_interval > m_CreatedSeq_interval
void SetTotalRange(const TRange &range)
bool IsProduct(void) const
void Swap(CAnnotMapping_Info &info)
TAnnotIndex GetAnnotIndex(void) const
Definition: map.hpp:337
Helper class for mapping graphs.
map< const CTSE_Info *, CTSE_Handle > TTSE_LockMap
vector< CSeq_annot_Handle > TAnnotLocks
static MDB_envinfo info
Definition: mdb_load.c:37
const TAnnotSet & GetAnnotSet(void) const
const CSeq_loc & GetMappedSeq_loc(void) const
char value[7]
Definition: config.c:428
bool operator!=(const _Ht_iterator< _Val, _Nonconst_traits< _Val >, _Key, _HF, _ExK, _EqK, _All > &__x, const _Ht_iterator< _Val, _Const_traits< _Val >, _Key, _HF, _ExK, _EqK, _All > &__y)
Definition: _hashtable.h:173
bool operator<(const CEquivRange &A, const CEquivRange &B)
Definition: equiv_range.cpp:90
void Swap(TThisType &ref)
Swaps the pointer with another reference.
Definition: ncbiobj.hpp:749
void SetMappedPartial_to(void)
CRef< CSeq_loc > m_CreatedSeq_loc
CRef< CSeq_loc > GetMappedLocation(const CAnnotMapping_Info &map, const CSeq_feat &orig_feat)
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx...
bool IsSortedSeqTableFeat(void) const
position_type GetFrom(void) const
Definition: range.hpp:134
bool IsMappedProduct(void) const
TAnnotIndex m_AnnotIndex
bool x_MaxSearchSegmentsLimitIsReached(void) const
CScope –.
Definition: scope.hpp:90
CScope & GetScope(void) const
Definition: heap_scope.cpp:68
void SetMappedSeq_id(CSeq_id &id)
signed char Int1
Alias for signed char.
Definition: ncbitype.h:116
auto_ptr< TAnnotNames > m_AnnotNames
Multi-threading – mutexes; rw-locks; semaphore.
CObject –.
Definition: ncbiobj.hpp:180
#define END_STD_SCOPE
End previously defined STD scope.
Definition: ncbistl.hpp:93
EMappedObjectType GetMappedObjectType(void) const
SAnnotSelector::TAnnotTypesBitset TAnnotTypesBitset
CScope & GetScope(void) const
CRef< CSeq_feat > m_CreatedSeq_feat
TSeqPos GetFrom(void) const
bool IsSNPTableFeat(void) const
CMappedGraph –.
Definition: graph_ci.hpp:60
#define _ASSERT
bool HasAnnotObject_Info(void) const
void SetProduct(bool product)
void ReleaseRefsTo(CRef< CSeq_feat > *feat, CRef< CSeq_loc > *loc, CRef< CSeq_point > *point, CRef< CSeq_interval > *interval)
namespace ncbi::objects::
Definition: Seq_feat.hpp:56
CConstRef< CSeq_feat > GetOriginalFeature(const CSeq_feat_Handle &feat_h)
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:70
ENa_strand GetMappedStrand(void) const
#define NCBI_DEPRECATED
Definition: ncbiconf_msvc.h:71
bool operator==(const CEquivRange &A, const CEquivRange &B)
Definition: equiv_range.cpp:86
unsigned TMaxSearchSegments
const CSeq_feat & GetMappedSeq_feat(void) const
CSeq_feat_Handle –.
CRef< CObject > m_MappedObject
bool IsMappedPoint(void) const
bool IsMapped(void) const
CRef< CGraphRanges > m_GraphRanges
CObject & operator=(const CObject &src) THROWS_NONE
Assignment operator.
Definition: ncbiobj.hpp:483
const SAnnotSelector & GetSelector(void) const
bool IsAnySeqTableFeat(void) const
void ResetRefsFrom(CRef< CSeq_feat > *feat, CRef< CSeq_loc > *loc, CRef< CSeq_point > *point, CRef< CSeq_interval > *interval)
Definition: set.hpp:44
CSeq_annot_Handle m_Seq_annot
set< CConstRef< CSeq_loc > > TAnnotLocsSet
CMappedFeat –.
Definition: mapped_feat.hpp:58
bool operator<(const CAnnotObject_Ref &ref) const
auto_ptr< CAnnotMappingCollector > m_MappingCollector
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
TAnnotTypesBitset m_CollectAnnotTypes
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:768
const CSeq_annot_Handle & GetSeq_annot_Handle(void) const
const TRange & GetTotalRange(void) const
bool operator!=(const CAnnotObject_Ref &ref) const
Modified on Sun Dec 17 15:51:21 2017 by modify_doxy.py rev. 546573