Constructor and Description |
---|
FastaReader(File file,
SequenceHeaderParserInterface<S,C> headerParser,
SequenceCreatorInterface<C> sequenceCreator)
If you are going to use the FileProxyProteinSequenceCreator then you
need to use this constructor because we need details about
the location of the file.
|
FastaReader(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.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static void |
main(String[] args) |
LinkedHashMap<String,S> |
process()
The parsing is done in this method.
This method tries to process all the available fasta 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. |
LinkedHashMap<String,S> |
process(int max)
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. |
public FastaReader(InputStream is, SequenceHeaderParserInterface<S,C> headerParser, SequenceCreatorInterface<C> sequenceCreator)
is
- inputStreamheaderParser
- sequenceCreator
- public FastaReader(File file, SequenceHeaderParserInterface<S,C> headerParser, SequenceCreatorInterface<C> sequenceCreator) throws FileNotFoundException
file
- headerParser
- sequenceCreator
- FileNotFoundException
- if the file does not exist, is a directory
rather than a regular file, or for some other reason cannot be opened
for reading.SecurityException
- if a security manager exists and its checkRead
method denies read access to the file.public LinkedHashMap<String,S> process() throws IOException
LinkedHashMap
.close()
after calling this method.HashMap
containing all the parsed fasta records
present, starting current fileIndex onwards.IOException
- if an error occurs reading the input fileprocess(int)
public LinkedHashMap<String,S> process(int max) throws IOException
max
records from
the open File or InputStream, and leaves the underlying resource open.max
- maximum number of records to return, -1
for infinity.HashMap
containing maximum max
parsed fasta records
present, starting current fileIndex onwards.IOException
- if an error occurs reading the input fileprocess()
public void close() throws IOException
IOException
public static void main(String[] args)
Copyright © 2000–2016 BioJava. All rights reserved.