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

#include <halGenome.h>

Inheritance diagram for hal::Genome:
hal::SegmentedSequence

Public Member Functions

virtual const std::string & getName () const =0
 
virtual void setDimensions (const std::vector< hal::Sequence::Info > &sequenceDimensions, bool storeDNAArrays=true)=0
 
virtual void updateTopDimensions (const std::vector< hal::Sequence::UpdateInfo > &sequenceDimensions)=0
 
virtual void updateBottomDimensions (const std::vector< hal::Sequence::UpdateInfo > &sequenceDimensions)=0
 
virtual hal_size_t getNumSequences () const =0
 
virtual SequencegetSequence (const std::string &name)=0
 
virtual const SequencegetSequence (const std::string &name) const =0
 
virtual SequencegetSequenceBySite (hal_size_t position)=0
 
virtual const SequencegetSequenceBySite (hal_size_t position) const =0
 
virtual SequenceIteratorPtr getSequenceIterator (hal_index_t position=0)=0
 
virtual SequenceIteratorConstPtr getSequenceIterator (hal_index_t position=0) const =0
 
virtual SequenceIteratorConstPtr getSequenceEndIterator () const =0
 
virtual MetaDatagetMetaData ()=0
 
virtual const MetaDatagetMetaData () const =0
 
virtual GenomegetParent ()=0
 
virtual const GenomegetParent () const =0
 
virtual GenomegetChild (hal_size_t childIdx)=0
 
virtual const GenomegetChild (hal_size_t childIdx) const =0
 
virtual hal_size_t getNumChildren () const =0
 
virtual hal_index_t getChildIndex (const Genome *child) const =0
 
virtual bool containsDNAArray () const =0
 
virtual const AlignmentgetAlignment () const =0
 
- Public Member Functions inherited from hal::SegmentedSequence
virtual hal_size_t getSequenceLength () const =0
 
virtual hal_size_t getNumTopSegments () const =0
 
virtual hal_size_t getNumBottomSegments () const =0
 
virtual TopSegmentIteratorPtr getTopSegmentIterator (hal_index_t position=0)=0
 
virtual TopSegmentIteratorConstPtr getTopSegmentIterator (hal_index_t position=0) const =0
 
virtual TopSegmentIteratorConstPtr getTopSegmentEndIterator () const =0
 
virtual BottomSegmentIteratorPtr getBottomSegmentIterator (hal_index_t position=0)=0
 
virtual
BottomSegmentIteratorConstPtr 
getBottomSegmentIterator (hal_index_t position=0) const =0
 
virtual
BottomSegmentIteratorConstPtr 
getBottomSegmentEndIterator () const =0
 
virtual DNAIteratorPtr getDNAIterator (hal_index_t position=0)=0
 
virtual DNAIteratorConstPtr getDNAIterator (hal_index_t position=0) const =0
 
virtual DNAIteratorConstPtr getDNAEndIterator () const =0
 
virtual ColumnIteratorConstPtr getColumnIterator (const std::set< const Genome * > *targets=NULL, hal_size_t maxInsertLength=0, hal_index_t position=0, hal_index_t lastPosition=NULL_INDEX, bool noDupes=false, bool noAncestors=false, bool reverseStrand=false) const =0
 
virtual void getString (std::string &outString) const =0
 
virtual void setString (const std::string &inString)=0
 
virtual void getSubString (std::string &outString, hal_size_t start, hal_size_t length) const =0
 
virtual void setSubString (const std::string &inString, hal_size_t start, hal_size_t length)=0
 
virtual RearrangementPtr getRearrangement (hal_index_t position, hal_size_t gapLengthThreshold, double nThreshold, bool atomic=false) const =0
 
virtual
GappedTopSegmentIteratorConstPtr 
getGappedTopSegmentIterator (hal_index_t i, hal_size_t gapThreshold, bool atomic=false) const =0
 
virtual
GappedBottomSegmentIteratorConstPtr 
getGappedBottomSegmentIterator (hal_index_t i, hal_size_t childIdx, hal_size_t gapThreshold, bool atomic=false) const =0
 

Protected Member Functions

virtual ~Genome ()=0
 
- Protected Member Functions inherited from hal::SegmentedSequence
virtual ~SegmentedSequence ()=0
 

Detailed Description

Interface for a genome within a hal alignment. The genome is comprised of a dna sequence, and two segment arrays (top and bottom) which are used to map between ancestral and descendant genomes. This data is all accessed through iterators.

Constructor & Destructor Documentation

hal::Genome::~Genome ( )
inlineprotectedpure virtual

Destructor

Member Function Documentation

virtual bool hal::Genome::containsDNAArray ( ) const
pure virtual

Test if the genome stores DNA sequence. Will be true unless storeDNAArrays was set to false in setDimensions

virtual const Alignment* hal::Genome::getAlignment ( ) const
pure virtual

Get a pointer to the alignment object that contains the genome. Be careful not to free this pointer or put it inside an AlignmentConstPtr object since its memory is already spoken for

virtual Genome* hal::Genome::getChild ( hal_size_t  childIdx)
pure virtual

Get child genome

Parameters
childIdxindex of child genome
virtual const Genome* hal::Genome::getChild ( hal_size_t  childIdx) const
pure virtual

Get const child genome

Parameters
childIdxindex of child genome
virtual hal_index_t hal::Genome::getChildIndex ( const Genome child) const
pure virtual

Get the numeric index of a given child Genome child genome

virtual MetaData* hal::Genome::getMetaData ( )
pure virtual

Get genome-specific metadata for this genome

virtual const MetaData* hal::Genome::getMetaData ( ) const
pure virtual

Get read-only instance of genome-specific metadata for this genome

virtual const std::string& hal::Genome::getName ( ) const
pure virtual

Get the name of the genome

virtual hal_size_t hal::Genome::getNumChildren ( ) const
pure virtual

Get number of child genomes

virtual hal_size_t hal::Genome::getNumSequences ( ) const
pure virtual

Get number of sequences in the genome

virtual Genome* hal::Genome::getParent ( )
pure virtual

Get the parent genome

virtual const Genome* hal::Genome::getParent ( ) const
pure virtual

Get const parent genome

virtual Sequence* hal::Genome::getSequence ( const std::string &  name)
pure virtual

Get a sequence by name

virtual const Sequence* hal::Genome::getSequence ( const std::string &  name) const
pure virtual

Get a (read-only) sequence by name

virtual Sequence* hal::Genome::getSequenceBySite ( hal_size_t  position)
pure virtual

Get a sequence by base's position (in genome coordinates)

virtual const Sequence* hal::Genome::getSequenceBySite ( hal_size_t  position) const
pure virtual

Get a sequence by base's position (in genome coordinates)

virtual SequenceIteratorConstPtr hal::Genome::getSequenceEndIterator ( ) const
pure virtual

Get a sequence end iterator (one beyond last element in list)

virtual SequenceIteratorPtr hal::Genome::getSequenceIterator ( hal_index_t  position = 0)
pure virtual

Get a sequence iterator

Parameters
positionNumber of the sequence to start iterator at
virtual SequenceIteratorConstPtr hal::Genome::getSequenceIterator ( hal_index_t  position = 0) const
pure virtual

Get a const sequence iterator

Parameters
positionNumber of the sequence to start iterator at
virtual void hal::Genome::setDimensions ( const std::vector< hal::Sequence::Info > &  sequenceDimensions,
bool  storeDNAArrays = true 
)
pure virtual

Reset (or initialize) the dimensions of the genome Note that there are no guarantees that any of the current data gets preserved so this should only be used for creating or completely rewriting a genome. The phylogenetic information (ex number of children) is read from the Aignment object

Parameters
sequenceDimensionsList of information for all sequences that are to be contained in the genome.
storeDNAArraysAllocate arrays for DNA sequences. This is and should be true by default, but we introduce the option to allow creating of HAL alignments without DNA information (ie just blocks). This functionality is used for halLodExtract, for example.
virtual void hal::Genome::updateBottomDimensions ( const std::vector< hal::Sequence::UpdateInfo > &  sequenceDimensions)
pure virtual

Update the number of bottom segments in existing sequences of the genome, leaving the rest of the genome intact.

Parameters
sequenceDimensionsList of sequences names and their associated number of bottom segments. These sequences must have already been added using setDimensions (or error is thrown).
virtual void hal::Genome::updateTopDimensions ( const std::vector< hal::Sequence::UpdateInfo > &  sequenceDimensions)
pure virtual

Update the number of top segments in existing sequences of the genome, leaving the rest of the genome intact.

Parameters
sequenceDimensionsList of sequences names and their associated number of top segments. These sequences must have already been added using setDimensions (or error is thrown).

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