halapi
hierarchichalalignmentformatapi
|
#include <hdf5Alignment.h>
Public Member Functions | |
void | createNew (const std::string &alignmentPath) |
void | open (const std::string &alignmentPath, bool readOnly) |
void | close () |
Genome * | addLeafGenome (const std::string &name, const std::string &parentName, double branchLength) |
Genome * | addRootGenome (const std::string &name, double branchLength) |
void | removeGenome (const std::string &name) |
const Genome * | openConstGenome (const std::string &name) const |
Genome * | openGenome (const std::string &name) |
std::string | getRootName () const |
std::string | getParentName (const std::string &name) const |
double | getBranchLength (const std::string &parentName, const std::string &childName) const |
std::vector< std::string > | getChildNames (const std::string &name) const |
std::vector< std::string > | getLeafNamesBelow (const std::string &name) const |
hal_size_t | getNumGenomes () const |
MetaData * | getMetaData () |
const MetaData * | getMetaData () const |
std::string | getNewickTree () const |
Protected Member Functions | |
HDF5Alignment (const H5::FileCreatPropList &fileCreateProps, const H5::FileAccPropList &fileAccessProps, const H5::DSetCreatPropList &datasetCreateProps) | |
void | loadTree () |
void | writeTree () |
void | addGenomeToTree (const std::string &name, const std::pair< std::string, double > &parentName, const std::vector< std::pair< std::string, double > > &childNames) |
Protected Attributes | |
H5::H5File * | _file |
H5::FileCreatPropList | _cprops |
H5::FileAccPropList | _aprops |
H5::DSetCreatPropList | _dcprops |
int | _flags |
HDF5MetaData * | _metaData |
stTree * | _tree |
std::map< std::string, stTree * > | _nodeMap |
bool | _dirty |
std::map< std::string, HDF5Genome * > | _openGenomes |
Static Protected Attributes | |
static const H5std_string | MetaGroupName = "Meta" |
static const H5std_string | TreeGroupName = "Phylogeny" |
static const H5std_string | GenomesGroupName = "Genomes" |
Friends | |
AlignmentPtr | hdf5AlignmentInstance () |
AlignmentConstPtr | hdf5AlignmentInstanceReadOnly () |
AlignmentPtr | hdf5AlignmentInstance (const H5::FileCreatPropList &fileCreateProps, const H5::FileAccPropList &fileAccessProps, const H5::DSetCreatPropList &datasetCreateProps) |
AlignmentConstPtr | hdf5AlignmentInstanceReadOnly (const H5::FileCreatPropList &fileCreateProps, const H5::FileAccPropList &fileAccessProps, const H5::DSetCreatPropList &datasetCreateProps) |
HDF5 implementation of hal::Alignment
Genome * HDF5Alignment::addLeafGenome | ( | const std::string & | name, |
const std::string & | parentName, | ||
double | branchLength | ||
) | [virtual] |
Add a new genome to the alignment
name | name of new genome in alignment (must be unique) |
parent | name of parent genome in tree (must exist) |
branchLength | distance between new genome and parent |
Implements hal::Alignment.
Genome * HDF5Alignment::addRootGenome | ( | const std::string & | name, |
double | branchLength | ||
) | [virtual] |
Add a new genome as root to the alignment. The previous root (if exists) will be a child of the new genome
name | name of new genome in alignment (must be unique) |
branchLength | distance between new genome and previous root (if exists) |
Implements hal::Alignment.
void HDF5Alignment::close | ( | ) | [virtual] |
Close the alignment
Implements hal::Alignment.
void HDF5Alignment::createNew | ( | const std::string & | alignmentPath | ) | [virtual] |
Create new alignment (overwriting any existing alignments)
alignmentPath | location on disk |
Implements hal::Alignment.
double HDF5Alignment::getBranchLength | ( | const std::string & | parentName, |
const std::string & | childName | ||
) | const [virtual] |
Get the branch length between two genomes in the phylogeny
parentName | name of parent genome |
childName | name of child genome |
Implements hal::Alignment.
vector< string > HDF5Alignment::getChildNames | ( | const std::string & | name | ) | const [virtual] |
Get names of child genomes in the phylogeny (empty vector for leaves)
name | Name of genome |
Implements hal::Alignment.
vector< string > HDF5Alignment::getLeafNamesBelow | ( | const std::string & | name | ) | const [virtual] |
Get the names of all leaves below a given genome
name | Name of genome |
Implements hal::Alignment.
MetaData * HDF5Alignment::getMetaData | ( | ) | [virtual] |
Get Alignment's metadata
Implements hal::Alignment.
const MetaData * HDF5Alignment::getMetaData | ( | ) | const [virtual] |
Get read-only instance of Alignment's metadata
Implements hal::Alignment.
string HDF5Alignment::getNewickTree | ( | ) | const [virtual] |
Get a newick-formatted phylogeny to the alignment
Implements hal::Alignment.
hal_size_t HDF5Alignment::getNumGenomes | ( | ) | const [virtual] |
Get the number of genomes (including internal ancestors) in the alignment
Implements hal::Alignment.
string HDF5Alignment::getParentName | ( | const std::string & | name | ) | const [virtual] |
Get name of parent genome in the phylogeny (empty string for root)
name | Name of genome |
Implements hal::Alignment.
string HDF5Alignment::getRootName | ( | ) | const [virtual] |
Get name of root genome (empty string for empty alignment)
Implements hal::Alignment.
void hal::HDF5Alignment::open | ( | const std::string & | alignmentPath, |
bool | readOnly | ||
) | [virtual] |
Open an existing alignment
alignmentPath | location on disk |
readOnly | access flag |
Implements hal::Alignment.
void HDF5Alignment::removeGenome | ( | const std::string & | name | ) | [virtual] |
Remove a genome from the alignment
path | Path of genome to remove |
Implements hal::Alignment.
AlignmentPtr hdf5AlignmentInstance | ( | ) | [friend] |
Get an instance of an HDF5-implemented Alignment with default parameters for everything
AlignmentPtr hdf5AlignmentInstance | ( | const H5::FileCreatPropList & | fileCreateProps, |
const H5::FileAccPropList & | fileAccessProps, | ||
const H5::DSetCreatPropList & | datasetCreateProps | ||
) | [friend] |
Get an instance of an HDF5-implemented Alignment while specifying
fileCreateProps | File creation properties. fairly low-level and should generally be set to H5::FileCreatPropList::DEFAULT |
fileAccessProps | File access properties. Contains cache-related stuff |
datasetCreateProps | Compression and chunking parameters among others |
AlignmentConstPtr hdf5AlignmentInstanceReadOnly | ( | ) | [friend] |
Get read-only instance of an HDF5-implemented Alignment with default parameters for everything
AlignmentConstPtr hdf5AlignmentInstanceReadOnly | ( | const H5::FileCreatPropList & | fileCreateProps, |
const H5::FileAccPropList & | fileAccessProps, | ||
const H5::DSetCreatPropList & | datasetCreateProps | ||
) | [friend] |
Get a read-only instance of an HDF5-implemented Alignment while specifying
fileCreateProps | File creation properties. fairly low-level and should generally be set to H5::FileCreatPropList::DEFAULT |
fileAccessProps | File access properties. Contains cache-related stuff |
datasetCreateProps | Compression and chunking parameters among others |
const H5std_string HDF5Alignment::MetaGroupName = "Meta" [static, protected] |
default group name for MetaData attributes, will be a subgroup of the top level of the file, ie /Meta