Sample SNPs
Fast ordered sampling of rows from large text or binary files. Special cases for DNA variant files (.bed, VCF, HapMap, etc).
|
BED file base class. More...
#include <varfiles.hpp>
Public Member Functions | |
BedFile () | |
Default constructor. | |
BedFile (const string &stubName) | |
File name constructor. More... | |
BedFile (const BedFile &in)=default | |
Copy constructor. | |
BedFile & | operator= (const BedFile &in)=default |
Copy assignment. | |
BedFile (BedFile &&in)=default | |
Move constructor. | |
BedFile & | operator= (BedFile &&in)=default |
Move assignment. | |
~BedFile () | |
Destructor. | |
virtual void | open () |
Open stream (does nothing) | |
void | close () |
Close stream. | |
Public Member Functions inherited from sampFiles::GbinFile | |
GbinFile () | |
Default constructor. | |
GbinFile (const string &fileName, const size_t &nCols, const size_t &elemSize) | |
Constructor with file name. More... | |
GbinFile (const GbinFile &in)=default | |
Copy constructor. | |
GbinFile & | operator= (const GbinFile &in)=default |
Copy assignment. | |
GbinFile (GbinFile &&in)=default | |
Move constructor. | |
GbinFile & | operator= (GbinFile &&in)=default |
Move assignment. | |
~GbinFile () | |
Destructor. | |
Public Member Functions inherited from sampFiles::VarFile | |
VarFile (const VarFile &in)=default | |
Copy constructor. | |
VarFile & | operator= (const VarFile &in)=default |
Copy assignment. | |
VarFile (VarFile &&in)=default | |
Move constructor. | |
VarFile & | operator= (VarFile &&in)=default |
Move assignment. | |
~VarFile () | |
Destructor. | |
Protected Attributes | |
fstream | _famFile |
Corresponding .fam file stream. | |
fstream | _bimFile |
Corresponding .bim file stream. | |
string | _fileStub |
File name stub (minus the extension) | |
Protected Attributes inherited from sampFiles::GbinFile | |
string | _fileName |
File name. | |
size_t | _nCols |
Number of elements in a row. | |
size_t | _elemSize |
Size of each element in bytes. | |
Protected Attributes inherited from sampFiles::VarFile | |
fstream | _varFile |
Variant file stream. | |
Static Protected Attributes | |
static const vector< char > | _masks = {static_cast<char>(0x03), static_cast<char>(0x0C), static_cast<char>(0x30), static_cast<char>(0xC0)} |
Genotype bit masks. More... | |
static const unordered_map< char, string > | _tests |
Genotype bit tests. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from sampFiles::VarFile | |
VarFile () | |
Default constructor (protected) | |
BED file base class.
Sets up streams for the auxiliary files.
BedFile::BedFile | ( | const string & | stubName | ) |
File name constructor.
[in] | stubName | file name minus the extension |
|
staticprotected |
Genotype bit masks.
Used to isolate each of the four genotypes (moving from the last bit pair) from the .bed two-bit genotype coding.
|
staticprotected |
Genotype bit tests.
Used to test each of the four genotypes (moving from the last bit pair) from the .bed two-bit genotype coding for the possible states.