public class NexusImporter extends java.lang.Object implements AlignmentImporter, SequenceImporter, TreeImporter, DistanceMatrixImporter
| Modifier and Type | Class and Description |
|---|---|
static class |
NexusImporter.MissingBlockException
Thrown when a block is missing that is required for importing a particular type of data from the nexus input.
|
static class |
NexusImporter.NexusBlock
Represents the block types used in the nexus format
|
DistanceMatrixImporter.Triangle| Constructor and Description |
|---|
NexusImporter(java.io.Reader reader) |
NexusImporter(java.io.Reader reader,
boolean compactTrees)
Deprecated.
Use NexusImporter(Reader reader, boolean compactTrees, long expectedInputLength)
|
NexusImporter(java.io.Reader reader,
boolean compactTrees,
long expectedInputLength) |
NexusImporter(java.io.Reader reader,
long expectedLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
findEndBlock()
Read ahead to the end of the current block.
|
NexusImporter.NexusBlock |
findNextBlock()
Read ahead to the next block in the input.
|
java.lang.String |
getNextBlockName() |
boolean |
hasTree()
If not currently reading a TREES block then read ahead to the next TREES block, parsing TRANSLATE and TAXA blocks
in the process if necessary.
|
java.util.List<Alignment> |
importAlignments()
Import all alignments in the input from the current position.
|
java.util.List<DistanceMatrix> |
importDistanceMatrices()
Import all distance matrices from all DISTANCES blocks in the input form the current position.
|
Tree |
importNextTree()
If not currently reading a TREES block then read ahead to the next TREES block, parsing TRANSLATE and TAXA blocks
in the process if necessary.
|
java.util.List<Sequence> |
importSequences()
Import all sequences in the input from the current position
|
java.util.List<Tree> |
importTrees()
Import all trees in the file from the current position.
|
java.util.Iterator<Tree> |
iterator() |
static java.lang.String |
makeIntoAllowableIdentifier(java.lang.String identifier) |
java.util.List<Sequence> |
parseCharactersBlock(java.util.List<Taxon> taxonList)
Parse the next 'CHARACTERS' block encountered in the input.
|
java.util.List<Sequence> |
parseDataBlock(java.util.List<Taxon> taxonList)
Parse the next 'DATA' block encountered in the input.
|
DistanceMatrix |
parseDistancesBlock(java.util.List<Taxon> taxonList)
Parse the next 'DISTANCES' block encountered in the input.
|
java.util.List<Taxon> |
parseTaxaBlock()
Parse the next 'TAXA' block encountered in the input.
|
java.util.List<Tree> |
parseTreesBlock(java.util.List<Taxon> taxonList)
Parse the next 'TREES' block encountered in the input.
|
boolean |
startReadingTrees()
Read nexus blocks until the next TREES block (or the end of the input) is encountered.
|
public NexusImporter(java.io.Reader reader,
long expectedLength)
reader - expectedLength - Expected length of the input in bytes, or 0 if unknown. Used for optimization and tracking
progress.public NexusImporter(java.io.Reader reader)
public NexusImporter(java.io.Reader reader,
boolean compactTrees,
long expectedInputLength)
reader - compactTrees - true to import trees as CompactRootedTree, false to use
SimpleRootedTree.expectedInputLength - Expected length of the input in bytes, or 0 if unknown. Used for optimization and tracking
progress.@Deprecated
public NexusImporter(java.io.Reader reader,
boolean compactTrees)
reader - compactTrees - public NexusImporter.NexusBlock findNextBlock() throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getNextBlockName()
jebl.evolution.io.NexusImporter.NexusBlock}public java.util.Iterator<Tree> iterator()
iterator in interface java.lang.Iterable<Tree>public java.util.List<Taxon> parseTaxaBlock() throws ImportException, java.io.IOException
ImportExceptionjava.io.IOExceptionpublic java.util.List<Sequence> parseCharactersBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportExceptionjava.io.IOExceptionpublic java.util.List<Sequence> parseDataBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportExceptionjava.io.IOExceptionpublic java.util.List<Tree> parseTreesBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportExceptionjava.io.IOExceptionpublic DistanceMatrix parseDistancesBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportExceptionjava.io.IOExceptionpublic java.util.List<Alignment> importAlignments() throws java.io.IOException, ImportException
importAlignments in interface AlignmentImporterjava.io.IOExceptionImportExceptionpublic java.util.List<Sequence> importSequences() throws java.io.IOException, ImportException
importSequences in interface SequenceImporterjava.io.IOExceptionImportExceptionpublic boolean hasTree()
throws java.io.IOException,
ImportException
hasTree in interface TreeImporterjava.io.IOExceptionImportExceptionpublic Tree importNextTree() throws java.io.IOException, ImportException
importNextTree in interface TreeImporterjava.io.IOExceptionImportExceptionpublic java.util.List<Tree> importTrees() throws java.io.IOException, ImportException
importTrees in interface TreeImporterjava.io.IOExceptionImportExceptionpublic boolean startReadingTrees()
throws java.io.IOException,
ImportException
java.io.IOExceptionImportExceptionpublic java.util.List<DistanceMatrix> importDistanceMatrices() throws java.io.IOException, ImportException
importDistanceMatrices in interface DistanceMatrixImporterjava.io.IOExceptionImportExceptionpublic void findEndBlock()
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String makeIntoAllowableIdentifier(java.lang.String identifier)
http://code.google.com/p/jebl2/