halapi
hierarchichalalignmentformatapi
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
hal::HDF5Genome Class Reference

#include <hdf5Genome.h>

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

List of all members.

Public Member Functions

 HDF5Genome (const std::string &name, HDF5Alignment *alignment, H5::CommonFG *h5Parent, const H5::DSetCreatPropList &dcProps)
const std::string & getName () const
void setDimensions (const std::vector< hal::Sequence::Info > &sequenceDimensions)
void setTopDimensions (const std::vector< hal::Sequence::UpdateInfo > &sequenceDimensions)
void setBottomDimensions (const std::vector< hal::Sequence::UpdateInfo > &sequenceDimensions)
hal_size_t getNumSequences () const
SequencegetSequence (const std::string &name)
const SequencegetSequence (const std::string &name) const
SequencegetSequenceBySite (hal_size_t position)
const SequencegetSequenceBySite (hal_size_t position) const
SequenceIteratorPtr getSequenceIterator (hal_index_t position)
SequenceIteratorConstPtr getSequenceIterator (hal_index_t position) const
MetaDatagetMetaData ()
const MetaDatagetMetaData () const
GenomegetParent ()
const GenomegetParent () const
GenomegetChild (hal_size_t childIdx)
const GenomegetChild (hal_size_t childIdx) const
hal_size_t getNumChildren () const
hal_size_t getSequenceLength () const
hal_size_t getNumTopSegments () const
hal_size_t getNumBottomSegments () const
TopSegmentIteratorPtr getTopSegmentIterator (hal_index_t position)
TopSegmentIteratorConstPtr getTopSegmentIterator (hal_index_t position) const
BottomSegmentIteratorPtr getBottomSegmentIterator (hal_index_t position)
BottomSegmentIteratorConstPtr getBottomSegmentIterator (hal_index_t position) const
void getString (std::string &outString) const
void setString (const std::string &inString)
void getSubString (std::string &outString, hal_size_t start, hal_size_t length) const
void setSubString (const std::string &intString, hal_size_t start, hal_size_t length)
void write ()
void read ()
void create ()
void resetTreeCache ()

Protected Member Functions

void readSequences ()
void writeSequences (const std::vector< hal::Sequence::Info > &sequenceDimensions)
void deleteSequenceCache ()

Protected Attributes

HDF5Alignment_alignment
H5::CommonFG * _h5Parent
AlignmentPtr _alignmentPtr
std::string _name
HDF5MetaData_metaData
HDF5ExternalArray _dnaArray
HDF5ExternalArray _topArray
HDF5ExternalArray _bottomArray
HDF5ExternalArray _sequenceArray
H5::Group _group
H5::DSetCreatPropList _dcprops
hal_size_t _numChildrenInBottomArray
Genome_parentCache
std::vector< Genome * > _childCache
std::map< hal_size_t,
HDF5Sequence * > 
_sequencePosCache
std::map< std::string,
HDF5Sequence * > 
_sequenceNameCache

Static Protected Attributes

static const std::string dnaArrayName = "DNA_ARRAY"
static const std::string topArrayName = "TOP_ARRAY"
static const std::string bottomArrayName = "BOTTOM_ARRAY"
static const std::string sequenceArrayName = "SEQUENCE_ARRAY"
static const std::string metaGroupName = "Meta"

Friends

class HDF5TopSegmentIterator
class HDF5BottomSegmentIterator
class HDF5DNAIterator
class HDF5SequenceIterator

Detailed Description

HDF5 implementation of hal::Genome


Member Function Documentation

BottomSegmentIteratorPtr HDF5Genome::getBottomSegmentIterator ( hal_index_t  position) [virtual]

Get a bottom segment iterator

Parameters:
positionIndex in segment array of returned iterator

Implements hal::SegmentedSequence.

BottomSegmentIteratorConstPtr HDF5Genome::getBottomSegmentIterator ( hal_index_t  position) const [virtual]

Get a const bottom segment iterator

Parameters:
positionIndex in segment array of returned iterator

Implements hal::SegmentedSequence.

Genome * HDF5Genome::getChild ( hal_size_t  childIdx) [virtual]

Get child genome

Parameters:
childIdxindex of child genome

Implements hal::Genome.

const Genome * HDF5Genome::getChild ( hal_size_t  childIdx) const [virtual]

Get const child genome

Parameters:
childIdxindex of child genome

Implements hal::Genome.

MetaData * HDF5Genome::getMetaData ( ) [virtual]

Get genome-specific metadata for this genome

Implements hal::Genome.

const MetaData * HDF5Genome::getMetaData ( ) const [virtual]

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

Implements hal::Genome.

const string & HDF5Genome::getName ( ) const [virtual]

Get the name of the genome

Implements hal::Genome.

hal_size_t HDF5Genome::getNumBottomSegments ( ) const [virtual]

Get the number of bottom segments (which form blocks with the children) in the sequence

Implements hal::SegmentedSequence.

hal_size_t HDF5Genome::getNumChildren ( ) const [virtual]

Get number of child genomes

Implements hal::Genome.

hal_size_t HDF5Genome::getNumSequences ( ) const [virtual]

Get number of sequences in the genome

Implements hal::Genome.

hal_size_t HDF5Genome::getNumTopSegments ( ) const [virtual]

Get the number of top segements (which form blocks with ancestor and siblings) in the sequence

Implements hal::SegmentedSequence.

Genome * HDF5Genome::getParent ( ) [virtual]

Get the parent genome

Implements hal::Genome.

const Genome * HDF5Genome::getParent ( ) const [virtual]

Get const parent genome

Implements hal::Genome.

Sequence* hal::HDF5Genome::getSequence ( const std::string &  name) [virtual]

Get a sequence by name

Implements hal::Genome.

const Sequence* hal::HDF5Genome::getSequence ( const std::string &  name) const [virtual]

Get a (read-only) sequence by name

Implements hal::Genome.

Sequence * HDF5Genome::getSequenceBySite ( hal_size_t  position) [virtual]

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

Implements hal::Genome.

const Sequence * HDF5Genome::getSequenceBySite ( hal_size_t  position) const [virtual]

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

Implements hal::Genome.

SequenceIteratorPtr HDF5Genome::getSequenceIterator ( hal_index_t  position) [virtual]

Get a sequence iterator

Parameters:
positionNumber of the sequence to start iterator at

Implements hal::Genome.

SequenceIteratorConstPtr HDF5Genome::getSequenceIterator ( hal_index_t  position) const [virtual]

Get a const sequence iterator

Parameters:
positionNumber of the sequence to start iterator at

Implements hal::Genome.

hal_size_t HDF5Genome::getSequenceLength ( ) const [virtual]

Get the total length of the DNA sequence in the sequence

Implements hal::SegmentedSequence.

void hal::HDF5Genome::getString ( std::string &  outString) const [virtual]

Get the character string underlying the segmented sequence

Parameters:
outStringString object into which we copy the result

Implements hal::SegmentedSequence.

void hal::HDF5Genome::getSubString ( std::string &  outString,
hal_size_t  start,
hal_size_t  length 
) const [virtual]

Get the substring of character string underlying the segmented sequence

Parameters:
outStringString object into which we copy the result
startFirst position of substring
lengthLength of substring

Implements hal::SegmentedSequence.

TopSegmentIteratorPtr HDF5Genome::getTopSegmentIterator ( hal_index_t  position) [virtual]

Get a top segment iterator

Parameters:
positionIndex in segment array of returned iterator

Implements hal::SegmentedSequence.

TopSegmentIteratorConstPtr HDF5Genome::getTopSegmentIterator ( hal_index_t  position) const [virtual]

Get a const top segment iterator

Parameters:
positionIndex in segment array of returned iterator

Implements hal::SegmentedSequence.

void HDF5Genome::setBottomDimensions ( const std::vector< hal::Sequence::UpdateInfo > &  sequenceDimensions) [virtual]

Reset (or initialize) the number of bottom segments in each sequence of the genome, leaving the rest of the genome intact.

Parameters:
sequenceDimensionsNumber of bottom segments in each sequence if there is a sequence presently in the genome but not in this list it will not be updated.

Implements hal::Genome.

void HDF5Genome::setDimensions ( const std::vector< hal::Sequence::Info > &  sequenceDimensions) [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.

Implements hal::Genome.

void hal::HDF5Genome::setString ( const std::string &  inString) [virtual]

Set the character string underlying the segmented sequence

Parameters:
inStringinput string to copy

Implements hal::SegmentedSequence.

void hal::HDF5Genome::setSubString ( const std::string &  inString,
hal_size_t  start,
hal_size_t  length 
) [virtual]

Set the character string underlying the segmented sequence

Parameters:
inStringinput string to copy
startFirst position of substring
lengthLength of substring

Implements hal::SegmentedSequence.

void HDF5Genome::setTopDimensions ( const std::vector< hal::Sequence::UpdateInfo > &  sequenceDimensions) [virtual]

Reset (or initialize) the number of top segments in each sequence of the genome, leaving the rest of the genome intact.

Parameters:
sequenceDimensionsNumber of top segments in each sequence if there is a sequence presently in the genome but not in this list it will not be updated.

Implements hal::Genome.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Friends