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

Go to the SVN repository for this file.

1 /* $Id: seq_loc_mapper.cpp 87350 2019-08-21 15:03:00Z 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: Aleksey Grichenko
27 *
28 * File Description:
29 * Seq-loc mapper
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
35 #include <objmgr/scope.hpp>
38 #include <objmgr/seq_map.hpp>
39 #include <objmgr/seq_map_ci.hpp>
40 #include <objmgr/impl/synonyms.hpp>
54 #include <objects/seq/Seq_ext.hpp>
55 #include <objects/seq/Seq_gap.hpp>
56 #include <algorithm>
57 
58 
61 
62 
63 /////////////////////////////////////////////////////////////////////
64 //
65 // CScope_Mapper_Sequence_Info
66 //
67 // Sequence type/length/synonyms provider using CScope to fetch
68 // the information.
69 
70 
72 {
73 public:
75 
76  virtual TSeqType GetSequenceType(const CSeq_id_Handle& idh);
77  virtual TSeqPos GetSequenceLength(const CSeq_id_Handle& idh);
78  virtual void CollectSynonyms(const CSeq_id_Handle& id,
79  TSynonyms& synonyms);
80 private:
82 };
83 
84 
86  : m_Scope(scope)
87 {
88 }
89 
90 
93  TSynonyms& synonyms)
94 {
95  if ( m_Scope.IsNull() ) {
96  synonyms.insert(id);
97  }
98  else {
101  ITERATE(CSynonymsSet, syn_it, *syns) {
102  synonyms.insert(CSynonymsSet::GetSeq_id_Handle(syn_it));
103  }
104  }
105 }
106 
107 
110 {
111  if ( m_Scope.IsNull() ) {
113  }
114  switch ( m_Scope.GetScope().GetSequenceType(idh) ) {
115  case CSeq_inst::eMol_dna:
116  case CSeq_inst::eMol_rna:
117  case CSeq_inst::eMol_na:
119  case CSeq_inst::eMol_aa:
121  default:
123  }
124 }
125 
126 
128 {
129  CBioseq_Handle h;
130  if ( m_Scope.IsNull() ) {
131  return kInvalidSeqPos;
132  }
133  h = m_Scope.GetScope().GetBioseqHandle(idh);
134  return h ? h.GetBioseqLength() : kInvalidSeqPos;
135 }
136 
137 
138 /////////////////////////////////////////////////////////////////////
139 //
140 // CSeq_loc_Mapper
141 //
142 
143 
144 /////////////////////////////////////////////////////////////////////
145 //
146 // Initialization of the mapper
147 //
148 
149 
150 inline
152 {
153  _ASSERT(idx != 0);
154  return ENa_strand(idx - 1);
155 }
156 
157 #define STRAND_TO_INDEX(is_set, strand) \
158  ((is_set) ? size_t((strand) + 1) : 0)
159 
160 #define INDEX_TO_STRAND(idx) \
161  s_IndexToStrand(idx)
162 
163 
165 {
166  if (!options.GetMapperSequenceInfo()) {
168  }
169  return options;
170 }
171 
172 
174  CScope* scope,
175  CSeq_loc_Mapper_Options options)
176  : CSeq_loc_Mapper_Base(mapping_ranges, SetOptionsScope(options, scope)),
177  m_Scope(scope)
178 {
179 }
180 
181 
183  EFeatMapDirection dir,
184  CScope* scope,
185  CSeq_loc_Mapper_Options options)
186  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
187  m_Scope(scope)
188 {
189  x_InitializeFeat(map_feat, dir);
190 }
191 
192 
194  const CSeq_loc& target,
195  CScope* scope,
196  CSeq_loc_Mapper_Options options)
197  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
198  m_Scope(scope)
199 {
200  x_InitializeLocs(source, target);
201 }
202 
203 
205  const CSeq_id& to_id,
206  CScope* scope,
207  CSeq_loc_Mapper_Options options)
208  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
209  m_Scope(scope)
210 {
211  x_InitializeAlign(map_align, to_id);
212 }
213 
214 
216  size_t to_row,
217  CScope* scope,
218  CSeq_loc_Mapper_Options options)
219  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
220  m_Scope(scope)
221 {
222  x_InitializeAlign(map_align, to_row);
223 }
224 
225 
227  const CSeq_id& to_id,
228  const CSeq_align& map_align,
229  CScope* scope,
230  CSeq_loc_Mapper_Options options)
231  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
232  m_Scope(scope)
233 {
234  x_InitializeAlign(map_align, to_id, &from_id);
235 }
236 
237 
239  size_t to_row,
240  const CSeq_align& map_align,
241  CScope* scope,
242  CSeq_loc_Mapper_Options options)
243  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
244  m_Scope(scope)
245 {
246  x_InitializeAlign(map_align, to_row, from_row);
247 }
248 
249 
251  ESeqMapDirection direction,
252  CSeq_loc_Mapper_Options options)
253  : CSeq_loc_Mapper_Base(SetOptionsScope(options, &target_seq.GetScope())),
254  m_Scope(&target_seq.GetScope())
255 {
256  CConstRef<CSeq_id> top_level_id = target_seq.GetSeqId();
257  if ( !top_level_id ) {
258  // Bioseq handle has no id, try to get one.
259  CConstRef<CSynonymsSet> syns = target_seq.GetSynonyms();
260  if ( !syns->empty() ) {
261  top_level_id = syns->GetSeq_id_Handle(syns->begin()).GetSeqId();
262  }
263  }
264  x_InitializeSeqMap(target_seq.GetSeqMap(),
265  top_level_id.GetPointerOrNull(),
266  direction);
267  if (direction == eSeqMap_Up) {
268  // Ignore seq-map destination ranges, map whole sequence to itself,
269  // use unknown strand only.
270  m_DstRanges.resize(1);
271  m_DstRanges[0].clear();
272  m_DstRanges[0][CSeq_id_Handle::GetHandle(*top_level_id)]
273  .push_back(TRange::GetWhole());
274  }
276 }
277 
278 
280  ESeqMapDirection direction,
281  const CSeq_id* top_level_id,
282  CScope* scope,
283  CSeq_loc_Mapper_Options options)
284  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
285  m_Scope(scope)
286 {
287  x_InitializeSeqMap(seq_map, top_level_id, direction);
289 }
290 
291 
293  ESeqMapDirection direction,
294  SSeqMapSelector selector,
295  CSeq_loc_Mapper_Options options)
296  : CSeq_loc_Mapper_Base(SetOptionsScope(options, &target_seq.GetScope())),
297  m_Scope(&target_seq.GetScope())
298 {
299  CConstRef<CSeq_id> top_id = target_seq.GetSeqId();
300  if ( !top_id ) {
301  // Bioseq handle has no id, try to get one.
302  CConstRef<CSynonymsSet> syns = target_seq.GetSynonyms();
303  if ( !syns->empty() ) {
304  top_id = syns->GetSeq_id_Handle(syns->begin()).GetSeqId();
305  }
306  }
307  selector.SetLinkUsedTSE(target_seq.GetTSE_Handle());
308  x_InitializeSeqMap(target_seq.GetSeqMap(), selector, top_id, direction);
309  if (direction == eSeqMap_Up) {
310  // Ignore seq-map destination ranges, map whole sequence to itself,
311  // use unknown strand only.
312  m_DstRanges.resize(1);
313  m_DstRanges[0].clear();
315  .push_back(TRange::GetWhole());
316  }
318 }
319 
320 
322  ESeqMapDirection direction,
323  SSeqMapSelector selector,
324  const CSeq_id* top_level_id,
325  CScope* scope,
326  CSeq_loc_Mapper_Options options)
327  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
328  m_Scope(scope)
329 {
330  x_InitializeSeqMap(seq_map,
331  selector,
332  top_level_id,
333  direction);
335 }
336 
337 
339  const CBioseq_Handle& top_level_seq,
340  ESeqMapDirection direction,
341  CSeq_loc_Mapper_Options options)
342  : CSeq_loc_Mapper_Base(SetOptionsScope(options, &top_level_seq.GetScope())),
343  m_Scope(&top_level_seq.GetScope())
344 {
345  if (depth > 0) {
346  depth--;
347  x_InitializeSeqMap(top_level_seq.GetSeqMap(),
348  depth,
349  top_level_seq.GetSeqId().GetPointer(),
350  direction);
351  }
352  else if (direction == eSeqMap_Up) {
353  // Synonyms conversion
354  CConstRef<CSeq_id> top_level_id = top_level_seq.GetSeqId();
355  m_DstRanges.resize(1);
356  m_DstRanges[0][CSeq_id_Handle::GetHandle(*top_level_id)]
357  .push_back(TRange::GetWhole());
358  }
360 }
361 
362 
364  const CSeqMap& top_level_seq,
365  ESeqMapDirection direction,
366  const CSeq_id* top_level_id,
367  CScope* scope,
368  CSeq_loc_Mapper_Options options)
369  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
370  m_Scope(scope)
371 {
372  if (depth > 0) {
373  depth--;
374  x_InitializeSeqMap(top_level_seq, depth, top_level_id, direction);
375  }
376  else if (direction == eSeqMap_Up) {
377  // Synonyms conversion
378  m_DstRanges.resize(1);
379  m_DstRanges[0][CSeq_id_Handle::GetHandle(*top_level_id)]
380  .push_back(TRange::GetWhole());
381  }
383 }
384 
385 
387  EGCAssemblyAlias to_alias,
388  CScope* scope,
389  EScopeFlag scope_flag)
391  m_Scope(scope)
392 {
393  // While parsing GC-Assembly the mapper will need to add virtual
394  // bioseqs to the scope. To keep the original scope clean of them,
395  // create a new scope and add the original one as a child.
396  if (scope_flag == eCopyScope) {
398  if ( scope ) {
399  m_Scope.GetScope().AddScope(*scope);
400  }
402  }
403  x_InitGCAssembly(gc_assembly, to_alias);
404 }
405 
406 
408  ESeqMapDirection direction,
409  SSeqMapSelector selector,
410  CScope* scope,
411  EScopeFlag scope_flag,
412  CSeq_loc_Mapper_Options options)
413  : CSeq_loc_Mapper_Base(SetOptionsScope(options, scope)),
414  m_Scope(scope)
415 {
416  // While parsing GC-Assembly the mapper will need to add virtual
417  // bioseqs to the scope. To keep the original scope clean of them,
418  // create a new scope and add the original one as a child.
419  if (scope_flag == eCopyScope) {
421  if ( scope ) {
422  m_Scope.GetScope().AddScope(*scope);
423  }
425  }
426  CGC_Assembly_Parser parser(gc_assembly);
427  CRef<CSeq_entry> entry = parser.GetTSE();
432  if ( !h ) continue;
433  x_InitializeSeqMap(h.GetSeqMap(), selector, id->GetSeqId(), direction);
434  if (direction == eSeqMap_Up) {
435  // Ignore seq-map destination ranges, map whole sequence to itself,
436  // use unknown strand only.
437  m_DstRanges.resize(1);
438  m_DstRanges[0].clear();
439  m_DstRanges[0][*id].push_back(TRange::GetWhole());
440  }
442  }
443 }
444 
445 
447 {
448  return;
449 }
450 
451 
453  const CSeq_id* top_id,
454  ESeqMapDirection direction)
455 {
456  x_InitializeSeqMap(seq_map, size_t(-1), top_id, direction);
457 }
458 
459 
461  size_t depth,
462  const CSeq_id* top_id,
463  ESeqMapDirection direction)
464 {
465  x_InitializeSeqMap(seq_map,
467  top_id,
468  direction);
469 }
470 
471 
473  SSeqMapSelector selector,
474  const CSeq_id* top_id,
475  ESeqMapDirection direction)
476 {
478  .SetLinkUsedTSE();
480  m_Scope.GetScopeOrNull(), selector),
481  top_id,
482  direction);
483 }
484 
485 
487  const CSeq_id* top_id,
488  ESeqMapDirection direction)
489 {
491  x_InitializeSeqMapSingleLevel(seg_it, top_id, direction);
492  }
493  else if (direction == eSeqMap_Up) {
494  x_InitializeSeqMapUp(seg_it, top_id);
495  }
496  else {
497  x_InitializeSeqMapDown(seg_it, top_id);
498  }
499 }
500 
501 
503  const CSeq_id* top_id)
504 {
505  TSeqPos src_from, src_len, dst_from, dst_len;
506  ENa_strand dst_strand = eNa_strand_unknown;
507  // Mapping up - for each iterator create mapping to the top level.
508  // If top_id is set, top level positions are the iterator's positions.
509  // Otherwise top-level ids and positions must be taked from the
510  // iterators with depth == 1.
511  TSeqPos top_ref_start = 0;
512  TSeqPos top_start = 0;
513  CConstRef<CSeq_id> dst_id(top_id);
514  _ASSERT(seg_it.GetDepth() == 1);
515  while ( seg_it ) {
517  src_from = seg_it.GetRefPosition();
518  src_len = seg_it.GetLength();
519  dst_len = src_len;
520  if (top_id) {
521  dst_from = seg_it.GetPosition();
523  *seg_it.GetRefSeqid().GetSeqId(),
524  src_from, src_len, src_strand,
525  *top_id,
526  dst_from, dst_len, dst_strand);
527  }
528  else /* !top_id */ {
529  if (seg_it.GetDepth() == 1) {
530  // Depth==1 - top level sequences (destination).
531  dst_id.Reset(seg_it.GetRefSeqid().GetSeqId());
532  top_ref_start = seg_it.GetRefPosition();
533  top_start = seg_it.GetPosition();
534  dst_strand = seg_it.GetRefMinusStrand() ? eNa_strand_minus : eNa_strand_plus;
535  }
536  else {
537  _ASSERT(seg_it.GetPosition() >= top_start);
538  TSeqPos shift = seg_it.GetPosition() - top_start;
539  dst_from = top_ref_start + shift;
541  *seg_it.GetRefSeqid().GetSeqId(),
542  src_from, src_len, src_strand,
543  *dst_id,
544  dst_from, dst_len, dst_strand);
545  }
546  }
547  ++seg_it;
548  }
549 }
550 
551 
553  const CSeq_id* top_id)
554 {
555  TSeqPos src_from, src_len, dst_from, dst_len;
556  ENa_strand dst_strand = eNa_strand_unknown;
557  // eSeqMap_Down
558  // Collect all non-leaf references, create mapping from each non-leaf
559  // to the bottom level.
560  list<CSeqMap_CI> refs;
561  refs.push_back(seg_it);
562  while ( seg_it ) {
563  ++seg_it;
564  // While depth increases push all iterators to the stack.
565  if ( seg_it ) {
566  if (refs.empty() || refs.back().GetDepth() < seg_it.GetDepth()) {
567  refs.push_back(seg_it);
568  continue;
569  }
570  }
571  // End of seq-map or the last iterator was a leaf - create mappings.
572  if ( !refs.empty() ) {
573  CSeqMap_CI leaf = refs.back();
574  // Exclude self-mapping of the leaf reference.
575  refs.pop_back();
576  dst_strand = leaf.GetRefMinusStrand() ? eNa_strand_minus : eNa_strand_plus;
577  if ( top_id ) {
578  // Add mapping from the top-level sequence if any.
579  src_from = leaf.GetPosition();
580  src_len = leaf.GetLength();
581  dst_from = leaf.GetRefPosition();
582  dst_len = src_len;
584  *top_id,
585  src_from, src_len, eNa_strand_unknown,
586  *leaf.GetRefSeqid().GetSeqId(),
587  dst_from, dst_len, dst_strand);
588  }
589  // Create mapping from each non-leaf level.
590  ITERATE(list<CSeqMap_CI>, it, refs) {
591  TSeqPos shift = leaf.GetPosition() - it->GetPosition();
592  ENa_strand src_strand = it->GetRefMinusStrand() ? eNa_strand_minus : eNa_strand_plus;
593  src_from = it->GetRefPosition() + shift;
594  src_len = leaf.GetLength();
595  dst_from = leaf.GetRefPosition();
596  dst_len = src_len;
598  *it->GetRefSeqid().GetSeqId(),
599  src_from, src_len, src_strand,
600  *leaf.GetRefSeqid().GetSeqId(),
601  dst_from, dst_len, dst_strand);
602  }
603  while ( !refs.empty() && refs.back().GetDepth() >= seg_it.GetDepth()) {
604  refs.pop_back();
605  }
606  }
607  if ( seg_it ) {
608  refs.push_back(seg_it);
609  }
610  }
611 }
612 
613 
615  const CSeq_id* top_id,
616  ESeqMapDirection direction)
617 {
618  TSeqPos seg_from, seg_len, ref_from, ref_len;
619  ENa_strand seg_strand = eNa_strand_unknown;
620  ENa_strand ref_strand = eNa_strand_unknown;
621  // Stack of segments for each level.
622  list<CSeqMap_CI> refs;
623  refs.push_back(seg_it);
624  while ( seg_it ) {
625  ++seg_it;
626  // While depth increases push all iterators to the stack.
627  if ( seg_it ) {
628  if (refs.empty() || refs.back().GetDepth() < seg_it.GetDepth()) {
629  refs.push_back(seg_it);
630  continue;
631  }
632  }
633  // End of seq-map or the last iterator was a leaf - create mappings.
634  if ( !refs.empty() ) {
635  CSeqMap_CI ref = refs.back();
636  refs.pop_back();
637  if (direction == eSeqMap_Down) {
638  // Create self-mapping of the leaf reference - we can not use
639  // m_DstRanges here since they will contain ranges for each
640  // level while we need only the bottom.
641  seg_from = ref.GetRefPosition();
642  seg_len = ref.GetLength();
643  ref_from = seg_from;
644  ref_len = seg_len;
646  x_NextMappingRange(*id, seg_from, seg_len, eNa_strand_unknown,
647  *id, ref_from, ref_len, eNa_strand_unknown);
648  }
649  // Create mapping for each non-leaf level.
650  while ( !refs.empty() ) {
651  const CSeqMap_CI& seg = refs.back();
652  TSeqPos shift = ref.GetPosition() - seg.GetPosition();
653  seg_strand = seg.GetRefMinusStrand() ? eNa_strand_minus : eNa_strand_plus;
654  seg_from = seg.GetRefPosition() + shift;
655  seg_len = ref.GetLength();
656  ref_from = ref.GetRefPosition();
657  ref_len = seg_len;
658  ref_strand = ref.GetRefMinusStrand() ? eNa_strand_minus : eNa_strand_plus;
659  switch (direction) {
660  case eSeqMap_Down:
662  *seg.GetRefSeqid().GetSeqId(),
663  seg_from, seg_len, seg_strand,
664  *ref.GetRefSeqid().GetSeqId(),
665  ref_from, ref_len, ref_strand);
666  break;
667  case eSeqMap_Up:
669  *ref.GetRefSeqid().GetSeqId(),
670  ref_from, ref_len, ref_strand,
671  *seg.GetRefSeqid().GetSeqId(),
672  seg_from, seg_len, seg_strand);
673  break;
674  }
675  ref = seg;
676  if (ref.GetDepth() >= seg_it.GetDepth()) {
677  refs.pop_back();
678  }
679  else {
680  break;
681  }
682  }
683  // Are there still segments above?
684  if ( refs.empty() ) {
685  // Top level segment.
686  _ASSERT(ref);
687  if (top_id) {
688  // If the top level is a single bioseq, add mapping.
689  seg_from = ref.GetPosition();
690  seg_len = ref.GetLength();
691  ref_from = ref.GetRefPosition();
692  ref_len = seg_len;
693  ref_strand = ref.GetRefMinusStrand() ? eNa_strand_minus : eNa_strand_plus;
694  switch (direction) {
695  case eSeqMap_Down:
697  *top_id,
698  seg_from, seg_len, eNa_strand_unknown,
699  *ref.GetRefSeqid().GetSeqId(),
700  ref_from, ref_len, ref_strand);
701  break;
702  case eSeqMap_Up:
704  *ref.GetRefSeqid().GetSeqId(),
705  ref_from, ref_len, ref_strand,
706  *top_id,
707  seg_from, seg_len, seg_strand);
708  break;
709  }
710  }
711  else if (direction == eSeqMap_Up) {
712  // Create self-mapping of the top-level reference if the top
713  // level is not a single bioseq but rather a seq-map level.
714  ref_from = ref.GetRefPosition();
715  ref_len = ref.GetLength();
716  seg_from = ref_from;
717  seg_len = ref_len;
719  x_NextMappingRange(*id, ref_from, ref_len, eNa_strand_unknown,
720  *id, seg_from, seg_len, eNa_strand_unknown);
721  }
722  }
723  }
724  if ( seg_it ) {
725  refs.push_back(seg_it);
726  }
727  }
728  // Remove all collected destination ranges - they are not real destinations.
729  m_DstRanges.clear();
730  // If top level is a single sequence, create self-mapping for it.
731  if (top_id && direction == eSeqMap_Up) {
732  m_DstRanges.resize(1);
733  m_DstRanges[0].clear();
734  m_DstRanges[0][CSeq_id_Handle::GetHandle(*top_id)].push_back(TRange::GetWhole());
735  }
736 }
737 
738 
741  const CGC_Sequence& gc_seq)
742 {
743  CRef<CBioseq> bioseq(new CBioseq);
744  ITERATE(IMapper_Sequence_Info::TSynonyms, syn, synonyms) {
746  if ( h ) {
747  return h;
748  }
749  CRef<CSeq_id> syn_id(new CSeq_id);
750  syn_id->Assign(*syn->GetSeqId());
751  bioseq->SetId().push_back(syn_id);
752  }
753 
754  bioseq->SetInst().SetMol(CSeq_inst::eMol_na);
755  if ( gc_seq.CanGetLength() ) {
756  bioseq->SetInst().SetLength(gc_seq.GetLength());
757  }
758 
759  // Create virtual bioseq without length/data.
760  bioseq->SetInst().SetRepr(CSeq_inst::eRepr_virtual);
761  return m_Scope.GetScope().AddBioseq(*bioseq);
762 }
763 
764 
766  EGCAssemblyAlias to_alias)
767 {
768  if ( gc_assembly.IsUnit() ) {
769  const CGC_AssemblyUnit& unit = gc_assembly.GetUnit();
770  if ( unit.IsSetMols() ) {
772  const CGC_Replicon::TSequence& seq = (*it)->GetSequence();
773  if ( seq.IsSingle() ) {
774  x_InitGCSequence(seq.GetSingle(), to_alias);
775  }
776  else {
778  x_InitGCSequence(**tseq, to_alias);
779  }
780  }
781  }
782  }
783  if ( unit.IsSetOther_sequences() ) {
785  ITERATE(CGC_TaggedSequences::TSeqs, tseq, (*seq)->GetSeqs()) {
786  x_InitGCSequence(**tseq, to_alias);
787  }
788  }
789  }
790  }
791  else if ( gc_assembly.IsAssembly_set() ) {
792  const CGC_AssemblySet& aset = gc_assembly.GetAssembly_set();
793  x_InitGCAssembly(aset.GetPrimary_assembly(), to_alias);
794  if ( aset.IsSetMore_assemblies() ) {
796  x_InitGCAssembly(**assm, to_alias);
797  }
798  }
799  }
800 }
801 
802 
803 inline bool s_IsLocalRandomChrId(const CSeq_id& id)
804 {
805  return id.IsLocal() && id.GetLocal().IsStr() &&
806  id.GetLocal().GetStr().find("_random") != string::npos;
807 }
808 
809 
811  CConstRef<CSeq_id>& chr_id,
812  TSynonyms& synonyms) const
813 {
814  chr_id.Reset();
815  if (!gc_seq.IsSetStructure()) return false;
816 
817  CConstRef<CSeq_id> id(&gc_seq.GetSeq_id());
818  synonyms.insert(CSeq_id_Handle::GetHandle(*id));
819  if ( s_IsLocalRandomChrId(*id) ) {
820  chr_id = id;
821  }
822  // Collect all synonyms.
824  const CGC_TypedSeqId& gc_id = **it;
825  switch ( gc_id.Which() ) {
827  if ( gc_id.GetGenbank().IsSetGi() ) {
828  id.Reset(&gc_id.GetGenbank().GetGi());
829  }
830  break;
832  if ( gc_id.GetRefseq().IsSetGi() ) {
833  id.Reset(&gc_id.GetRefseq().GetGi());
834  }
835  break;
837  id.Reset(&gc_id.GetExternal().GetId());
838  break;
840  id.Reset(&gc_id.GetPrivate());
841  break;
842  default:
843  continue;
844  }
845  synonyms.insert(CSeq_id_Handle::GetHandle(*id));
846  if ( !chr_id && s_IsLocalRandomChrId(*id) ) {
847  chr_id = id;
848  }
849  }
850 
851  if ( !chr_id ) {
852  synonyms.clear();
853  return false;
854  }
855 
856  // Use only random chromosome ids, ignore other synonyms (?)
857  string lcl_str = chr_id->GetLocal().GetStr();
858  if ( !NStr::StartsWith(lcl_str, "chr") ) {
859  CSeq_id lcl;
860  lcl.SetLocal().SetStr("chr" + lcl_str);
861  synonyms.insert(CSeq_id_Handle::GetHandle(lcl));
862  }
863 
864  return true;
865 }
866 
867 
870 {
871  switch ( id.Which() ) {
873  if (alias == CSeq_loc_Mapper::eGCA_Genbank) {
874  return id.GetGenbank().IsSetGi() ?
875  &id.GetGenbank().GetGi() : &id.GetGenbank().GetPublic();
876  }
877  if (alias == CSeq_loc_Mapper::eGCA_GenbankAcc) {
878  return &id.GetGenbank().GetPublic();
879  }
880  break;
882  if (alias == CSeq_loc_Mapper::eGCA_Refseq) {
883  return id.GetRefseq().IsSetGi() ?
884  &id.GetRefseq().GetGi() : &id.GetRefseq().GetPublic();
885  }
886  if (alias == CSeq_loc_Mapper::eGCA_RefseqAcc) {
887  return &id.GetRefseq().GetPublic();
888  }
889  break;
891  if (alias == CSeq_loc_Mapper::eGCA_UCSC &&
892  id.GetExternal().GetExternal() == "UCSC") {
893  return &id.GetExternal().GetId();
894  }
895  break;
897  if (alias == CSeq_loc_Mapper::eGCA_Other) {
898  return &id.GetPrivate();
899  }
900  break;
901  default:
902  break;
903  }
904  return 0;
905 }
906 
907 
909  EGCAssemblyAlias to_alias)
910 {
911  if ( gc_seq.IsSetSeq_id_synonyms() ) {
912  CConstRef<CSeq_id> dst_id;
914  const CGC_TypedSeqId& id = **it;
915  dst_id.Reset(s_GetSeqIdAlias(id, to_alias));
916  if ( dst_id ) break; // Use the first matching alias
917  }
918  if ( dst_id ) {
919  TSynonyms synonyms;
920  synonyms.insert(CSeq_id_Handle::GetHandle(gc_seq.GetSeq_id()));
922  // Add conversion for each synonym which can be used
923  // as a source id.
924  const CGC_TypedSeqId& id = **it;
925  switch ( id.Which() ) {
927  if (id.GetGenbank().IsSetGi() && dst_id != &id.GetGenbank().GetGi()) {
928  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetGenbank().GetGi()));
929  }
930  if (dst_id != &id.GetGenbank().GetPublic()) {
931  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetGenbank().GetPublic()));
932  }
933  if ( id.GetGenbank().IsSetGpipe() ) {
934  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetGenbank().GetGpipe()));
935  }
936  break;
938  if (id.GetRefseq().IsSetGi() && dst_id != &id.GetRefseq().GetGi()) {
939  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetRefseq().GetGi()));
940  }
941  if (dst_id != &id.GetRefseq().GetPublic()) {
942  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetRefseq().GetPublic()));
943  }
944  if ( id.GetRefseq().IsSetGpipe() ) {
945  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetRefseq().GetGpipe()));
946  }
947  break;
949  // Ignore private local ids - they are not unique.
950  if (id.GetPrivate().IsLocal()) continue;
951  if (dst_id != &id.GetPrivate()) {
952  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetPrivate()));
953  }
954  break;
956  if (dst_id != &id.GetExternal().GetId()) {
957  synonyms.insert(CSeq_id_Handle::GetHandle(id.GetExternal().GetId()));
958  }
959  break;
960  default:
961  NCBI_THROW(CAnnotMapperException, eOtherError,
962  "Unsupported alias type in GC-Sequence synonyms");
963  break;
964  }
965  }
966  CBioseq_Handle h = x_AddVirtualBioseq(synonyms, gc_seq);
967  TSeqPos hlen = kInvalidSeqPos;
968  if (h && h.CanGetInst_Length()) {
969  hlen = h.GetInst_Length();
970  }
972  *dst_id, 0, eNa_strand_unknown,
973  hlen != kInvalidSeqPos ? hlen : TRange::GetWholeLength(),
974  false, 0, hlen, hlen);
975  }
976  else if (to_alias == eGCA_UCSC || to_alias == eGCA_Refseq) {
977  TSynonyms synonyms;
978  CConstRef<CSeq_id> chr_id;
979  // The requested alias type not found,
980  // check for UCSC random chromosomes.
981  if ( x_IsUCSCRandomChr(gc_seq, chr_id, synonyms) ) {
982  _ASSERT(chr_id);
983 
984  // Use structure (delta-seq) to initialize the mapper.
985  // Here we use just one level of the delta and parse it
986  // directly rather than use CSeqMap.
987  TSeqPos chr_pos = 0;
988  TSeqPos chr_len = kInvalidSeqPos;
989  ITERATE(CDelta_ext::Tdata, it, gc_seq.GetStructure().Get()) {
990  // Do not create mappings for literals/gaps.
991  if ( (*it)->IsLiteral() ) {
992  chr_pos += (*it)->GetLiteral().GetLength();
993  }
994  if ( !(*it)->IsLoc() ) {
995  continue;
996  }
997  CSeq_loc_CI loc_it((*it)->GetLoc());
998  for (; loc_it; ++loc_it) {
999  if ( loc_it.IsEmpty() ) continue;
1000  TSeqPos seg_pos = loc_it.GetRange().GetFrom();
1001  TSeqPos seg_len = loc_it.GetRange().GetLength();
1002  ENa_strand seg_str = loc_it.IsSetStrand() ?
1003  loc_it.GetStrand() : eNa_strand_unknown;
1004  switch ( to_alias ) {
1005  case eGCA_UCSC:
1006  // Map up to the chr
1007  x_NextMappingRange(loc_it.GetSeq_id(),
1008  seg_pos, seg_len, seg_str,
1009  *chr_id, chr_pos, chr_len,
1011  break;
1012  case eGCA_Refseq:
1013  // Map down to delta parts
1014  x_NextMappingRange(*chr_id, chr_pos, chr_len,
1016  loc_it.GetSeq_id(), seg_pos, seg_len,
1017  seg_str);
1018  break;
1019  default:
1020  break;
1021  }
1022  }
1023  }
1024  x_AddVirtualBioseq(synonyms, gc_seq);
1025  }
1026  }
1027  }
1028  if ( gc_seq.IsSetSequences() ) {
1030  ITERATE(CGC_TaggedSequences::TSeqs, tseq, (*seq)->GetSeqs()) {
1031  x_InitGCSequence(**tseq, to_alias);
1032  }
1033  }
1034  }
1035 }
1036 
1037 
1038 /////////////////////////////////////////////////////////////////////
1039 //
1040 // Initialization helpers
1041 //
1042 
1043 
1046 {
1047  return new CSeq_align_Mapper(src_align, *this);
1048 }
1049 
1050 
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Seq-loc and seq-align mapper exceptions.
CBioseq_Handle –.
CConstRef –.
Definition: ncbiobj.hpp:1266
CGC_Assembly_Parser –.
the sequence(s) representing this molecule in the case of 2L and 2R - the molecule is represented by ...
bool CanGetLength() const
Is the length statistic available?
TSeqPos GetLength() const
return the length of this sequence.
CGC_TypedSeqId –.
bool IsNull(void) const
Definition: heap_scope.hpp:73
CScope * GetScopeOrNull(void) const
Definition: heap_scope.cpp:74
CScope & GetScope(void) const
Definition: heap_scope.cpp:68
Storage for multiple mapping ranges.
CScope_Mapper_Sequence_Info(CScope *scope)
virtual TSeqPos GetSequenceLength(const CSeq_id_Handle &idh)
Get sequence length or kInvalidSeqPos.
virtual void CollectSynonyms(const CSeq_id_Handle &id, TSynonyms &synonyms)
Collect all synonyms for the id including the id itself.
virtual TSeqType GetSequenceType(const CSeq_id_Handle &idh)
Get information about sequence type (nuc or prot).
CScope –.
Definition: scope.hpp:92
Iterator over CSeqMap.
Definition: seq_map_ci.hpp:252
CSeqMap –.
Definition: seq_map.hpp:93
Class used to map seq-alignments.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Definition: Seq_loc.hpp:453
CSeq_loc_Mapper_Base –.
CSeq_loc_Mapper_Options –.
static CSeq_id_Handle GetSeq_id_Handle(const const_iterator &iter)
IMapper_Sequence_Info.
Definition: set.hpp:45
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
void clear()
Definition: set.hpp:153
static unsigned char depth[2 *(256+1+29)+1]
boolean leaf(meNode *v)
Definition: graph.cpp:44
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
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
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.
bool IsSetStrand(void) const
Get strand.
Definition: Seq_loc.hpp:1049
bool IsEmpty(void) const
True if the current location is empty.
Definition: Seq_loc.hpp:1084
TRange GetRange(void) const
Get the range.
Definition: Seq_loc.hpp:1042
ENa_strand GetStrand(void) const
Definition: Seq_loc.hpp:1056
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
Definition: Seq_loc.hpp:1028
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
void x_InitializeAlign(const CSeq_align &map_align, const CSeq_id &to_id, const CSeq_id *from_id=nullptr)
CSeq_loc_Mapper_Options & SetMapperSequenceInfo(IMapper_Sequence_Info *seq_info)
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
Definition: scope.cpp:530
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
IMapper_Sequence_Info * GetMapperSequenceInfo(void) const
Sequence type, length etc.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
Definition: scope.cpp:522
EGCAssemblyAlias
Destination of seq-id mapping through a GC-Assembly.
EScopeFlag
Using CScope for virtual bioseqs created from GC-Assemblies.
void x_InitializeFeat(const CSeq_feat &map_feat, EFeatMapDirection dir)
EFeatMapDirection
Mapping direction used when initializing the mapper with a feature.
CSeq_loc_Mapper_Options m_MapOptions
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
void x_NextMappingRange(const CSeq_id &src_id, TSeqPos &src_start, TSeqPos &src_len, ENa_strand src_strand, const CSeq_id &dst_id, TSeqPos &dst_start, TSeqPos &dst_len, ENa_strand dst_strand, const CInt_fuzz *fuzz_from=0, const CInt_fuzz *fuzz_to=0, int frame=0, TSeqPos src_bioseq_len=kInvalidSeqPos)
virtual CSeq_align_Mapper_Base * InitAlignMapper(const CSeq_align &src_align)
void x_InitGCAssembly(const CGC_Assembly &gc_assembly, EGCAssemblyAlias to_alias)
CRef< CSeq_entry > GetTSE(void) const
Create seq-entry with all parsed sequences, annotations etc.
CSeq_inst::TMol GetSequenceType(const CSeq_id &id, TGetFlags flags=0)
Get molecular type of sequence (protein/dna/rna) Return CSeq_inst::eMol_not_set if sequence is not fo...
Definition: scope.cpp:804
const TSeqIds & GetTopLevelSequences(void) const
Get seq-ids for all top-level sequences in the assembly.
void x_InitializeSeqMapUp(CSeqMap_CI seg_it, const CSeq_id *top_id)
CSeq_loc_Mapper(CMappingRanges *mapping_ranges, CScope *scope=0, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
Mapping through a pre-filled CMappipngRanges.
void x_InitializeLocs(const CSeq_loc &source, const CSeq_loc &target, int src_frame=0, int dst_frame=0)
CConstRef< CSynonymsSet > GetSynonyms(const CSeq_id &id)
Get bioseq synonyms, resolving to the bioseq in this scope.
Definition: scope.cpp:486
bool x_IsUCSCRandomChr(const CGC_Sequence &gc_seq, CConstRef< CSeq_id > &chr_id, TSynonyms &synonyms) const
CBioseq_Handle x_AddVirtualBioseq(const TSynonyms &synonyms, const CGC_Sequence &gc_seq)
void AddScope(CScope &scope, TPriority pri=kPriority_Default)
Add the scope's datasources as a single group with the given priority All data sources (data loaders ...
Definition: scope.cpp:516
void x_InitializeSeqMap(const CSeqMap &seq_map, const CSeq_id *top_id, ESeqMapDirection direction)
void x_InitializeSeqMapDown(CSeqMap_CI seg_it, const CSeq_id *top_id)
void x_AddConversion(const CSeq_id &src_id, TSeqPos src_start, ENa_strand src_strand, const CSeq_id &dst_id, TSeqPos dst_start, ENa_strand dst_strand, TSeqPos length, bool ext_right, int frame, TSeqPos src_bioseq_len, TSeqPos dst_length)
void x_InitializeSeqMapSingleLevel(CSeqMap_CI seg_it, const CSeq_id *top_id, ESeqMapDirection direction)
bool GetMapSingleLevel(void) const
Mapping depth when using a seq-map, a bioseq or a GC-assembly.
void x_InitGCSequence(const CGC_Sequence &gc_seq, EGCAssemblyAlias to_alias)
@ eGCA_Genbank
Map to GenBank alias, prefer GI.
@ eGCA_UCSC
Map to UCSC alias.
@ eGCA_Refseq
Map to RefSeq alias, prefer GI.
@ eGCA_Other
Map to 'private' seq-id.
@ eGCA_GenbankAcc
Map to GenBank alias, prefer acc.ver.
@ eGCA_RefseqAcc
Map to RefSeq alias, prefer acc.ver.
@ eCopyScope
Create a new scope for virtual bioseqs.
@ eSeqMap_Down
map from a segmented bioseq to segments
@ eSeqMap_Up
map from segments to the top level bioseq
const CTSE_Handle & GetTSE_Handle(void) const
Get CTSE_Handle of containing TSE.
TSeqPos GetBioseqLength(void) const
bool CanGetInst_Length(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
TInst_Length GetInst_Length(void) const
const CSeqMap & GetSeqMap(void) const
Get sequence map.
CConstRef< CSynonymsSet > GetSynonyms(void) const
Get the bioseq's synonyms.
SSeqMapSelector & SetLinkUsedTSE(bool link=true)
Definition: seq_map_ci.hpp:157
TSeqPos GetRefPosition(void) const
Definition: seq_map_ci.hpp:693
SSeqMapSelector & SetFlags(TFlags flags)
Select segment type(s)
Definition: seq_map_ci.hpp:179
bool GetRefMinusStrand(void) const
Definition: seq_map_ci.hpp:700
CSeq_id_Handle GetRefSeqid(void) const
The following function makes sense only when the segment is a reference to another seq.
Definition: seq_map_ci.cpp:312
TSeqPos GetPosition(void) const
return position of current segment in sequence
Definition: seq_map_ci.hpp:665
TSeqPos GetLength(void) const
return length of current segment
Definition: seq_map_ci.hpp:672
size_t GetDepth(void) const
return the depth of current segment
Definition: seq_map_ci.hpp:602
@ fFindRef
Definition: seq_map.hpp:137
@ fIgnoreUnresolved
Definition: seq_map.hpp:134
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
TObjectType * GetPointerOrNull(void) const THROWS_NONE
Get pointer value.
Definition: ncbiobj.hpp:1672
position_type GetLength(void) const
Definition: range.hpp:158
static position_type GetWholeLength(void)
Definition: range.hpp:268
static TThisType GetWhole(void)
Definition: range.hpp:272
#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
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
TStr & SetStr(void)
Select the variant.
Definition: Object_id_.hpp:304
const TGenbank & GetGenbank(void) const
Get the variant data.
list< CRef< CGC_Sequence > > TSeqs
const TId & GetId(void) const
Get the Id member data.
const TUnit & GetUnit(void) const
Get the variant data.
const TStructure & GetStructure(void) const
Get the Structure member data.
bool IsSingle(void) const
Check if variant Single is selected.
const TGi & GetGi(void) const
Get the Gi member data.
const TRefseq & GetRefseq(void) const
Get the variant data.
bool IsSetMols(void) const
collections of molecules for this assembly Check if a value has been assigned to Mols data member.
const TPrivate & GetPrivate(void) const
Get the variant data.
list< CRef< CGC_TypedSeqId > > TSeq_id_synonyms
bool IsAssembly_set(void) const
Check if variant Assembly_set is selected.
bool IsSetMore_assemblies(void) const
Check if a value has been assigned to More_assemblies data member.
bool IsSetOther_sequences(void) const
On primary assembly-unit: here will be the unplaced sequences On alt-loci: list of sequences aligned/...
const TOther_sequences & GetOther_sequences(void) const
Get the Other_sequences member data.
const TPrimary_assembly & GetPrimary_assembly(void) const
Get the Primary_assembly member data.
bool IsSetStructure(void) const
locations of ordered scaffolds/components Check if a value has been assigned to Structure data member...
E_Choice Which(void) const
Which variant is currently selected.
const TExternal & GetExternal(void) const
Get the variant data.
const TSeq_id_synonyms & GetSeq_id_synonyms(void) const
Get the Seq_id_synonyms member data.
bool IsSetGi(void) const
optional since not all sequences have GIs Similarity: relationship between this synonym to main seqid...
list< CRef< CGC_TaggedSequences > > TSequences
const TAssembly_set & GetAssembly_set(void) const
Get the variant data.
const TMols & GetMols(void) const
Get the Mols member data.
list< CRef< CGC_Replicon > > TMols
bool IsSetSequences(void) const
placed: populated both on chromosome and scaffold levels unlocalized: populated on chromosome level C...
const TSequences & GetSequences(void) const
Get the Sequences member data.
bool IsUnit(void) const
Check if variant Unit is selected.
list< CRef< CGC_Assembly > > TMore_assemblies
list< CRef< CGC_Sequence > > TSet
const TSingle & GetSingle(void) const
Get the variant data.
const TSet & GetSet(void) const
Get the variant data.
const TMore_assemblies & GetMore_assemblies(void) const
Get the More_assemblies member data.
bool IsSetSeq_id_synonyms(void) const
Other known identifiers: Local / gpipe-satellite / genbank / refseq Check if a value has been assigne...
const TSeq_id & GetSeq_id(void) const
Get the Seq_id member data.
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
TLocal & SetLocal(void)
Select the variant.
Definition: Seq_id_.cpp:199
const TLocal & GetLocal(void) const
Get the variant data.
Definition: Seq_id_.cpp:193
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
TId & SetId(void)
Assign a value to Id data member.
Definition: Bioseq_.hpp:296
void SetInst(TInst &value)
Assign a value to Inst data member.
Definition: Bioseq_.cpp:86
const Tdata & Get(void) const
Get the member data.
Definition: Delta_ext_.hpp:164
list< CRef< CDelta_seq > > Tdata
Definition: Delta_ext_.hpp:89
@ eRepr_virtual
no seq data
Definition: Seq_inst_.hpp:93
@ eMol_na
just a nucleic acid
Definition: Seq_inst_.hpp:113
const CharType(& source)[N]
Definition: pointer.h:1149
The Object manager core.
CSeq_loc_Mapper_Options & SetOptionsScope(CSeq_loc_Mapper_Options &options, CScope *scope)
ENa_strand s_IndexToStrand(size_t idx)
bool s_IsLocalRandomChrId(const CSeq_id &id)
const CSeq_id * s_GetSeqIdAlias(const CGC_TypedSeqId &id, CSeq_loc_Mapper::EGCAssemblyAlias alias)
Uint4 GetSequenceType(const CBioseq_Handle &bsh)
Return a (corrected) set of flags identifying the sequence type.
Definition: sequtils.cpp:42
Selector used in CSeqMap methods returning iterators.
Definition: seq_map_ci.hpp:113
#define _ASSERT
CScope & GetScope()
Modified on Fri Jun 14 16:49:18 2024 by modify_doxy.py rev. 669887