#include <seq_reader.hpp>
Classes | |
struct | Flag |
struct | Record |
Public Types | |
enum | Format { UNDETERMINED, FASTA, FASTQ, SAM, INVALID } |
Public Member Functions | |
SeqReader (const std::string &source_path, unsigned flags, unsigned threads=3) | |
SeqReader (const SeqReader &)=delete | |
SeqReader (SeqReader &&)=delete | |
SeqReader & | operator= (const SeqReader &)=delete |
SeqReader & | operator= (SeqReader &&)=delete |
void | close () noexcept |
bool | fold_case () const |
bool | trim_masked () const |
bool | short_mode () const |
bool | long_mode () const |
Format | get_format () const |
Record | read () |
OrderQueueMPMC< Record >::Block | read_block () |
RecordIterator | begin () |
RecordIterator | end () |
size_t | get_buffer_size () const |
size_t | get_block_size () const |
Read a FASTA, FASTQ or SAM file. When reading SAM files, samtools fastq
is used to convert from the SAM format to the FASTQ format. Capable of reading gzip (.gz), bzip2 (.bz2), xz (.xz), zip (.zip), 7zip (.7z), lrzip (.lrz), BAM (.bam) and CRAM (.cram), and URL (http://, https://, ftp://) files. Threadsafe.
btllib::SeqReader::SeqReader | ( | const std::string & | source_path, |
unsigned | flags, | ||
unsigned | threads = 3 |
||
) |
Construct a SeqReader to read sequences from a given path.
source_path | Filepath to read from. Pass "-" to read from stdin. |
flags | Modifier flags. Specifiying either short or long mode flag is mandatory; other flags are optional. |
threads | Maximum number of helper threads to use. Must be at least 1. |
|
inline |
For range-based for loop only.
Record btllib::SeqReader::read | ( | ) |
Obtain next record.
OrderQueueMPMC<Record>::Block btllib::SeqReader::read_block | ( | ) |
Obtain a whole block of records.