btllib
 All Classes Namespaces Functions Variables
Classes | Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
btllib::SeqReader Class Reference

#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
 
SeqReaderoperator= (const SeqReader &)=delete
 
SeqReaderoperator= (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
 

Static Public Attributes

static const size_t MAX_SIMULTANEOUS_SEQREADERS = 256
 
static const size_t SHORT_MODE_BUFFER_SIZE = 32
 
static const size_t SHORT_MODE_BLOCK_SIZE = 32
 
static const size_t LONG_MODE_BUFFER_SIZE = 4
 
static const size_t LONG_MODE_BLOCK_SIZE = 1
 
static const size_t FORMAT_BUFFER_SIZE = 16384
 

Friends

class SeqReaderFastaModule
 
class SeqReaderMultilineFastaModule
 
class SeqReaderFastqModule
 
class SeqReaderMultilineFastqModule
 
class SeqReaderSamModule
 
std::ostream & operator<< (std::ostream &os, const Format f)
 

Detailed Description

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.

Examples:
seq_reader.cpp.

Constructor & Destructor Documentation

btllib::SeqReader::SeqReader ( const std::string &  source_path,
unsigned  flags,
unsigned  threads = 3 
)

Construct a SeqReader to read sequences from a given path.

Parameters
source_pathFilepath to read from. Pass "-" to read from stdin.
flagsModifier flags. Specifiying either short or long mode flag is mandatory; other flags are optional.
threadsMaximum number of helper threads to use. Must be at least 1.

Member Function Documentation

RecordIterator btllib::SeqReader::begin ( )
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.


The documentation for this class was generated from the following file: