/usr/include/libmeryl.H is in libmeryl-dev 0~20150903+r2013-3.
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | #ifndef LIBMERYL_H
#define LIBMERYL_H
#include "bio++.H"
// A merStream reader/writer for meryl mercount data.
//
// merSize is used to check that the meryl file is the correct size.
// If it isn't the code fails.
//
// The reader returns mers in lexicographic order. No random access.
// The writer assumes that mers come in sorted increasingly.
//
// numUnique the total number of mers with count of one
// numDistinct the total number of distinct mers in this file
// numTotal the total number of mers in this file
class merylStreamReader {
public:
merylStreamReader(const char *fn, uint32 ms=0);
~merylStreamReader();
kMer &theFMer(void) { return(_thisMer); };
uint64 theCount(void) { return(_thisMerCount); };
bool hasPositions(void) { return(_POS != 0L); };
uint32 *thePositions(void) { return(_thisMerPositions); };
uint32 getPosition(uint32 i) { return(((_POS) && (i < _thisMerCount)) ? _thisMerPositions[i] : ~uint32ZERO); };
uint32 merSize(void) { return(_merSizeInBits >> 1); };
uint32 merCompression(void) { return(_merCompression); };
uint32 prefixSize(void) { return(_prefixSize); };
uint64 numberOfUniqueMers(void) { return(_numUnique); };
uint64 numberOfDistinctMers(void) { return(_numDistinct); };
uint64 numberOfTotalMers(void) { return(_numTotal); };
uint64 histogram(uint32 i) { return((i < _histogramLen) ? _histogram[i] : ~uint64ZERO); };
uint64 histogramLength(void) { return(_histogramLen); };
uint64 histogramHuge(void) { return(_histogramHuge); };
uint64 histogramMaximumCount(void) { return(_histogramMaxValue); };
bool nextMer(void);
bool validMer(void) { return(_validMer); };
private:
bitPackedFile *_IDX;
bitPackedFile *_DAT;
bitPackedFile *_POS;
uint64 getIDXnumber(void) {
uint64 n = 1;
if (_idxIsPacked)
n = _IDX->getNumber();
else
n = _IDX->getBits(32);
return(n);
};
uint64 getDATnumber(void) {
uint64 n = 1;
if (_datIsPacked) {
if (_DAT->getBits(1))
n = _DAT->getNumber() + 2;
} else {
n = _DAT->getBits(32);
}
return(n);
};
// Why not bool? Seems like the bitPackedFile is incompatible
// with bools.
uint32 _idxIsPacked;
uint32 _datIsPacked;
uint32 _posIsPacked;
uint32 _merSizeInBits;
uint32 _merCompression;
uint32 _prefixSize;
uint32 _merDataSize;
uint64 _thisBucket;
uint64 _thisBucketSize;
uint64 _numBuckets;
kMer _thisMer;
uint64 _thisMerCount;
uint32 _thisMerPositionsMax;
uint32 *_thisMerPositions;
uint64 _numUnique;
uint64 _numDistinct;
uint64 _numTotal;
uint64 _histogramHuge; // number that are bigger than Len
uint64 _histogramLen; // number of entries in the histo
uint64 _histogramMaxValue; // highest count ever seen
uint64 *_histogram;
bool _validMer;
};
class merylStreamWriter {
public:
merylStreamWriter(const char *filePrefix,
uint32 merSize, // In bases
uint32 merComp, // A length, bases
uint32 prefixSize, // In bits
bool positionsEnabled);
~merylStreamWriter();
void addMer(kMer &mer, uint32 count=1, uint32 *positions=0L);
void addMer(uint64 prefix, uint32 prefixBits,
uint64 mer, uint32 merBits,
uint32 count=1,
uint32 *positions=0L);
private:
void writeMer(void);
void setIDXnumber(uint64 n) {
if (_idxIsPacked)
_IDX->putNumber(n);
else
_IDX->putBits(n, 32);
};
void setDATnumber(uint64 n) {
if (_datIsPacked) {
if (n == 1) {
_DAT->putBits(uint64ZERO, 1);
} else {
_DAT->putBits(uint64ONE, 1);
_DAT->putNumber(n-2);
}
} else {
_DAT->putBits(n, 32);
}
};
bitPackedFile *_IDX;
bitPackedFile *_DAT;
bitPackedFile *_POS;
uint32 _idxIsPacked;
uint32 _datIsPacked;
uint32 _posIsPacked;
uint32 _merSizeInBits;
uint32 _merCompression;
uint32 _prefixSize;
uint32 _merDataSize;
uint64 _thisBucket;
uint64 _thisBucketSize;
uint64 _numBuckets;
uint64 _numUnique;
uint64 _numDistinct;
uint64 _numTotal;
uint64 _histogramHuge; // number that are bigger than Len
uint64 _histogramLen; // number of entries in the histo
uint64 _histogramMaxValue; // highest count ever seen
uint64 *_histogram;
bool _thisMerIsBits;
bool _thisMerIskMer;
kMer _thisMer;
uint64 _thisMerPre;
uint64 _thisMerMer;
uint32 _thisMerPreSize;
uint32 _thisMerMerSize;
uint64 _thisMerCount;
};
#endif // LIBMERYL_H
|