NCBI C++ ToolKit
|
Search Toolkit Book for CSequenceIStreamFasta
Sequence stream for reading FASTA formatted files. More...
#include <algo/blast/dbindex/sequence_istream_fasta.hpp>
Public Member Functions | |
CSequenceIStreamFasta (const std::string &name, size_t pos=0) | |
Object constructor. More... | |
CSequenceIStreamFasta (CNcbiIstream &input_stream, size_t pos=0) | |
Object constructor. More... | |
virtual | ~CSequenceIStreamFasta () |
Object destructor. More... | |
virtual CRef< TSeqData > | next () |
Retrieve and return the next sequence from the sequnce stream. More... | |
virtual void | putback () |
Roll back to the start of the previous sequence. More... | |
![]() | |
virtual | ~CSequenceIStream () |
Object destructor. More... | |
Private Types | |
typedef CT_POS_TYPE | pos_type |
Alias for the standard IO stream position type. More... | |
Private Attributes | |
bool | stream_allocated_ |
Whether to deallocate the stream at destruction. More... | |
CNcbiIstream * | istream_ |
Standard IO stream for reading FASTA data. More... | |
objects::CFastaReader * | fasta_reader_ |
Object to read fasta files. More... | |
std::vector< pos_type > | seq_positions_ |
Starting positions of sequences withing the FASTA stream. More... | |
std::string | name_ |
FASTA file name, if available. More... | |
CRef< TSeqData > | cache_ |
Last read sequence. More... | |
bool | use_cache_ |
Next time read from cache. More... | |
Additional Inherited Members | |
![]() | |
typedef CSeqData | TSeqData |
Public alias for sequence info data type. More... | |
typedef TSeqData::TMask | TMask |
Public alias for type containing masking info. More... | |
typedef Uint4 | TStreamPos |
Type used to represent positions within a sequence stream. More... | |
Sequence stream for reading FASTA formatted files.
Definition at line 46 of file sequence_istream_fasta.hpp.
|
private |
Alias for the standard IO stream position type.
Definition at line 51 of file sequence_istream_fasta.hpp.
CSequenceIStreamFasta::CSequenceIStreamFasta | ( | const std::string & | name, |
size_t | pos = 0 |
||
) |
Object constructor.
Creates a FASTA sequence stream by the file name. The stream is rewound to the start of the given sequence.
name | FASTA file name |
pos | starting sequence |
Definition at line 55 of file sequence_istream_fasta.cpp.
References CFASTAREADER_FLAGS, and NCBI_THROW.
CSequenceIStreamFasta::CSequenceIStreamFasta | ( | CNcbiIstream & | input_stream, |
size_t | pos = 0 |
||
) |
Object constructor.
Creates a FASTA sequence stream from the standard IO stream. The stream is rewound to the start of the given sequence.
input_stream | C++ iostream containing the FASTA data |
pos | starting sequence |
Definition at line 74 of file sequence_istream_fasta.cpp.
References CFASTAREADER_FLAGS, fasta_reader_, istream_, and NCBI_THROW.
|
virtual |
Object destructor.
Definition at line 90 of file sequence_istream_fasta.cpp.
References istream_, and stream_allocated_.
|
virtual |
Retrieve and return the next sequence from the sequnce stream.
Implements CSequenceIStream.
Definition at line 98 of file sequence_istream_fasta.cpp.
References cache_, fasta_reader_, result, and use_cache_.
|
virtual |
Roll back to the start of the previous sequence.
Implements CSequenceIStream.
Definition at line 121 of file sequence_istream_fasta.cpp.
References use_cache_.
|
private |
Object to read fasta files.
Definition at line 56 of file sequence_istream_fasta.hpp.
Referenced by CSequenceIStreamFasta(), and next().
|
private |
Standard IO stream for reading FASTA data.
Definition at line 54 of file sequence_istream_fasta.hpp.
Referenced by CSequenceIStreamFasta(), and ~CSequenceIStreamFasta().
|
private |
FASTA file name, if available.
Definition at line 61 of file sequence_istream_fasta.hpp.
|
private |
Starting positions of sequences withing the FASTA stream.
Definition at line 59 of file sequence_istream_fasta.hpp.
|
private |
Whether to deallocate the stream at destruction.
Definition at line 53 of file sequence_istream_fasta.hpp.
Referenced by ~CSequenceIStreamFasta().
|
private |
Next time read from cache.
Definition at line 63 of file sequence_istream_fasta.hpp.