|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjebl.evolution.io.NexusImporter
public class NexusImporter
Class for importing NEXUS file format. This is a good starting point for documentation about the nexus file format: https://www.nescent.org/wg_phyloinformatics/NEXUS_Specification For a quick check if something is probably valid or not, consider this attempt at a nexus grammar (the above page says "Don't treat this as gospel, its just an attempt to get the syntax rules"): http://www.cs.nmsu.edu/~epontell/nexus/nexus_grammar
Nested Class Summary | |
---|---|
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 |
Nested classes/interfaces inherited from interface jebl.evolution.io.DistanceMatrixImporter |
---|
DistanceMatrixImporter.Triangle |
Constructor Summary | |
---|---|
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)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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
- Method Detail |
---|
public NexusImporter.NexusBlock findNextBlock() throws java.io.IOException
java.io.IOException
public 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
ImportException
java.io.IOException
public java.util.List<Sequence> parseCharactersBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportException
java.io.IOException
public java.util.List<Sequence> parseDataBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportException
java.io.IOException
public java.util.List<Tree> parseTreesBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportException
java.io.IOException
public DistanceMatrix parseDistancesBlock(java.util.List<Taxon> taxonList) throws ImportException, java.io.IOException
ImportException
java.io.IOException
public java.util.List<Alignment> importAlignments() throws java.io.IOException, ImportException
importAlignments
in interface AlignmentImporter
java.io.IOException
ImportException
public java.util.List<Sequence> importSequences() throws java.io.IOException, ImportException
importSequences
in interface SequenceImporter
java.io.IOException
ImportException
public boolean hasTree() throws java.io.IOException, ImportException
hasTree
in interface TreeImporter
java.io.IOException
ImportException
public Tree importNextTree() throws java.io.IOException, ImportException
importNextTree
in interface TreeImporter
java.io.IOException
ImportException
public java.util.List<Tree> importTrees() throws java.io.IOException, ImportException
importTrees
in interface TreeImporter
java.io.IOException
ImportException
public boolean startReadingTrees() throws java.io.IOException, ImportException
java.io.IOException
ImportException
public java.util.List<DistanceMatrix> importDistanceMatrices() throws java.io.IOException, ImportException
importDistanceMatrices
in interface DistanceMatrixImporter
java.io.IOException
ImportException
public void findEndBlock() throws java.io.IOException
java.io.IOException
public static java.lang.String makeIntoAllowableIdentifier(java.lang.String identifier)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |