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

  • 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 Detail

      • GenbankReader

        public GenbankReader​(InputStream is,
                             SequenceHeaderParserInterface<S,​C> headerParser,
                             SequenceCreatorInterface<C> sequenceCreator)
        If you are going to use FileProxyProteinSequenceCreator then do not use this constructor because we need details about local file offsets for quick reads. InputStreams does not give you the name of the stream to access quickly via file seek. A seek in an inputstream is forced to read all the data so you don't gain anything.
        is -
        headerParser -
        sequenceCreator -
    • Method Detail

      • process

        public LinkedHashMap<String,​Sprocess​(int max)
                                              throws IOException,
        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.
        • This method can't be called after calling its NO-ARGUMENT twin.
        • remember to close the underlying resource when you are done.
        max - maximum number of records to return, -1 for infinity.
        HashMap containing maximum max parsed Genbank records present, starting current fileIndex onwards.
        See Also:
      • close

        public void close()