Class FastaStreamer
java.lang.Object
org.biojava.nbio.core.sequence.io.FastaStreamer
Read from a FASTA file (or gzipped FASTA file) and create a Java stream of
ProteinSequence
objects
for use in a functional programming paradigm.- Since:
- 7.1.0
- Author:
- Gary Murphy
-
Method Summary
Modifier and TypeMethodDescriptionbatchSize
(int size) protected ProteinSequence
createSequence
(ProteinSequence sequence) Create the sequence with the information from the header.each()
Enable iteration through the proteins in the file using syntax such as:static FastaStreamer
static FastaStreamer
protected int
protected Path
getPath()
stream()
Create a stream of protein sequences from the contents of the pathwithSequenceCreator
(SequenceCreatorInterface<AminoAcidCompound> sequenceCreator)
-
Method Details
-
from
-
from
-
withHeaderParser
public FastaStreamer withHeaderParser(SequenceHeaderParserInterface<ProteinSequence, AminoAcidCompound> headerParser) -
withSequenceCreator
public FastaStreamer withSequenceCreator(SequenceCreatorInterface<AminoAcidCompound> sequenceCreator) -
batchSize
-
each
Enable iteration through the proteins in the file using syntax such as:for(ProteinSequence sequence : FastaStreamer.from(path).each()) { . . . }
- Returns:
- an iterable suitable for an iteration loop
-
stream
Create a stream of protein sequences from the contents of the path- Returns:
- the stream
-
createSequence
Create the sequence with the information from the header. This implementation return the sequence as-is, but this is an opportunity for the implementer to build specific information into the user collection space of the sequence- Parameters:
sequence
- the protein sequence- Returns:
- the sequence
-
getPath
-
getBatchSize
-
getHeaderParser
-
getSequenceCreator
-