BioLegato 0.7.5 GDE plugin

org.biolegato.gdesupport.files
Class FastAFile

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.biolegato.gdesupport.files.DataFormat
          extended by org.biolegato.gdesupport.files.FastAFile

public class FastAFile
extends DataFormat

FastA file format parser. NOTE: this parser will automatically detect whether the sequencebuffer is protein, RNA or DNA.

Author:
Graham Alvare, Brian Fristensky

Field Summary
 
Fields inherited from class org.biolegato.gdesupport.files.DataFormat
FASTA, FORMAT_LIST, GDEFILE, GDEFLAT, GENBANK
 
Constructor Summary
FastAFile()
          Creates a new instance of FastAFile
 
Method Summary
 boolean accept(java.io.File file)
          Determines whether a specified file is of type GenBank file (based on extension).
 java.lang.String getDescription()
          Returns a description of the file format that can be displayed to the user.
 boolean isFormat(java.io.Reader test)
          Used to auto-detect Bio Legato formats
 void translateFrom(Dataset datamodel, java.io.BufferedReader data)
          Translates data in the FastA file format to sequence objects
 void translateTo(java.lang.Appendable result, Seq seq, int offset, int length)
          Translates a sequence into the FastA file format.
 
Methods inherited from class org.biolegato.gdesupport.files.DataFormat
autodetect, getFormat, getName, readFile, readFile, writeAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastAFile

public FastAFile()
Creates a new instance of FastAFile

Method Detail

translateTo

public void translateTo(java.lang.Appendable result,
                        Seq seq,
                        int offset,
                        int length)
                 throws java.io.IOException
Translates a sequence into the FastA file format.

Specified by:
translateTo in class DataFormat
Parameters:
result - the destination for the translated sequence
seq - the sequence to translate
Throws:
java.io.IOException

translateFrom

public void translateFrom(Dataset datamodel,
                          java.io.BufferedReader data)
                   throws java.io.IOException
Translates data in the FastA file format to sequence objects

Specified by:
translateFrom in class DataFormat
Parameters:
datamodel - the location to store the translated sequences
data - the buffered reader to parse
Throws:
java.io.IOException - any exeptions that occur while reading the stream are passed

accept

public boolean accept(java.io.File file)
Determines whether a specified file is of type GenBank file (based on extension). Currently the only extensions supported are ".wrp", ".fasta", and ".fsa".

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - the file to test
Returns:
true if the file is of type FastA file (otherwise false)
See Also:
FileFilter.accept(java.io.File)

getDescription

public java.lang.String getDescription()
Returns a description of the file format that can be displayed to the user.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
the string description of the file format
See Also:
FileFilter.getDescription()

isFormat

public boolean isFormat(java.io.Reader test)
Used to auto-detect Bio Legato formats

Specified by:
isFormat in class DataFormat
Parameters:
test - the reader to parse data from
Returns:
whether the format is correct

BioLegato 0.7.5 GDE plugin

Copyright © 2008-2011 University of Manitoba.