|
Sample SNPs
Fast ordered sampling of rows from large text or binary files. Special cases for DNA variant files (.bed, VCF, HapMap, etc).
|
Generic binary file base class. More...
#include <varfiles.hpp>
Public Member Functions | |
| 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. | |
| virtual void | open () |
| Open stream (does nothing) | |
| virtual void | close () |
| Close stream. | |
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 | |
| 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. | |
Additional Inherited Members | |
Protected Member Functions inherited from sampFiles::VarFile | |
| VarFile () | |
| Default constructor (protected) | |
Generic binary file base class.
Sets up streams for binary files. No support for header lines.
|
inline |
Constructor with file name.
Throws `‘Number of elements not divisible by the number of columns’' if the total number of elements is not divisible by the number of elements in a column.
| [in] | fileName | file name |
| [in] | nCols | number of columns, or elements in a row |
| [in] | elemSize | size of each element in bytes |