Package jebl.evolution.io
Class NexusExporter
- java.lang.Object
-
- jebl.evolution.io.NexusExporter
-
- All Implemented Interfaces:
AlignmentExporter
,SequenceExporter
,TreeExporter
public class NexusExporter extends java.lang.Object implements AlignmentExporter, SequenceExporter, TreeExporter
Export sequences and trees to Nexus format.- Version:
- $Id: NexusExporter.java 1060 2010-06-01 08:52:55Z rambaut $
- Author:
- Andrew Rambaut, Alexei Drummond, Joseph Heled
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
exportExcludeKeys
static int
MAX_ROW_LENGTH
static java.lang.String
treeNameAttributeKey
-
Constructor Summary
Constructors Constructor Description NexusExporter(java.io.Writer writer)
NexusExporter(java.io.Writer writer, boolean writeMetaComments)
NexusExporter(java.io.Writer writer, boolean writeMetaComments, boolean interleave)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exportAlignment(Alignment alignment)
exportAlignment.void
exportMatrix(DistanceMatrix distanceMatrix)
void
exportSequences(java.util.Collection<? extends Sequence> sequences)
export alignment.void
exportTree(Tree tree)
Export a single treevoid
exportTrees(java.util.Collection<? extends Tree> trees)
Export a collection of treesvoid
exportTrees(java.util.Collection<? extends Tree> trees, boolean writeTaxa)
void
exportTreesWithTranslation(java.util.Collection<? extends Tree> trees, java.util.Map<java.lang.String,java.lang.String> t)
static boolean
isGeneratedTreeName(java.lang.String name)
static double
roundDouble(double value, int decimalPlace)
-
-
-
Field Detail
-
treeNameAttributeKey
public static final java.lang.String treeNameAttributeKey
- See Also:
- Constant Field Values
-
exportExcludeKeys
public static final java.lang.String[] exportExcludeKeys
-
MAX_ROW_LENGTH
public static final int MAX_ROW_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NexusExporter
public NexusExporter(java.io.Writer writer)
-
NexusExporter
public NexusExporter(java.io.Writer writer, boolean writeMetaComments)
- Parameters:
writer
- where export text goes
-
NexusExporter
public NexusExporter(java.io.Writer writer, boolean writeMetaComments, boolean interleave)
- Parameters:
writer
- where export text goes
-
-
Method Detail
-
exportAlignment
public void exportAlignment(Alignment alignment) throws java.io.IOException
exportAlignment.- Specified by:
exportAlignment
in interfaceAlignmentExporter
- Parameters:
alignment
- to export- Throws:
java.io.IOException
-
exportSequences
public void exportSequences(java.util.Collection<? extends Sequence> sequences) throws java.io.IOException, java.lang.IllegalArgumentException
export alignment.- Specified by:
exportSequences
in interfaceSequenceExporter
- Throws:
java.io.IOException
java.lang.IllegalArgumentException
-
exportTree
public void exportTree(Tree tree) throws java.io.IOException
Export a single tree- Specified by:
exportTree
in interfaceTreeExporter
- Parameters:
tree
-- Throws:
java.io.IOException
-
exportTrees
public void exportTrees(java.util.Collection<? extends Tree> trees) throws java.io.IOException
Description copied from interface:TreeExporter
Export a collection of trees- Specified by:
exportTrees
in interfaceTreeExporter
- Throws:
java.io.IOException
-
exportTrees
public void exportTrees(java.util.Collection<? extends Tree> trees, boolean writeTaxa) throws java.io.IOException
- Throws:
java.io.IOException
-
exportTreesWithTranslation
public void exportTreesWithTranslation(java.util.Collection<? extends Tree> trees, java.util.Map<java.lang.String,java.lang.String> t) throws java.io.IOException
- Throws:
java.io.IOException
-
exportMatrix
public void exportMatrix(DistanceMatrix distanceMatrix)
-
roundDouble
public static double roundDouble(double value, int decimalPlace)
-
isGeneratedTreeName
public static boolean isGeneratedTreeName(java.lang.String name)
-
-