halapi hierarchichalalignmentformatapi

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
hal::HDF5Alignment Class Reference

`#include <hdf5Alignment.h>`

Inheritance diagram for hal::HDF5Alignment:

List of all members.

## 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)

## Detailed Description

HDF5 implementation of hal::Alignment

## Member Function Documentation

Genome * HDF5Alignment::addLeafGenome | ( | const std::string & | name,
|  | const std::string & | parentName,
|  | double | branchLength
| ) |  | `[virtual]`

Add a new genome to the alignment

Parameters:

  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

Parameters:

  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)

Parameters:

  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

Parameters:

  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)

Parameters:

  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

Parameters:

  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)

Parameters:

  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

Parameters:

  alignmentPath | location on disk
  readOnly | access flag

Implements hal::Alignment.

void HDF5Alignment::removeGenome | ( | const std::string & | name | ) | `[virtual]`

Remove a genome from the alignment

Parameters:

  path | Path of genome to remove

Implements hal::Alignment.

## Friends And Related Function Documentation

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

Parameters:

  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

Parameters:

  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

## Member Data Documentation

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

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

- hdf5_impl/hdf5Alignment.h
- hdf5_impl/hdf5Alignment.cpp

All Classes Namespaces Functions Variables Friends