jebl.evolution.io
Class NexusExporter

java.lang.Object
  extended by jebl.evolution.io.NexusExporter
All Implemented Interfaces:
AlignmentExporter, SequenceExporter, TreeExporter

public class NexusExporter
extends Object
implements AlignmentExporter, SequenceExporter, TreeExporter

Export sequences and trees to Nexus format.

Author:
Joseph Heled

Field Summary
static String treeNameAttributeKey
           
protected  PrintWriter writer
           
 
Constructor Summary
NexusExporter(Writer writer)
           
 
Method Summary
 void exportAlignment(Alignment alignment)
          exportAlignment.
 void exportMatrix(DistanceMatrix distanceMatrix)
           
 void exportSequences(Collection<? extends Sequence> sequences)
          export alignment.
 void exportTree(Tree tree)
          Export a single tree
 void exportTrees(Collection<? extends Tree> trees)
          export trees
 void exportTreesWithTranslation(Collection<? extends Tree> trees, Map<String,String> t)
           
static boolean isGeneratedTreeName(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treeNameAttributeKey

public static String treeNameAttributeKey

writer

protected final PrintWriter writer
Constructor Detail

NexusExporter

public NexusExporter(Writer writer)
Parameters:
writer - where export text goes
Method Detail

exportAlignment

public void exportAlignment(Alignment alignment)
                     throws IOException
exportAlignment.

Specified by:
exportAlignment in interface AlignmentExporter
Throws:
IOException

exportSequences

public void exportSequences(Collection<? extends Sequence> sequences)
                     throws IOException,
                            IllegalArgumentException
export alignment.

Specified by:
exportSequences in interface SequenceExporter
Throws:
IOException
IllegalArgumentException

exportTree

public void exportTree(Tree tree)
                throws IOException
Export a single tree

Specified by:
exportTree in interface TreeExporter
Parameters:
tree -
Throws:
IOException

exportTrees

public void exportTrees(Collection<? extends Tree> trees)
                 throws IOException
export trees

Specified by:
exportTrees in interface TreeExporter
Throws:
IOException

exportTreesWithTranslation

public void exportTreesWithTranslation(Collection<? extends Tree> trees,
                                       Map<String,String> t)
                                throws IOException
Throws:
IOException

exportMatrix

public void exportMatrix(DistanceMatrix distanceMatrix)

isGeneratedTreeName

public static boolean isGeneratedTreeName(String name)