btllib
Loading...
Searching...
No Matches
btllib::SeqWriter Class Reference

#include <seq_writer.hpp>

Public Types

enum  Format { FASTA , FASTQ }
 

Public Member Functions

 SeqWriter (const std::string &sink_path, Format format=FASTA, bool append=false)
 
void close ()
 
void write (const std::string &id, const std::string &comment, const std::string &seq, const std::string &qual="")
 

Detailed Description

Write FASTA or FASTQ sequences to a file. Capable of writing gzip (.gz), bzip2 (.bz2), xz (.xz), zip (.zip), 7zip (.7z), and lrzip (.lrz) files. Add the appropriate extension to the output filename to automatically compress. Threadsafe.

Examples
seq_writer.cpp.

Constructor & Destructor Documentation

◆ SeqWriter()

btllib::SeqWriter::SeqWriter ( const std::string & sink_path,
Format format = FASTA,
bool append = false )

Construct a SeqWriter to write sequences to a given path.

Parameters
source_pathFilepath to write to. Pass "-" to write to stdout.
formatWhich format to write the output as.
appendWhether to append to the target file or write anew.

Member Function Documentation

◆ write()

void btllib::SeqWriter::write ( const std::string & id,
const std::string & comment,
const std::string & seq,
const std::string & qual = "" )

Write a sequence.

Parameters
idSequence ID or name.
commentOptional comment after the ID/name.
seqThe sequence to write.
qualOptional quality scores, mandatory if format is FASTQ.
Examples
seq_writer.cpp.

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