BioLegato 0.7.5 GDE plugin

org.biolegato.gdesupport.files
Class GenBankFile2008

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

public class GenBankFile2008
extends DataFormat

This class acts as a parser/translator for GenBank files (using the file specification current to 2008).

Author:
Graham Alvare, Brian Fristensky

Field Summary
static int AVG_SEQ_LENGTH
           
 
Fields inherited from class org.biolegato.gdesupport.files.DataFormat
FASTA, FORMAT_LIST, GDEFILE, GDEFLAT, GENBANK
 
Constructor Summary
GenBankFile2008()
          Creates a new instance of GenBankFile2008
 
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 GenBank file format to sequence objecte
 void translateTo(java.lang.Appendable result, Seq seq, int offset, int length)
          Translates a sequence into the GenBank 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
 

Field Detail

AVG_SEQ_LENGTH

public static final int AVG_SEQ_LENGTH
See Also:
Constant Field Values
Constructor Detail

GenBankFile2008

public GenBankFile2008()
Creates a new instance of GenBankFile2008

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 GenBank file format.

Specified by:
translateTo in class DataFormat
Parameters:
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 GenBank file format to sequence objecte

Specified by:
translateFrom in class DataFormat
Parameters:
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 ".gen", ".gp", and ".gb".

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - the file to test
Returns:
true if the file is of type GenBank 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.