BioLegato 0.7.3 GDE plugin

org.biolegato.gdesupport.formats
Class FastAFile

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

public class FastAFile
extends DataFormat

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

Author:
Graham Alvare, Brian Fristensky

Constructor Summary
FastAFile()
          Creates a new instance of FastAFile
 
Method Summary
 boolean accept(java.io.File file)
          Determines whether or not 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.
 java.lang.String getName()
          Obtains the internal name of the file format (this is great for hashtables storage and searching).
 boolean isFormat(java.io.Reader test)
          Used to auto-detect Bio Legato formats
 Cell[] translateFrom(java.io.BufferedReader data)
          Translates data in the FastA file format to sequence objecte
 java.lang.String translateTo(Cell seq)
          Translates a sequence into the FastA file format.
 
Methods inherited from class org.biolegato.gdesupport.formats.DataFormat
addFormats, auto, auto, auto, getFormat, readFile, writeFile
 
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 java.lang.String translateTo(Cell seq)
Translates a sequence into the FastA file format.

Specified by:
translateTo in class DataFormat
Parameters:
seq - the sequence to translate
Returns:
the resulting string

translateFrom

public Cell[] translateFrom(java.io.BufferedReader data)
                     throws java.io.IOException
Translates data in the FastA file format to sequence objecte

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

accept

public boolean accept(java.io.File file)
Determines whether or not 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)

getName

public java.lang.String getName()
Obtains the internal name of the file format (this is great for hashtables storage and searching).

Overrides:
getName in class DataFormat
Returns:
the name of the file format

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 or not the format is correct

BioLegato 0.7.3 GDE plugin

Copyright © 2008-2010 University of Manitoba.