/usr/include/SeqLib/RefGenome.h is in libseqlib-dev 1.1.1+dfsg-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #ifndef SEQLIB_REF_GENOME_H
#define SEQLIB_REF_GENOME_H
#include <string>
#include <cstdlib>
#include <iostream>
#include <htslib/faidx.h>
namespace SeqLib {
/** Stores an indexed reference genome
*
* RefGenome is currently used as an interface to obtain
* sequences from the reference given an interval.
*/
class RefGenome {
public:
/** Create an empty RefGenome object */
RefGenome() { index = NULL; }
/** Destroy the malloc'ed faidx_t index inside object */
~RefGenome() { if (index) fai_destroy(index); }
/** Query a region to get the sequence
* @param chr_name name of the chr to query
* @param p1 position 1. Zero-based
* @param p2 position 2. Zero-based
*
* @exception Throws an invalid_argument if p1 > p2, p1 < 0, p2 < 0, chr not found, or seq not found
* @note This is currently NOT thread safe
*/
std::string QueryRegion(const std::string& chr_name, int32_t p1, int32_t p2) const;
/** Load an indexed reference sequence
* @param file Path to an indexed reference genome. See samtools faidx to create
* @return True if succesfully loaded
*/
bool LoadIndex(const std::string& file);
/** Check if reference has been loaded */
bool IsEmpty() const {
return (index == NULL);
}
private:
faidx_t * index;
};
}
#endif
|