jebl.evolution.io
Class FastaImporter

java.lang.Object
  extended by jebl.evolution.io.FastaImporter
All Implemented Interfaces:
ImmediateSequenceImporter, SequenceImporter

public class FastaImporter
extends Object
implements SequenceImporter, ImmediateSequenceImporter

Class for importing Fasta sequential file format.

Author:
Andrew Rambaut, Alexei Drummond, Joseph Heled

Nested Class Summary
 
Nested classes/interfaces inherited from interface jebl.evolution.io.ImmediateSequenceImporter
ImmediateSequenceImporter.Callback
 
Field Summary
static String descriptionPropertyName
          Name of Jebl sequence property which stores sequence description (i.e.
 
Constructor Summary
FastaImporter(File file, SequenceType sequenceType)
          Use this constructor if you are reading from a file.
FastaImporter(Reader reader, SequenceType sequenceType)
          Deprecated. 
 
Method Summary
 List<Sequence> importSequences()
          importSequences.
 void importSequences(ImmediateSequenceImporter.Callback callback, ProgressListener progressListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

descriptionPropertyName

public static final String descriptionPropertyName
Name of Jebl sequence property which stores sequence description (i.e. anything after sequence name in fasta file), so this data is available and an export to fasta can preserves the original data. This is stored some attribute of the sequence and of the taxon for backwards compatibility. Generally, attributes on taxon should not be used, as they are unsafe when dealing with objects that share the same taxon.

See Also:
Constant Field Values
Constructor Detail

FastaImporter

public FastaImporter(File file,
                     SequenceType sequenceType)
              throws FileNotFoundException
Use this constructor if you are reading from a file. The advantage over the other constructor is that a) the input size is known, so read() can report meaningful progress, and b) the file is closed at the end.

Parameters:
file -
sequenceType -
Throws:
FileNotFoundException

FastaImporter

@Deprecated
public FastaImporter(Reader reader,
                                SequenceType sequenceType)
Deprecated. 

This constructor should normally never be needed because usually we want to import from a file. Then, the constructor expecting a file should be used. Therefore, this constructor is deprecated for now.

Parameters:
reader - holds sequences data
sequenceType - pre specified sequences type. We should try and guess them some day.
Method Detail

importSequences

public final List<Sequence> importSequences()
                                     throws IOException,
                                            ImportException
Description copied from interface: SequenceImporter
importSequences.

Specified by:
importSequences in interface SequenceImporter
Returns:
sequences from file.
Throws:
IOException
ImportException

importSequences

public void importSequences(ImmediateSequenceImporter.Callback callback,
                            ProgressListener progressListener)
                     throws IOException,
                            ImportException
Specified by:
importSequences in interface ImmediateSequenceImporter
Throws:
IOException
ImportException