S - sequence typepublic class FastaReader<S extends Sequence<S>> extends Object implements CanReportProgress, cc.redberry.pipe.OutputPortCloseable<FastaRecord<S>>, AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
FastaReader.RawFastaRecord
Used internally
|
| Constructor and Description |
|---|
FastaReader(File file,
Alphabet<S> alphabet)
Creates FASTA reader for file
|
FastaReader(InputStream inputStream,
Alphabet<S> alphabet)
Creates reader for stream with unknown size.
|
FastaReader(InputStream inputStream,
Alphabet<S> alphabet,
long size)
Creates reader from the specified input stream.
|
FastaReader(String file,
Alphabet<S> alphabet)
Creates FASTA reader for file
|
| Modifier and Type | Method and Description |
|---|---|
cc.redberry.pipe.OutputPortCloseable<FastaReader.RawFastaRecord> |
asRawRecordsPort()
Returns output port of raw records.
|
void |
close()
Closes the reader
|
long |
getNumberOfReads()
For sequential readers returns the number of reads read till this moment, after reader is exhausted returns
total
number of reads.
|
double |
getProgress() |
boolean |
isFinished() |
FastaRecord<S> |
take()
Return next FASTA record or null if end of stream is reached.
|
FastaReader.RawFastaRecord |
takeRawRecord()
Return next raw FASTA record or null if end of stream is reached.
|
public FastaReader(InputStream inputStream, Alphabet<S> alphabet, long size)
inputStream - input streamsize - file sizepublic FastaReader(InputStream inputStream, Alphabet<S> alphabet)
inputStream - input streamalphabet - alphabetpublic FastaReader(String file, Alphabet<S> alphabet) throws FileNotFoundException
file - file namealphabet - alphabetFileNotFoundExceptionpublic FastaReader(File file, Alphabet<S> alphabet) throws FileNotFoundException
file - filealphabet - alphabetFileNotFoundExceptionpublic double getProgress()
getProgress in interface CanReportProgresspublic boolean isFinished()
isFinished in interface CanReportProgresspublic FastaRecord<S> take()
This method is thread-safe.
take in interface cc.redberry.pipe.OutputPort<FastaRecord<S extends Sequence<S>>>public FastaReader.RawFastaRecord takeRawRecord()
This method is thread-safe.
public cc.redberry.pipe.OutputPortCloseable<FastaReader.RawFastaRecord> asRawRecordsPort()
public void close()
close in interface cc.redberry.pipe.OutputPortCloseable<FastaRecord<S extends Sequence<S>>>close in interface AutoCloseablepublic long getNumberOfReads()
This method is thread-safe.
Copyright © 2018. All rights reserved.