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;
This class allows a user to easily get/set the fields in a GLF record.
bool setLk(int index, uint8_t value)
Set the likelihood for the specified genotype.
void print() const
Print the reference section in a readable format.
bool setDeletionIndel2(const std::string &indelSeq)
Set the sequence of the 2nd indel allele if the 2nd indel is an deletion.
int getRecordType() const
Return the record type.
uint8_t getLkHet()
Return the likelihood of a heterozygote.
bool write(IFILE filePtr) const
Write the record to the specified file.
uint8_t getLkHom1()
Return the likelihood of the 1st homozygous indel allele.
char getRefBaseChar() const
Return the reference base as a character.
bool setLkHom1(uint8_t lk)
Set the likelihood of the first homozygous indel allele.
int getRefBase() const
Return the reference base as an integer.
bool setDeletionIndel1(const std::string &indelSeq)
Set the sequence of the first indel allele if the first indel is an deletion.
bool setRmsMapQ(uint8_t rmsMapQ)
Set the RMS of mapping qualities of reads covering the site.
uint8_t getRmsMapQ() const
Return the RMS of mapping qualities of reads covering the site.
bool setInsertionIndel2(const std::string &indelSeq)
Set the sequence of the 2nd indel allele if the 2nd indel is an insertion.
uint32_t getOffset() const
Return the offset from the precedent record.
bool setRecordType(uint8_t recType)
Set the record type.
uint32_t getMinDepth() const
Return the minimum likelihood and read depth.
bool setRefBaseInt(uint8_t refBase)
Set the reference base from an integer value.
bool setReadDepth(uint32_t readDepth)
Set the the read depth.
bool setLkHet(uint8_t lk)
Set the likelihood of a heterozygote.
uint8_t getMinLk() const
Return the minimum likelihood.
bool setRtypeRef(uint8_t rtypeRef)
Set the record type and reference base.
bool setLkHom2(uint8_t lk)
Set the likelihood of the 2nd homozygous indel allele.
int16_t getIndel1(std::string &indelSeq)
Get the sequence and length (+:ins, -:del) of the 1st indel allele.
int16_t getIndel2(std::string &indelSeq)
Get the sequence and length (+:ins, -:del) of the 2nd indel allele.
bool read(IFILE filePtr)
Read the record from the specified file (file MUST be in the correct position for reading a record).
uint32_t getReadDepth() const
Return the read depth.
uint8_t getLk(int index)
Get the likelihood for the specified genotype index.
bool setMinLk(uint8_t minLk)
Set the minimum likelihood.
void reset()
Clear this record back to the default setting.
uint8_t getLkHom2()
Return the likelihood of the 2nd homozygous indel allele.
bool setOffset(uint32_t offset)
Set the offset from the precedent record.
bool setInsertionIndel1(const std::string &indelSeq)
Set the sequence of the first indel allele if the first indel is an insertion.
bool setMinDepth(uint32_t minDepth)
Set the minimum likelihood and the read depth.