Alignments
Class FastaAlignment
java.lang.Object
Alignments.Alignment
Alignments.FastaAlignment
- All Implemented Interfaces:
- java.lang.Iterable<Site>
public class FastaAlignment
- extends Alignment
Represents a sequence alignment in FASTA format
- Version:
- 1.2
Constructor Summary |
FastaAlignment(java.io.File f)
Creates a sequence alignment from a file. |
FastaAlignment(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 |
FastaAlignment
public FastaAlignment(java.io.File f)
throws InputException,
AlignmentException
- Creates a sequence alignment from a file. File should be in Fasta format
File should consist of a line beginningb with a ">" followed by the taxa name -
anything after a "|" is ignored. The following lines to the next line
beginning with ">" are tjhe sequence associated with that taxa. Blank lines
are ignored. Comments, i.e. lines beginning with ";" are NOT supported.
A taxa name of
*class*
is
assumed not to be a taxa but rather gives the class of each site (which can be any
single character).
- Parameters:
f
- The input file
- 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
FastaAlignment
public FastaAlignment(java.io.File f,
Ambiguous ambig)
throws InputException,
AlignmentException
- Creates a sequence alignment from a file with ambiguouis data. File should
be in
FastaAlignment(java.io.File)
- Parameters:
f
- The input fileambig
- Desription of 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
FastaAlignment(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