Class GenbankReader<S extends AbstractSequence<C>,C extends Compound>

java.lang.Object
org.biojava.nbio.core.sequence.io.GenbankReader<S,C>
Type Parameters:
S - the sequence type
C - the compound type

public class GenbankReader<S extends AbstractSequence<C>,C extends Compound> extends Object
Use GenbankReaderHelper as an example of how to use this class where GenbankReaderHelper should be the primary class used to read Genbank files
  • Constructor Details

  • Method Details

    • isClosed

      public boolean isClosed()
    • process

      The parsing is done in this method.
      This method will return all the available Genbank records in the File or InputStream, closes the underlying resource, and return the results in LinkedHashMap.
      You don't need to call close() after calling this method.
      Returns:
      HashMap containing all the parsed Genbank records present, starting current fileIndex onwards.
      Throws:
      IOException
      CompoundNotFoundException
      OutOfMemoryError - if the input resource is larger than the allocated heap.
      See Also:
    • process

      This method tries to parse maximum max records from the open File or InputStream, and leaves the underlying resource open.
      Subsequent calls to the same method continue parsing the rest of the file.
      This is particularly useful when dealing with very big data files, (e.g. NCBI nr database), which can't fit into memory and will take long time before the first result is available.
      N.B.
      • This method can't be called after calling its NO-ARGUMENT twin.
      • remember to close the underlying resource when you are done.
      Parameters:
      max - maximum number of records to return.
      Returns:
      HashMap containing maximum max parsed Genbank records present, starting current fileIndex onwards.
      Throws:
      IOException
      CompoundNotFoundException
      Since:
      3.0.6
      See Also:
    • close

      public void close()