All Classes Namespaces Functions Pages
hal::Alignment Class Referenceabstract

`#include <halAlignment.h>`

## Public Member Functions

virtual void | createNew (const std::string &alignmentPath)=0
virtual void | open (const std::string &alignmentPath, bool readOnly)=0
virtual void | open (const std::string &alignmentPath) const =0
virtual void | close ()=0
virtual void | close () const =0
virtual void | setOptionsFromParser (CLParserConstPtr parser) const =0
virtual Genome * | addLeafGenome (const std::string &name, const std::string &parentName, double branchLength)=0
virtual Genome * | addRootGenome (const std::string &name, double branchLength=0)=0
virtual void | removeGenome (const std::string &name)=0
virtual const Genome * | openGenome (const std::string &name) const =0
virtual Genome * | openGenome (const std::string &name)=0
virtual void | closeGenome (const Genome *genome) const =0
virtual std::string | getRootName () const =0
virtual std::string | getParentName (const std::string &name) const =0
virtual double | getBranchLength (const std::string &parentName, const std::string &childName) const =0
virtual void | updateBranchLength (const std::string &parentName, const std::string &childName, double length)=0
virtual std::vector< std::string > | getChildNames (const std::string &name) const =0
virtual std::vector< std::string > | getLeafNamesBelow (const std::string &name) const =0
virtual hal_size_t | getNumGenomes () const =0
virtual MetaData * | getMetaData ()=0
virtual const MetaData * | getMetaData () const =0
virtual std::string | getNewickTree () const =0
virtual std::string | getVersion () const =0

## Protected Member Functions

virtual | ~Alignment ()=0

## Friends

class | counted_ptr< Alignment >
class | counted_ptr< const Alignment >

## Detailed Description

Interface for a hierarhcical alignment. Responsible for creating and accessing genomes and tree information. Accesssing a HAL file must always start with an Alignment object

## Constructor & Destructor Documentation

hal::Alignment::~Alignment | ( |  | ) |

inlineprotectedpure virtual

Destructor

## Member Function Documentation

virtual Genome* hal::Alignment::addLeafGenome | ( | const std::string & | name,
|  | const std::string & | parentName,
|  | double | branchLength
| ) |  |

pure 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

virtual Genome* hal::Alignment::addRootGenome | ( | const std::string & | name,
|  | double | branchLength = `0`
| ) |  |

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

virtual void hal::Alignment::close | ( |  | ) |

pure virtual

Close the alignment

virtual void hal::Alignment::close | ( |  | ) | const

pure virtual

Close the alignment

virtual void hal::Alignment::closeGenome | ( | const Genome * | genome | ) | const

pure virtual

Close an open genome. All pointers to this genome become invalid and openGenome needs to be called again to access it

Parameters

  genome | Genome to close

virtual void hal::Alignment::createNew | ( | const std::string & | alignmentPath | ) |

pure virtual

Create new alignment (overwriting any existing alignments)

Parameters

  alignmentPath | location on disk

virtual double hal::Alignment::getBranchLength | ( | const std::string & | parentName,
|  | const std::string & | childName
| ) |  | const

pure virtual

Get the branch length between two genomes in the phylogeny

Parameters

  parentName | name of parent genome
  childName | name of child genome

virtual std::vector<std::string> hal::Alignment::getChildNames | ( | const std::string & | name | ) | const

pure virtual

Get names of child genomes in the phylogeny (empty vector for leaves)

Parameters

  name | Name of genome

virtual std::vector<std::string> hal::Alignment::getLeafNamesBelow | ( | const std::string & | name | ) | const

pure virtual

Get the names of all leaves below a given genome

Parameters

  name | Name of genome

virtual MetaData* hal::Alignment::getMetaData | ( |  | ) |

pure virtual

Get Alignment's metadata

virtual const MetaData* hal::Alignment::getMetaData | ( |  | ) | const

pure virtual

Get read-only instance of Alignment's metadata

virtual std::string hal::Alignment::getNewickTree | ( |  | ) | const

pure virtual

Get a newick-formatted phylogeny to the alignment

virtual hal_size_t hal::Alignment::getNumGenomes | ( |  | ) | const

pure virtual

Get the number of genomes (including internal ancestors) in the alignment

virtual std::string hal::Alignment::getParentName | ( | const std::string & | name | ) | const

pure virtual

Get name of parent genome in the phylogeny (empty string for root)

Parameters

  name | Name of genome

virtual std::string hal::Alignment::getRootName | ( |  | ) | const

pure virtual

Get name of root genome (empty string for empty alignment)

virtual std::string hal::Alignment::getVersion | ( |  | ) | const

pure virtual

Get version used to create the file

virtual void hal::Alignment::open | ( | const std::string & | alignmentPath,
|  | bool | readOnly
| ) |  |

pure virtual

Open an existing alignment

Parameters

  alignmentPath | location on disk
  readOnly | access flag

virtual void hal::Alignment::open | ( | const std::string & | alignmentPath | ) | const

pure virtual

Open an existing alignment for reading only

Parameters

  alignmentPath | location on disk

virtual const Genome* hal::Alignment::openGenome | ( | const std::string & | name | ) | const

pure virtual

Open an existing genome for reading and updating

Parameters

  name | Name of genome to open

virtual Genome* hal::Alignment::openGenome | ( | const std::string & | name | ) |

pure virtual

Open an exsting genome for reading

Parameters

  name | Name of genome to open

virtual void hal::Alignment::removeGenome | ( | const std::string & | name | ) |

pure virtual

Remove a genome from the alignment

Parameters

  path | Path of genome to remove

virtual void hal::Alignment::setOptionsFromParser | ( | CLParserConstPtr | parser | ) | const

pure virtual

Set options from parser

Parameters

  clParser | pointer to command-line parser

virtual void hal::Alignment::updateBranchLength | ( | const std::string & | parentName,
|  | const std::string & | childName,
|  | double | length
| ) |  |

pure virtual

Change the branch length between two genomes in the phylogeny

Parameters

  parentName | name of parent genome
  childName | name of child genome

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

- inc/halAlignment.h