Alignments
Class PhylipAlignment
java.lang.Object
Alignments.Alignment
Alignments.PhylipAlignment
- All Implemented Interfaces:
- java.lang.Iterable<Site>
public class PhylipAlignment
- extends Alignment
Represents a sequence alignment in Phylip format
- Version:
- 1.2
Constructor Summary |
PhylipAlignment(java.io.File f)
Creates a sequence alignment from a file. |
PhylipAlignment(java.io.File f,
Ambiguous ambig)
Creates a sequence alignment from a file with ambiguouis data. |
Methods inherited from class Alignments.Alignment |
check, getCount, getLength, getNumber, getRawFreq, getSite, getTaxa, getUniqueSites, iterator, limitToTaxa, recode, recode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PhylipAlignment
public PhylipAlignment(java.io.File f)
throws InputException,
AlignmentException
- Creates a sequence alignment from a file. File should be in a format similar
to Phylip. The first non-blank line, which normally gives the number and length
of the sequence, is ignored. Further non-blank lines represent each sequence, one
per line. Anything from the start of the line to the first white space is
considered the taxa's name. Anything after the first whitespace is the sequence.
Whitespace in the sequence is ignored. A taxa name of
*class*
is
assumed not to be a taxa but rather gfives the class of each site (which can be any
single character).
- Parameters:
f
- The input file
- Throws:
InputException
- Thrown if there is a problem reading the file
AlignmentException
- Thrown if there issomething wrong with the alignment, e.g.
different length sequences
PhylipAlignment
public PhylipAlignment(java.io.File f,
Ambiguous ambig)
throws InputException,
AlignmentException
- Creates a sequence alignment from a file with ambiguouis data. File should
be in the format described at
PhylipAlignment(java.io.File)
- Parameters:
f
- The input fileambig
- Desription o the ambiguous data
- Throws:
InputException
- Thrown if there is a problem with the input file
AlignmentException
- Thrown if there issomething wrong with the alignment, e.g.
different length sequences
writeFile
public static void writeFile(Alignment a,
java.io.File f)
throws OutputException
- Writes a alignment to a file in the format described in
PhylipAlignment(java.io.File)
.
- Parameters:
a
- The alignment to write to the file. Need not be a sequence alignmentf
- The file to write to
- Throws:
OutputException
- Thrown if there is a problem creating the file