halapi
hierarchichalalignmentformatapi
 All Classes Namespaces Functions Pages
Public Member Functions | Friends | List of all members
hal::Segment Class Referenceabstract

#include <halSegment.h>

Inheritance diagram for hal::Segment:
hal::BottomSegment hal::SlicedSegment hal::TopSegment hal::BottomSegmentIterator hal::MappedSegment hal::SegmentIterator hal::TopSegmentIterator hal::BottomSegmentIterator hal::GappedSegmentIterator hal::TopSegmentIterator hal::GappedBottomSegmentIterator hal::GappedTopSegmentIterator

Public Member Functions

virtual void setArrayIndex (Genome *genome, hal_index_t arrayIndex)=0
 
virtual void setArrayIndex (const Genome *genome, hal_index_t arrayIndex) const =0
 
virtual const GenomegetGenome () const =0
 
virtual GenomegetGenome ()=0
 
virtual const SequencegetSequence () const =0
 
virtual SequencegetSequence ()=0
 
virtual hal_index_t getStartPosition () const =0
 
virtual hal_index_t getEndPosition () const =0
 
virtual hal_size_t getLength () const =0
 
virtual void getString (std::string &outString) const =0
 
virtual void setCoordinates (hal_index_t startPos, hal_size_t length)=0
 
virtual hal_index_t getArrayIndex () const =0
 
virtual bool leftOf (hal_index_t genomePos) const =0
 
virtual bool rightOf (hal_index_t genomePos) const =0
 
virtual bool overlaps (hal_index_t genomePos) const =0
 
virtual bool isFirst () const =0
 
virtual bool isLast () const =0
 
virtual bool isMissingData (double nThreshold) const =0
 
virtual bool isTop () const =0
 
virtual hal_size_t getMappedSegments (std::set< MappedSegmentConstPtr > &outSegments, const Genome *tgtGenome, const std::set< const Genome * > *genomesOnPath=NULL, bool doDupes=true, hal_size_t minLength=0) const =0
 
virtual void print (std::ostream &os) const =0
 

Friends

class counted_ptr< Segment >
 
class counted_ptr< const Segment >
 

Detailed Description

Interface for a segment of DNA. Note that segments should not be written to outside of creating new genomes.

Member Function Documentation

virtual hal_index_t hal::Segment::getArrayIndex ( ) const
pure virtual

Get the index of the segment in the segment array

virtual hal_index_t hal::Segment::getEndPosition ( ) const
pure virtual

Get the segment's end position (start + len - 1) in the genome Slicing and reversal will apply as above for iterators

virtual const Genome* hal::Segment::getGenome ( ) const
pure virtual

Get the containing (read-only) genome

virtual Genome* hal::Segment::getGenome ( )
pure virtual

Get the containing genome

virtual hal_size_t hal::Segment::getLength ( ) const
pure virtual

Get the length of the segment (number of bases)

virtual hal_size_t hal::Segment::getMappedSegments ( std::set< MappedSegmentConstPtr > &  outSegments,
const Genome tgtGenome,
const std::set< const Genome * > *  genomesOnPath = NULL,
bool  doDupes = true,
hal_size_t  minLength = 0 
) const
pure virtual

Get homologous segments in target genome. Returns the number of mapped segments found.

Parameters
outSegmentsOutput. Mapped segments are sorted along the target genome.
tgtGenomeTarget genome to map to. Can be the same as current.
genomesOnPathIntermediate genomes that must be visited on the way to tgt. If this is specified as NULL, then the path will be computed automatically (using hal::getGenomesInSpanningTree(this->getGenome(), tgtGenome)). Specifying this can avoid recomputing the path over and over again when, say, calling getMappedSegments repeatedly for the same source and target.
doDupesSpecify whether paralogy edges are followed
minLengthMinimum length of segments to consider. It is potentially much faster to filter using this parameter than doing a second pass on the output. If minLength is 0, then no segments are filtered based on length
virtual const Sequence* hal::Segment::getSequence ( ) const
pure virtual

Get the containing (read-only) sequence

virtual Sequence* hal::Segment::getSequence ( )
pure virtual

Get the containing sequence

virtual hal_index_t hal::Segment::getStartPosition ( ) const
pure virtual

Get the start position of the segment. Note that the start position is currently always in FORWARD GENOME coordinates. That said, if the underlying object is an iterator is in reverse orientation, the segment is read from right (startposition) to left (startposition - length -1) Similarly, if called from an iterator, the slicing offsets are taken into account

virtual void hal::Segment::getString ( std::string &  outString) const
pure virtual

Get the DNA string corresponding to the segment from the genome

Parameters
outStringstring into which the results are copied
virtual bool hal::Segment::isFirst ( ) const
pure virtual

Check whether segment is the first segment of a sequence if underlying object is reversed iterator, then checks if last

virtual bool hal::Segment::isLast ( ) const
pure virtual

Check whether segment is the last segment of a sequence if underlying object is reversed iterator, then checks if first

virtual bool hal::Segment::isMissingData ( double  nThreshold) const
pure virtual

Test if the fraction of N's in the segment is greater than a given threshold.

Parameters
nThresholdMaximum fraction of N's in the segment for it to no be considered missing data
virtual bool hal::Segment::isTop ( ) const
pure virtual

Check if underlying segment is a top segment (easier than doing a downcast. Returns true if it's a top segment and false if it's a bottom segment

virtual bool hal::Segment::leftOf ( hal_index_t  genomePos) const
pure virtual

Determine if current segment is to the left of a genome coordinate

Parameters
genomePosIndex of DNA character in genome
virtual bool hal::Segment::overlaps ( hal_index_t  genomePos) const
pure virtual

Determine if current segment is to the right of a genome coordinate

Parameters
genomePosIndex of DNA character in genome
virtual void hal::Segment::print ( std::ostream &  os) const
pure virtual

Print contents of segment

Implemented in hal::MappedSegment.

virtual bool hal::Segment::rightOf ( hal_index_t  genomePos) const
pure virtual

Determine if current segment is to the right of a genome coordinate

Parameters
genomePosIndex of DNA character in genome
virtual void hal::Segment::setArrayIndex ( Genome genome,
hal_index_t  arrayIndex 
)
pure virtual

Set the current array index of the segment. This writes no information to the database, but just moves the position of the segment

Parameters
genomeGenome whose array we want to move segment to
arrayIndexIndex in genomes array (in genome segment coordinates)
virtual void hal::Segment::setArrayIndex ( const Genome genome,
hal_index_t  arrayIndex 
) const
pure virtual

Set the current array index of the segment. This writes no information to the database, but just moves the position of the segment

Parameters
genomeGenome whose array we want to move segment to
arrayIndexIndex in genomes array (in genome segment coordinates)
virtual void hal::Segment::setCoordinates ( hal_index_t  startPos,
hal_size_t  length 
)
pure virtual

Set the segment's start position in the genome

Parameters
startPosStart position
lengthLength

The documentation for this class was generated from the following file: