Alignments
Class DuplicationAlignment

java.lang.Object
  extended by Alignments.Alignment
      extended by Alignments.DuplicationAlignment
All Implemented Interfaces:
java.lang.Iterable<Site>

public class DuplicationAlignment
extends Alignment

Represents a duplication "alignment" - a set of gene families with their associated size in each species

Version:
1.1

Nested Class Summary
 
Nested classes/interfaces inherited from class Alignments.Alignment
Alignment.UniqueSite
 
Field Summary
 
Fields inherited from class Alignments.Alignment
data, hasClasses, taxa
 
Constructor Summary
DuplicationAlignment(java.io.File f)
          Creates a duplication alignment from a file.
DuplicationAlignment(java.io.File f, Ambiguous ambig)
          Creates a duplication alignment which contains ambiguous data.
 
Method Summary
static void writeFile(Alignment a, java.io.File f)
          Writes a alignment to a file in the duplication alignment format described above.
 
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
 

Constructor Detail

DuplicationAlignment

public DuplicationAlignment(java.io.File f)
                     throws InputException,
                            AlignmentException
Creates a duplication alignment from a file. File is tab seperated. First row is a header file. First field is ignored while subsequent fields are the name of the species. Each additional row represents a family. The first field is an ID for the family while subsequent fields are the size of the family in the appropiate species. A family name of *class* is assumed not to be a taxa but rather gfives the class of each site (which can be any string).

Parameters:
f - The input file
Throws:
InputException - Thrown if there is a problem with the input file
AlignmentException - Thrown if any family contains the wrong number of species

DuplicationAlignment

public DuplicationAlignment(java.io.File f,
                            Ambiguous ambig)
                     throws InputException,
                            AlignmentException
Creates a duplication alignment which contains ambiguous data. File format is described DuplicationAlignment(java.io.File).

Parameters:
f - The input file
ambig - Desription o the ambiguous data
Throws:
InputException - Thrown if there is a problem with the input file
AlignmentException - Thrown if any family contains the wrong number of species
Method Detail

writeFile

public static void writeFile(Alignment a,
                             java.io.File f)
                      throws OutputException
Writes a alignment to a file in the duplication alignment format described above.

Parameters:
a - The alignment to write to the file. Need not be a duplication alignment
f - The file to write to
Throws:
OutputException - Thrown if there is a problem creating the file