#include <genesis/population/format/genome_region_reader.hpp>
Generic reader for inputs that contain a genomic region or locus per line, in different formats.
The reader expects an input source, and tries to interpret each line as a position or region in a chromosome, offering a variety of formats:
This allows for maximum flexibility when reading in such inputs. Note that this is more flexible than parse_genome_region(), which does not support the tab- and space-delimiation - when parsing an individual string such as coming from a command line argument, we do not want to allow tabs or spaces, as this can get messy, hence we only offer this delimitation for files as of now.
Definition at line 69 of file genome_region_reader.hpp.
|
default |
|
default |
|
default |
|
default |
|
inline |
Definition at line 141 of file genome_region_reader.hpp.
|
inline |
Definition at line 146 of file genome_region_reader.hpp.
|
default |
|
default |
GenomeLocusSet read_as_genome_locus_set | ( | std::shared_ptr< utils::BaseInputSource > | source | ) | const |
Read an input source, and return its content as a GenomeLocusSet.
This is the recommended way to read an input for testing whether genome coordinates are covered (filtered / to be considered) for downstream analyses.
Definition at line 50 of file genome_region_reader.cpp.
GenomeRegionList read_as_genome_region_list | ( | std::shared_ptr< utils::BaseInputSource > | source, |
bool | merge = false |
||
) | const |
Read an input source, and return its content as a GenomeRegionList.
If merge
is set, adjacent coordinates or overlapping regions of the input are merged into contiguous intervals. This is useful of the region list is used to determine coverage, although for that use case, it is recommended to use read_as_genome_locus_set() instead, as this is faster for testing coverage of genomic coordinates. Also, see the overlap
flag of GenomeRegionList::add( GenomeLocus const&, bool ) for details on the flag.
Definition at line 60 of file genome_region_reader.cpp.
void read_as_genome_region_list | ( | std::shared_ptr< utils::BaseInputSource > | source, |
GenomeRegionList & | target, | ||
bool | merge = false |
||
) | const |
Read a map
/bim
input source, and add its content to an existing GenomeRegionList.
If merge
is set, adjacent coordinates or overlapping regions of the input are merged into contiguous intervals. This is useful of the region list is used to determine coverage, although for that use case, it is recommended to use read_as_genome_locus_set() instead, as this is faster for testing coverage of genomic coordinates. Also, see the overlap
flag of GenomeRegionList::add( GenomeLocus const&, bool ) for details on the flag.
Definition at line 69 of file genome_region_reader.cpp.
|
inline |
Definition at line 130 of file genome_region_reader.hpp.
|
inline |
Definition at line 135 of file genome_region_reader.hpp.