NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CSeq_loc_Mapper_Base Class Reference

Search Toolkit Book for CSeq_loc_Mapper_Base

CSeq_loc_Mapper_Base –. More...

#include <objects/seq/seq_loc_mapper_base.hpp>

+ Inheritance diagram for CSeq_loc_Mapper_Base:
+ Collaboration diagram for CSeq_loc_Mapper_Base:


struct  SMappedRange

Public Types

enum  EFeatMapDirection { eLocationToProduct , eProductToLocation }
 Mapping direction used when initializing the mapper with a feature. More...
enum  EMapOptions {
  fAlign_Dense_seg_TotalRange = 1 << 0 , fAlign_Sparse_ToFirst = 0 , fAlign_Sparse_ToSecond = 1 << 1 , fMapSingleLevel = 1 << 2 ,
  fTrimMappedLocation = 1 << 3
 Options for interpretations of locations. More...
enum  ESplicedRow { eSplicedRow_Prod = 0 , eSplicedRow_Gen = 1 }
 Spliced-seg row indexing constants. More...
enum  FFuzzOption { fFuzzOption_CStyle = 1 << 0 , fFuzzOption_RemoveLimTlOrTr = 1 << 1 }
enum  FAnnotMapFlag {
  fAnnotMap_Location = 1 << 0 , fAnnotMap_Product = 1 << 1 , fAnnotMap_Both = fAnnotMap_Location | fAnnotMap_Product , fAnnotMap_RemoveNonMapping = 1 << 2 ,
  fAnnotMap_ThrowOnFailure = 1 << 3 , fAnnotMap_Default = fAnnotMap_Both
 Flags defining seq-annot mapping options. More...
enum  EMapResult { eMapped_None = 0 , eMapped_Some , eMapped_All }
 Result of seq-annot mapping. More...
enum  ESeqType { eSeq_unknown = 0 , eSeq_nuc = 1 , eSeq_prot = 3 }
typedef int TMapOptions
typedef int TFuzzOption
typedef int TAnnotMapFlags
typedef set< CSeq_id_HandleTSynonyms
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
typedef Uint8 TCount
 Alias for value type of counter. More...

Public Member Functions

 CSeq_loc_Mapper_Base (CMappingRanges *mapping_ranges, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Mapping through a pre-filled CMappipngRanges. More...
 CSeq_loc_Mapper_Base (const CSeq_feat &map_feat, EFeatMapDirection dir, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Mapping through a feature, both location and product must be set. More...
 CSeq_loc_Mapper_Base (const CSeq_loc &source, const CSeq_loc &target, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Mapping between two seq_locs. More...
 CSeq_loc_Mapper_Base (const CSeq_align &map_align, const CSeq_id &to_id, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Mapping through an alignment. More...
 CSeq_loc_Mapper_Base (const CSeq_id &from_id, const CSeq_id &to_id, const CSeq_align &map_align, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Mapping through an alignment using specific source and target ids. More...
 CSeq_loc_Mapper_Base (const CSeq_align &map_align, const CSeq_id &to_id, TMapOptions opts, IMapper_Sequence_Info *seq_info)
 CSeq_loc_Mapper_Base (const CSeq_align &map_align, size_t to_row, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Sparse alignments require special row indexing since each row contains two seq-ids. More...
 CSeq_loc_Mapper_Base (size_t from_row, size_t to_row, const CSeq_align &map_align, CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
 Mapping through an alignment using specific source and target row numbers. More...
 CSeq_loc_Mapper_Base (const CSeq_align &map_align, size_t to_row, TMapOptions opts, IMapper_Sequence_Info *seq_info)
 ~CSeq_loc_Mapper_Base (void)
void SetFuzzOption (TFuzzOption newOption)
CSeq_loc_Mapper_BaseSetMergeNone (void)
 Intervals' merging mode MergeNone and MergeAbutting do not change the order of ranges in the destination seq-loc. More...
CSeq_loc_Mapper_BaseSetMergeAbutting (void)
 Merge only abutting intervals, keep overlapping. More...
CSeq_loc_Mapper_BaseSetMergeBySeg (void)
 Merge only intervals from the same group. More...
CSeq_loc_Mapper_BaseSetMergeContained (void)
 Merge intervals only if one is completely covered by another. More...
CSeq_loc_Mapper_BaseSetMergeAll (void)
 Merge any abutting or overlapping intervals. More...
CSeq_loc_Mapper_BaseSetGapPreserve (void)
 Whether to preserve or remove NULL sub-locations (usually indicating gaps) from the result. More...
CSeq_loc_Mapper_BaseSetGapRemove (void)
CSeq_loc_Mapper_BaseSetTrimSplicedSeg (bool trim)
 For mapping spliced-segs only: preserve or trim starting/ending indels. More...
CSeq_loc_Mapper_BaseKeepNonmappingRanges (void)
 Keep ranges which can not be mapped. More...
CSeq_loc_Mapper_BaseTruncateNonmappingRanges (void)
CSeq_loc_Mapper_BaseSetCheckStrand (bool value=true)
 Check strands before mapping a range. More...
CSeq_loc_Mapper_BaseMixedAlignsAsSpliced (bool value=true)
 When set to 'true' if mapped alignment has exactly one genomic and one protein row, convert it to spliced-seg. More...
CSeq_loc_Mapper_BaseIncludeSourceLocs (bool value=true)
 Include source ranges in the mapped location. More...
CSeq_loc_Mapper_BaseSetErrorOnPartial (bool value=true)
 Report source range trimming as an error. More...
CRef< CSeq_locMap (const CSeq_loc &src_loc)
 Map seq-loc. More...
CRef< CSeq_locMapTotalRange (const CSeq_loc &seq_loc)
 Take the total range from the location and run it through the mapper. More...
CRef< CSeq_alignMap (const CSeq_align &src_align)
 Map the whole alignment. More...
CRef< CSeq_alignMap (const CSeq_align &src_align, size_t row)
 Map a single row of the alignment. More...
CRef< CSeq_graphMap (const CSeq_graph &src_graph)
 Map seq-graph. More...
EMapResult Map (CSeq_annot &annot, TAnnotMapFlags flags=fAnnotMap_Default)
 Map each object from the Seq-annot and replace the original with the mapped one. More...
bool LastIsPartial (void)
 Check if the last mapping resulted in partial location (not all ranges from the original location could be mapped to the target). More...
const CSeq_id_HandleCollectSynonyms (const CSeq_id_Handle &id) const
 CSeq_loc_Mapper_Base (CSeq_loc_Mapper_Options options=CSeq_loc_Mapper_Options())
ESeqType GetSeqTypeById (const CSeq_id_Handle &idh) const
 Methods for getting sequence types, use cached types (m_SeqTypes) if possible. More...
ESeqType GetSeqTypeById (const CSeq_id &id) const
void SetSeqTypeById (const CSeq_id_Handle &idh, ESeqType seqtype) const
 Methods for setting sequence types. More...
void SetSeqTypeById (const CSeq_id &id, ESeqType seqtype) const
int GetWidthById (const CSeq_id_Handle &idh) const
 Get sequence width. More...
int GetWidthById (const CSeq_id &id) const
const CMappingRangesGetMappingRanges (void) const
 Get mapping ranges. More...
void CollectSynonyms (const CSeq_id_Handle &id, TSynonyms &synonyms) const
 NOTE: In most cases CollectSynonyms(const CSeq_id_Handle& id) should be used instead, since it takes care of synonym storage and mapping. More...
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 CObject (const CObject &src)
 Copy constructor. More...
virtual ~CObject (void)
 Destructor. More...
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
void AddReference (void) const
 Add reference to object. More...
void RemoveReference (void) const
 Remove reference to object. More...
void ReleaseReference (void) const
 Remove reference without deleting object. More...
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
void * operator new (size_t size)
 Define new operator for memory allocation. More...
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
void * operator new (size_t size, void *place)
 Define new operator. More...
void operator delete (void *ptr, void *place)
 Define delete operator. More...
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
virtual ~CDebugDumpable (void)
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
void DumpToConsole (void) const

Static Public Member Functions

static bool GetNonMappingAsNull (void)
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
static EAllocFillMode GetAllocFillMode (void)
static void SetAllocFillMode (EAllocFillMode mode)
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)

Protected Types

typedef CMappingRange::TRange TRange
typedef CMappingRanges::TRangeMap TRangeMap
typedef CMappingRanges::TRangeIterator TRangeIterator
typedef CMappingRanges::TSortedMappings TSortedMappings
typedef list< TRangeTDstRanges
typedef map< CSeq_id_Handle, TDstRangesTDstIdMap
typedef vector< TDstIdMapTDstStrandMap
typedef CRef< CInt_fuzzTFuzz
typedef pair< TFuzz, TFuzzTRangeFuzz
typedef list< SMappedRangeTMappedRanges
typedef vector< TMappedRangesTRangesByStrand
typedef map< CSeq_id_Handle, TRangesByStrandTRangesById
typedef map< CSeq_id_Handle, ESeqTypeTSeqTypeById
typedef CSeq_align::C_Segs::TDendiag TDendiag
typedef CSeq_align::C_Segs::TStd TStd

Protected Member Functions

ESeqType GetSeqType (const CSeq_id_Handle &idh) const
TSeqPos GetSequenceLength (const CSeq_id &id)
virtual CSeq_align_Mapper_BaseInitAlignMapper (const CSeq_align &src_align)
void x_InitializeFeat (const CSeq_feat &map_feat, EFeatMapDirection dir)
void x_InitializeLocs (const CSeq_loc &source, const CSeq_loc &target, int src_frame=0, int dst_frame=0)
void x_InitializeAlign (const CSeq_align &map_align, const CSeq_id &to_id, const CSeq_id *from_id=nullptr)
void x_InitializeAlign (const CSeq_align &map_align, const TSynonyms &to_ids, const TSynonyms *from_ids=nullptr)
void x_InitializeAlign (const CSeq_align &map_align, size_t to_row, size_t from_row=size_t(-1))
void x_PreserveDestinationLocs (void)
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)
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_MapSeq_loc (const CSeq_loc &src_loc)
void x_PushRangesToDstMix (void)
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...

Protected Attributes

TSeqTypeById m_SeqTypes
bool m_Partial
bool m_LastTruncated
CRef< CMappingRangesm_Mappings
CRef< CSeq_locm_Dst_loc
TDstStrandMap m_DstRanges
int m_CurrentGroup
TFuzzOption m_FuzzOption
CSeq_loc_Mapper_Options m_MapOptions

Private Types

enum  EMergeFlags {
  eMergeNone , eMergeAbutting , eMergeContained , eMergeBySeg ,
enum  EGapFlags { eGapPreserve , eGapRemove }
enum  EMiscFlags {
  fTrimSplicedSegs = 1 << 0 , fKeepNonmapping = 1 << 1 , fCheckStrand = 1 << 2 , fIncludeSrcLocs = 1 << 3 ,
  fMixedAlignsAsSpliced = 1 << 4 , fErrorOnPartial = 1 << 5
typedef map< CSeq_id_Handle, CSeq_id_HandleTSynonymMap
typedef map< CSeq_id_Handle, TSeqPosTLengthMap
typedef int TMiscFlags

Private Member Functions

 CSeq_loc_Mapper_Base (const CSeq_loc_Mapper_Base &)
CSeq_loc_Mapper_Baseoperator= (const CSeq_loc_Mapper_Base &)
bool x_CheckSeqTypes (const CSeq_loc &loc, ESeqType &seqtype, TSeqPos &len)
ESeqType x_ForceSeqTypes (const CSeq_loc &loc) const
void x_AdjustSeqTypesToProt (const CSeq_id_Handle &idh)
TSeqPos x_GetRangeLength (const CSeq_loc_CI &it)
void x_InitAlign (const CDense_diag &diag, size_t to_row, size_t from_row)
void x_InitAlign (const CDense_seg &denseg, size_t to_row, size_t from_row)
void x_InitAlign (const CStd_seg &sseg, size_t to_row)
void x_InitAlign (const CPacked_seg &pseg, size_t to_row, size_t from_row)
void x_InitSpliced (const CSpliced_seg &spliced, const TSynonyms &to_ids)
void x_InitSpliced (const CSpliced_seg &spliced, ESplicedRow to_row)
void x_InitSparse (const CSparse_seg &sparse, size_t to_row)
void x_IterateExonParts (const CSpliced_exon::TParts &parts, ESplicedRow to_row, const CSeq_id &gen_id, TSeqPos &gen_start, TSeqPos &gen_len, ENa_strand gen_strand, const CSeq_id &prod_id, TSeqPos &prod_start, TSeqPos &prod_len, ENa_strand prod_strand)
void x_AddExonPartsMapping (TSeqPos &mapping_len, ESplicedRow to_row, const CSeq_id &gen_id, TSeqPos &gen_start, TSeqPos &gen_len, ENa_strand gen_strand, const CSeq_id &prod_id, TSeqPos &prod_start, TSeqPos &prod_len, ENa_strand prod_strand)
bool x_MapNextRange (const TRange &src_rg, bool is_set_strand, ENa_strand src_strand, const TRangeFuzz &src_fuzz, TSortedMappings &mappings, size_t cvt_idx, TSeqPos *last_src_to)
bool x_MapInterval (const CSeq_id &src_id, TRange src_rg, bool is_set_strand, ENa_strand src_strand, TRangeFuzz orig_fuzz)
void x_SetLastTruncated (void)
void x_PushLocToDstMix (CRef< CSeq_loc > loc)
void x_PushNullLoc (void)
CRef< CSeq_alignx_MapSeq_align (const CSeq_align &src_align, size_t *row)
TMappedRangesx_GetMappedRanges (const CSeq_id_Handle &id, size_t strand_idx) const
void x_PushMappedRange (const CSeq_id_Handle &id, size_t strand_idx, const TRange &range, const TRangeFuzz &fuzz, bool push_reverse, int group)
void x_PushSourceRange (const CSeq_id_Handle &idh, size_t src_strand, size_t dst_strand, const TRange &range, bool push_reverse)
CRef< CSeq_locx_RangeToSeq_loc (const CSeq_id_Handle &idh, TSeqPos from, TSeqPos to, size_t strand_idx, TRangeFuzz rg_fuzz)
CRef< CSeq_locx_GetMappedSeq_loc (void)
void x_StripExtraneousFuzz (CRef< CSeq_loc > &loc) const
CConstRef< CSeq_locx_FixNonsenseFuzz (CConstRef< CSeq_loc > loc_piece) const
void x_OptimizeSeq_loc (CRef< CSeq_loc > &loc) const
bool x_ReverseRangeOrder (int str) const
void x_Map_PackedInt_Element (const CSeq_interval &si)
void x_Map_PackedPnt_Element (const CPacked_seqpnt &pp, TSeqPos p)
const CSeq_id_Handlex_GetPrimaryId (const CSeq_id_Handle &synonym) const
bool x_IsSynonym (const CSeq_id &id, const TSynonyms &synonyms) const
bool x_IsSetMiscFlag (EMiscFlags flag) const
void x_SetMiscFlag (EMiscFlags flag, bool value)

Static Private Member Functions

static TSeqPos sx_GetExonPartLength (const CSpliced_exon_chunk &part)

Private Attributes

EMergeFlags m_MergeFlag
EGapFlags m_GapFlag
TMiscFlags m_MiscFlags
TRangesById m_MappedLocs
CRef< CSeq_locm_SrcLocs
CRef< CGraphRangesm_GraphRanges
TSynonymMap m_SynonymMap
TLengthMap m_LengthMap


class CSeq_align_Mapper_Base
class CTotalRangeSynonymMapper

Additional Inherited Members

- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
static const TCount eCounterStateMask
 Valid object, and object in heap. More...

Detailed Description

CSeq_loc_Mapper_Base –.

Mapping locations and alignments between bioseqs through seq-locs, features, alignments or between parts of segmented bioseqs.

Definition at line 341 of file seq_loc_mapper_base.hpp.

The documentation for this class was generated from the following files:
Modified on Thu Nov 30 04:53:15 2023 by rev. 669887