multovl
1.3
Multiple overlaps of genomic regions
|
#include "textio.hh"
Public Member Functions | |
TextReader (const std::string &infname, Fileformat::Kind format) | |
virtual std::string | read_into (std::string &chrom, Region ®) |
virtual void | add_error (const std::string &msg) |
Adds an error message to _errors, nicely decorated with linecount. | |
![]() | |
TrackReader () | |
default init | |
const Errors & | errors () const |
TextReader objects encapsulate an input stream from which they can read into a Reader object, one by one. TextReader-s are init-ed with a file name, the ctor opens the file for writing and the dtor closes it, RAII-style. Clients should instantiate a TextReader, then invoke its read_into() method, and use the resulting Region immediately for building up a MultiOverlap object.
multovl::io::TextReader::TextReader | ( | const std::string & | infname, |
Fileformat::Kind | format | ||
) |
Init a TextReader object to read from a file.
infname | the input file name. |
format | the format of the input file (must be known) |
|
virtual |
Attempts to read from the wrapped input stream into a region. Reads the stream internally line-by-line, parses each line until a valid data line is found with which /reg/ is then updated. Comment and metainfo lines are ignored.
chrom | string to store the chromosome name for /reg/ |
reg | the region this method tries to read into. |
Implements multovl::io::TrackReader.