Spec AnchorGaps
Stores gaps as anchors of the first characters behind gaps.

Extends Gaps
All Extended Gaps
All Impl'd AssignableConcept, ContainerConcept, DestructibleConcept
Defined in <seqan/align.h>
Signature template <typename TSource, typename TGapAnchors = String<GapAnchor<unsigned> > > class Gaps<TSource, AnchorGaps<TGapAnchors> >;

Template Parameters

TSource The type of the underlying sequence.
TGapAnchors The type of the string of GapAnchor objects.

Member Function Overview

Member Functions Inherited From AssignableConcept

Interface Function Overview

Interface Functions Inherited From Gaps

Interface Functions Inherited From AssignableConcept

Interface Functions Inherited From ContainerConcept

Interface Metafunction Overview

Interface Metafunctions Inherited From ContainerConcept

Member Functions Detail

Gaps::Gaps([other]); Gaps::Gaps(source[, anchors]); Gaps::Gaps(anchors);

Constructor

Parameters

other Another AnchorGaps object to copy from.
source The underlying sequence to construct the Gaps object from.
anchors The string of anchors to construct with.

An AnchorGaps object has a default constructor, can be constructed from the underlying source, and/or a string of gap anchors.

Data Races

Thread safety unknown!

Interface Functions Detail

TPos positionGapToSeq(gaps, pos);

Convert from gap space in the global alignment to the sequence space on the reference.

Parameters

gaps Contig AnchorGaps (e.g. from FragmentStore).
pos Position in gap space.

Returns

TPos Position in sequence space (Metafunction: Position).

See the example below to construct the Gaps object. Note that this construction is fast since it is only a thin wrapper around underlying objects.

Examples

Convert from gap space to positions pace when the contig required to be loaded. * Converts position aligned read with index idx in the aligned read store.

typedef typename TFragmentStore::TContigStore                        TContigStore;
typedef typename Value<TContigStore>::Type                           TContig;
typedef typename TFragmentStore::TContigSeq                          TContigSeq;
typedef Gaps<TContigSeq, AnchorGaps<typename TContig::TGapAnchors> > TContigGaps;

typedef typename TFragmentStore::TAlignedReadStore                   TAlignedReadStore;
typedef typename Value<TAlignedReadStore>::Type                      TAlignedRead;
typedef typename TAlignedRead::TPos                                  TAlignedReadPos;

unsigned contigId = alignedReadStore[idx].contigId;
TContigGaps contigGaps(contigStore[contigId].seq, contigStore[contigId].gaps);
TAlignedRead const & alignedRead = alignedReadStore[idx];
// Translate end position from aligned read record to sequence space in reference.
TAlignedReadPos endPos = positionGapToSeq(contigGaps, alignedRead.endPos);

Convert from gap space to position space when the contigs are not required. Converts position aligned read with index $idx$ in the aligned read store.

typedef typename TFragmentStore::TContigStore                        TContigStore;
typedef typename Value<TContigStore>::Type                           TContig;
typedef Gaps<Nothing, AnchorGaps<typename TContig::TGapAnchors> > TContigGaps;

typedef typename TFragmentStore::TAlignedReadStore                   TAlignedReadStore;
typedef typename Value<TAlignedReadStore>::Type                      TAlignedRead;
typedef typename TAlignedRead::TPos                                  TAlignedReadPos;

unsigned contigId = alignedReadStore[idx].contigId;
TContigGaps contigGaps(Nothing(), contigStore[contigId].gaps);
TAlignedRead const & alignedRead = alignedReadStore[idx];
// Translate end position from aligned read record to sequence space in reference.
TAlignedReadPos endPos = positionGapToSeq(contigGaps, alignedRead.endPos);

Data Races

Thread safety unknown!

TPos positionSeqToGap(gaps, pos);

Convert from sequence space on the reference to gap space in the global alignment.

Parameters

gaps The AnchorGaps object to use for the translation.
pos The gap space position to convert to sequence space.

Returns

TPos The resulting position in sequence space (Metafunction: Position).

See the example below to construct the gaps object. Note that this construction is fast since it is only a thin wrapper around underlying objects.

Example

Convert from gap space to position space on contig $contigId$ when the contigs required to be loaded.

typedef typename TFragmentStore::TContigStore                        TContigStore;
typedef typename Value<TContigStore>::Type                           TContig;
typedef typename TFragmentStore::TContigSeq                          TContigSeq;
typedef Gaps<TContigSeq, AnchorGaps<typename TContig::TGapAnchors> > TContigGaps;

TContigGaps contigGaps(contigStore[contigId].seq, contigStore[contigId].gaps);
TAlignedReadPos pos = positionGapToSeq(contigGaps, 33);

Convert from gap space to position space on contig $contigId$ when the contigs are not required.

typedef typename TFragmentStore::TContigStore                        TContigStore;
typedef typename Value<TContigStore>::Type                           TContig;
typedef Gaps<Nothing, AnchorGaps<typename TContig::TGapAnchors> > TContigGaps;

TContigGaps contigGaps(Nothing(), contigStore[contigId].gaps);
TAlignedReadPos endPos = positionGapToSeq(contigGaps, 33);

Data Races

Thread safety unknown!