18 #ifndef __GLF_RECORD_H__ 19 #define __GLF_RECORD_H__ 25 #include "CharBuffer.h" 128 return(myRecTypeRefBase >> REC_TYPE_SHIFT);
136 return(myRecTypeRefBase & REF_BASE_MASK);
182 bool setLk(
int index, uint8_t value);
191 uint8_t
getLk(
int index);
256 int16_t
getIndel1(std::string& indelSeq);
262 int16_t
getIndel2(std::string& indelSeq);
267 void readType1(
IFILE filePtr);
270 void readType2(
IFILE filePtr);
274 void writeRtypeRef(
IFILE filePtr)
const;
278 void writeType1(
IFILE filePtr)
const;
281 void writeType2(
IFILE filePtr)
const;
284 uint8_t myRecTypeRefBase;
286 static const uint8_t REC_TYPE_SHIFT = 4;
287 static const uint8_t REF_BASE_MASK = 0xF;
288 static const uint8_t REC_TYPE_MASK = 0xF0;
290 static const uint32_t MIN_LK_SHIFT = 24;
291 static const uint32_t READ_DEPTH_MASK = 0xFFFFFF;
292 static const uint32_t MIN_LK_MASK = 0xFF000000;
294 static const char REF_BASE_MAX = 15;
295 static std::string REF_BASE_CHAR;
297 static const int NUM_REC1_LIKELIHOOD = 10;
304 uint8_t lk[GlfRecord::NUM_REC1_LIKELIHOOD];
307 static const int REC1_BASE_SIZE = 19;
325 static const int REC2_BASE_SIZE = 16;
void print() const
Print the reference section in a readable format.
bool setDeletionIndel1(const std::string &indelSeq)
Set the sequence of the first indel allele if the first indel is an deletion.
uint32_t getReadDepth() const
Return the read depth.
char getRefBaseChar() const
Return the reference base as a character.
bool setOffset(uint32_t offset)
Set the offset from the precedent record.
bool setMinDepth(uint32_t minDepth)
Set the minimum likelihood and the read depth.
uint8_t getLkHet()
Return the likelihood of a heterozygote.
bool setRefBaseInt(uint8_t refBase)
Set the reference base from an integer value.
int16_t getIndel1(std::string &indelSeq)
Get the sequence and length (+:ins, -:del) of the 1st indel allele.
bool setRecordType(uint8_t recType)
Set the record type.
bool setLkHom2(uint8_t lk)
Set the likelihood of the 2nd homozygous indel allele.
int getRefBase() const
Return the reference base as an integer.
bool read(IFILE filePtr)
Read the record from the specified file (file MUST be in the correct position for reading a record)...
bool write(IFILE filePtr) const
Write the record to the specified file.
bool setLk(int index, uint8_t value)
Set the likelihood for the specified genotype.
uint32_t getOffset() const
Return the offset from the precedent record.
This class allows a user to easily get/set the fields in a GLF record.
uint32_t getMinDepth() const
Return the minimum likelihood and read depth.
bool setLkHom1(uint8_t lk)
Set the likelihood of the first homozygous indel allele.
bool setRtypeRef(uint8_t rtypeRef)
Set the record type and reference base.
uint8_t getLkHom2()
Return the likelihood of the 2nd homozygous indel allele.
bool setReadDepth(uint32_t readDepth)
Set the the read depth.
bool setInsertionIndel2(const std::string &indelSeq)
Set the sequence of the 2nd indel allele if the 2nd indel is an insertion.
bool setDeletionIndel2(const std::string &indelSeq)
Set the sequence of the 2nd indel allele if the 2nd indel is an deletion.
uint8_t getMinLk() const
Return the minimum likelihood.
int getRecordType() const
Return the record type.
void reset()
Clear this record back to the default setting.
bool setMinLk(uint8_t minLk)
Set the minimum likelihood.
uint8_t getLk(int index)
Get the likelihood for the specified genotype index.
uint8_t getRmsMapQ() const
Return the RMS of mapping qualities of reads covering the site.
bool setRmsMapQ(uint8_t rmsMapQ)
Set the RMS of mapping qualities of reads covering the site.
bool setLkHet(uint8_t lk)
Set the likelihood of a heterozygote.
uint8_t getLkHom1()
Return the likelihood of the 1st homozygous indel allele.
int16_t getIndel2(std::string &indelSeq)
Get the sequence and length (+:ins, -:del) of the 2nd indel allele.
bool setInsertionIndel1(const std::string &indelSeq)
Set the sequence of the first indel allele if the first indel is an insertion.