Loading...
Searching...
No Matches
GlfRecord Class Reference

This class allows a user to easily get/set the fields in a GLF record. More...

`#include <GlfRecord.h>`

## Public Member Functions

| GlfRecord ()
| Constructor.
| ~GlfRecord ()
| Destructor.
void | reset ()
| Clear this record back to the default setting.
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.
void | print () const
| Print the reference section in a readable format.
Generic Accessors for Record Types 1 & 2
bool | setRtypeRef (uint8_t rtypeRef)
| Set the record type and reference base.
bool | setRecordType (uint8_t recType)
| Set the record type.
bool | setRefBaseInt (uint8_t refBase)
| Set the reference base from an integer value.
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.
bool | setMinLk (uint8_t minLk)
| Set the minimum likelihood.
bool | setReadDepth (uint32_t readDepth)
| Set the the read depth.
bool | setRmsMapQ (uint8_t rmsMapQ)
| Set the RMS of mapping qualities of reads covering the site.
int | getRecordType () const
| Return the record type.
int | getRefBase () const
| Return the reference base as an integer.
char | getRefBaseChar () const
| Return the reference base as a character.
uint32_t | getOffset () const
| Return the offset from the precedent record.
uint32_t | getMinDepth () const
| Return the minimum likelihood and read depth.
uint8_t | getMinLk () const
| Return the minimum likelihood.
uint32_t | getReadDepth () const
| Return the read depth.
uint8_t | getRmsMapQ () const
| Return the RMS of mapping qualities of reads covering the site.
Record Type 1 Accessors
Record Type 1: Simple Likelihood Record
bool | setLk (int index, uint8_t value)
| Set the likelihood for the specified genotype.
uint8_t | getLk (int index)
| Get the likelihood for the specified genotype index.

## Record Type 2 Accessors

Record Type2: Indel Likelihood Record
bool | setLkHom1 (uint8_t lk)
| Set the likelihood of the first homozygous indel allele.
bool | setLkHom2 (uint8_t lk)
| Set the likelihood of the 2nd homozygous indel allele.
bool | setLkHet (uint8_t lk)
| Set the likelihood of a heterozygote.
bool | setInsertionIndel1 (const std::string &indelSeq)
| Set the sequence of the first indel allele if the first indel is an insertion.
bool | setDeletionIndel1 (const std::string &indelSeq)
| Set the sequence of the first indel allele if the first indel is an deletion.
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 | getLkHom1 ()
| Return the likelihood of the 1st homozygous indel allele.
uint8_t | getLkHom2 ()
| Return the likelihood of the 2nd homozygous indel allele.
uint8_t | getLkHet ()
| Return the likelihood of a heterozygote.
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.

## Detailed Description

This class allows a user to easily get/set the fields in a GLF record.

Definition at line 28 of file GlfRecord.h.

## Constructor & Destructor Documentation

## GlfRecord()

GlfRecord::GlfRecord | ( |  | ) |

Constructor.

Definition at line 25 of file GlfRecord.cpp.

{
reset();
}
GlfRecord::reset
void reset()
Clear this record back to the default setting.
Definition GlfRecord.cpp:38

References reset().

## ~GlfRecord()

GlfRecord::~GlfRecord | ( |  | ) |

Destructor.

Definition at line 31 of file GlfRecord.cpp.

{
reset();
}

References reset().

## Member Function Documentation

## getIndel1()

int16_t GlfRecord::getIndel1 | ( | std::string & | indelSeq | ) |

Get the sequence and length (+:ins, -:del) of the 1st indel allele.

Parameters

  indelSeq | string to set with the sequence of the 1st indel allele

Returns
  length of the 1st indel allele (positive=insertion; negative=deletion; 0=no-indel)

Definition at line 453 of file GlfRecord.cpp.

{
if(getRecordType() != 2)
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getIndel1 for Record not of type 2."));
return(0);
}
indelSeq = myIndelSeq1.c_str();
return(myRec2Base.indelLen1);
}
GlfRecord::getRecordType
int getRecordType() const
Return the record type.
Definition GlfRecord.h:126
GlfStatus::UNKNOWN
@ UNKNOWN
unknown result (default value should never be used)
Definition GlfStatus.h:33

References getRecordType(), and GlfStatus::UNKNOWN.

## getIndel2()

int16_t GlfRecord::getIndel2 | ( | std::string & | indelSeq | ) |

Get the sequence and length (+:ins, -:del) of the 2nd indel allele.

Parameters

  indelSeq | string to set with the sequence of the 2nd indel allele

Returns
  length of the 2nd indel allele (positive=insertion; negative=deletion; 0=no-indel)

Definition at line 465 of file GlfRecord.cpp.

{
if(getRecordType() != 2)
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getIndel2 for Record not of type 2."));
return(0);
}
indelSeq = myIndelSeq2.c_str();
return(myRec2Base.indelLen2);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getLk()

uint8_t GlfRecord::getLk | ( | int | index | ) |

Get the likelihood for the specified genotype index.

Throws an exception if index is out of range.

Parameters

  index | index of the genotype for which the likelihood should be returned. See: GenotypeIndexTable

Returns
  likelihood of the specified index.

Definition at line 355 of file GlfRecord.cpp.

{
if(getRecordType() != 1)
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getLk for Record not of type 1."));
return(0);
}
if((index < 0) || (index >= NUM_REC1_LIKELIHOOD))
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getLk for index < 0 or >= 10."));
return(0);
}
return(myRec1Base.lk[index]);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getLkHet()

uint8_t GlfRecord::getLkHet | ( |  | ) |

Return the likelihood of a heterozygote.

Returns
  likelihood of a hetereozygote.

Definition at line 442 of file GlfRecord.cpp.

{
if(getRecordType() != 2)
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getLkHet for Record not of type 2."));
return(0);
}
return(myRec2Base.lkHet);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getLkHom1()

uint8_t GlfRecord::getLkHom1 | ( |  | ) |

Return the likelihood of the 1st homozygous indel allele.

Returns
  likelihood of the 1st homozygous indel allele.

Definition at line 420 of file GlfRecord.cpp.

{
if(getRecordType() != 2)
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getLkHom1 for Record not of type 2."));
return(0);
}
return(myRec2Base.lkHom1);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getLkHom2()

uint8_t GlfRecord::getLkHom2 | ( |  | ) |

Return the likelihood of the 2nd homozygous indel allele.

Returns
  likelihood of the 2nd homozygous indel allele.

Definition at line 431 of file GlfRecord.cpp.

{
if(getRecordType() != 2)
{
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getLkHom2 for Record not of type 2."));
return(0);
}
return(myRec2Base.lkHom2);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getMinDepth()

uint32_t GlfRecord::getMinDepth | ( |  | ) | const

Return the minimum likelihood and read depth.

Formatted as: min_lk<<24|read_dpeth. (min_lk capped at 255)

Returns
  minimum likelihood and read depth

Definition at line 278 of file GlfRecord.cpp.

{
if(getRecordType() == 1)
{
return(myRec1Base.min_depth);
}
else if(getRecordType() == 2)
{
return(myRec2Base.min_depth);
}
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getMinDepth for Record not of type 1 or 2."));
return(0);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getMinLk()

uint8_t GlfRecord::getMinLk | ( |  | ) | const

Return the minimum likelihood.

Returns
  minimum likelihood

Definition at line 293 of file GlfRecord.cpp.

{
if(getRecordType() == 1)
{
return(myRec1Base.min_depth >> MIN_LK_SHIFT);
}
else if(getRecordType() == 2)
{
return(myRec2Base.min_depth >> MIN_LK_SHIFT);
}
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getMinLk for Record not of type 1 or 2."));
return(0);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getOffset()

uint32_t GlfRecord::getOffset | ( |  | ) | const

Return the offset from the precedent record.

Returns
  offset from the precedent record.

Definition at line 263 of file GlfRecord.cpp.

{
if(getRecordType() == 1)
{
return(myRec1Base.offset);
}
else if(getRecordType() == 2)
{
return(myRec2Base.offset);
}
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getOffset for Record not of type 1 or 2."));
return(0);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getReadDepth()

uint32_t GlfRecord::getReadDepth | ( |  | ) | const

Return the read depth.

Returns
  read depth

Definition at line 308 of file GlfRecord.cpp.

{
if(getRecordType() == 1)
{
return(myRec1Base.min_depth & READ_DEPTH_MASK);
}
else if(getRecordType() == 2)
{
return(myRec2Base.min_depth & READ_DEPTH_MASK);
}
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getReadDepth for Record not of type 1 or 2."));
return(0);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## getRecordType()

int GlfRecord::getRecordType | ( |  | ) | const

inline

Return the record type.

Returns
  record type for this record: 0 - endMarker, 1 - simple likelihood, 2 - indel likelihood

Definition at line 126 of file GlfRecord.h.

{
return(myRecTypeRefBase >> REC_TYPE_SHIFT);
}

Referenced by getIndel1(), getIndel2(), getLk(), getLkHet(), getLkHom1(), getLkHom2(), getMinDepth(), getMinLk(), GlfFile::getNextRecord(), getOffset(), getReadDepth(), getRmsMapQ(), print(), read(), write(), and GlfFile::writeRecord().

## getRefBase()

int GlfRecord::getRefBase | ( |  | ) | const

inline

Return the reference base as an integer.

Returns
  integer representation of the reference base. See: BaseCharacterIntMap

Definition at line 134 of file GlfRecord.h.

{
return(myRecTypeRefBase & REF_BASE_MASK);
}

Referenced by print().

## getRefBaseChar()

char GlfRecord::getRefBaseChar | ( |  | ) | const

Return the reference base as a character.

Returns
  character representation of the reference base.

Definition at line 251 of file GlfRecord.cpp.

{
int index = myRecTypeRefBase & REF_BASE_MASK;
if((index > REF_BASE_MAX) || (index < 0))
{
// TODO throw exception.
return('N');
}
return(REF_BASE_CHAR[index]);
}

Referenced by print().

## getRmsMapQ()

uint8_t GlfRecord::getRmsMapQ | ( |  | ) | const

Return the RMS of mapping qualities of reads covering the site.

Returns
  RMS of maping qualities.

Definition at line 323 of file GlfRecord.cpp.

{
if(getRecordType() == 1)
{
return(myRec1Base.rmsMapQ);
}
else if(getRecordType() == 2)
{
return(myRec2Base.rmsMapQ);
}
throw(GlfException(GlfStatus::UNKNOWN,
"Tried to call getRmsMapQ for Record not of type 1 or 2."));
return(0);
}

References getRecordType(), and GlfStatus::UNKNOWN.

## print()

void GlfRecord::print | ( |  | ) | const

Print the reference section in a readable format.

Definition at line 143 of file GlfRecord.cpp.

{
std::cout << "record_type: " << getRecordType()
<< "; ref_base: " << getRefBase()
<< "; ref_base_char: " << getRefBaseChar()
<< "\n";
// TODO, split up by types of records...
switch(getRecordType())
{
case 0:
break;
case 1:
// print type 1.
std::cout << "\toffset: " << myRec1Base.offset
<< "; min_lk: " << (myRec1Base.min_depth >> 24)
<< "; read_depth: " << (myRec1Base.min_depth & 0xFFFFFF)
<< "; rmsMapQ: " << (int)myRec1Base.rmsMapQ;
for(int i = 0; i < 10; ++i)
{
std::cout << "; lk[" << i << "]: " << (int)myRec1Base.lk[i];
}
std::cout << "\n";
break;
case 2:
// print type 2.
std::cout << "\toffset: " << myRec2Base.offset
<< "; min_lk: " << (myRec2Base.min_depth >> 24)
<< "; read_depth: " << (myRec2Base.min_depth & 0xFFFFF)
<< "; rmsMapQ: " << (int)myRec2Base.rmsMapQ
<< "; lkHom1: " << (int)myRec2Base.lkHom1
<< "; lkHom2: " << (int)myRec2Base.lkHom2
<< "; lkHet: " << (int)myRec2Base.lkHet
<< "; indelLen1: " << myRec2Base.indelLen1
<< "; indelLen2: " << myRec2Base.indelLen2
<< "; myIndelSeq1: " << myIndelSeq1.c_str()
<< "; myIndelSeq2: " << myIndelSeq2.c_str()
<< "\n";
break;
default:
break;
};
}
GlfRecord::getRefBaseChar
char getRefBaseChar() const
Return the reference base as a character.
Definition GlfRecord.cpp:251
GlfRecord::getRefBase
int getRefBase() const
Return the reference base as an integer.
Definition GlfRecord.h:134

References getRecordType(), getRefBase(), and getRefBaseChar().

## read()

bool GlfRecord::read | ( | IFILE | filePtr | ) |

Read the record from the specified file (file MUST be in the correct position for reading a record).

Parameters

  filePtr | file to read from that is in the correct position.

Returns
  true if the record was successfully read from the file (even if it is an endMarker), false if it was not successfully read.

Definition at line 65 of file GlfRecord.cpp.

{
// Read the record type and reference base.
int numRead = 0;
int byteLen = sizeof(uint8_t);
numRead = ifread(filePtr, &myRecTypeRefBase, byteLen);
if(numRead != byteLen)
{
String errorMsg = "Failed to read the record type & reference base (";
errorMsg += byteLen;
errorMsg += " bytes). Only read ";
errorMsg += numRead;
errorMsg += " bytes.";
std::string errorString = errorMsg.c_str();
throw(GlfException(GlfStatus::FAIL_IO, errorString));
return(false);
}
// TODO, split up by types of records...
switch(getRecordType())
{
case 0:
// Last record.
// Nothing more to read.
break;
case 1:
// Read type 1.
readType1(filePtr);
break;
case 2:
// Read type 2.
readType2(filePtr);
break;
default:
String errorMsg = "Failed to read the record: unknown type: ";
errorMsg += getRecordType();
std::string errorString = errorMsg.c_str();
throw(GlfException(GlfStatus::INVALID, errorString));
return(false);
break;
};
// Successfully read, return success.
return(true);
}
ifread
unsigned int ifread(IFILE file, void *buffer, unsigned int size)
Read up to size bytes from the file into the buffer.
Definition InputFile.h:600
GlfStatus::INVALID
@ INVALID
invalid.
Definition GlfStatus.h:39
GlfStatus::FAIL_IO
@ FAIL_IO
method failed due to an I/O issue.
Definition GlfStatus.h:34

References GlfStatus::FAIL_IO, getRecordType(), ifread(), and GlfStatus::INVALID.

Referenced by GlfFile::getNextRecord().

## reset()

void GlfRecord::reset | ( |  | ) |

Clear this record back to the default setting.

Definition at line 38 of file GlfRecord.cpp.

{
myRecTypeRefBase = 0;
myRec1Base.offset = 0;
myRec1Base.min_depth = 0;
myRec1Base.rmsMapQ = 0;
for(int i = 0; i < 10; i++)
{
myRec1Base.lk[i] = 0;
}
myRec2Base.offset = 0;
myRec2Base.min_depth = 0;
myRec2Base.rmsMapQ = 0;
myRec2Base.lkHom1 = 0;
myRec2Base.lkHom2 = 0;
myRec2Base.lkHet = 0;
myRec2Base.indelLen1 = 0;
myRec2Base.indelLen2 = 0;
myIndelSeq1.reset();
myIndelSeq2.reset();
}

Referenced by GlfRecord(), and ~GlfRecord().

## setDeletionIndel1()

bool GlfRecord::setDeletionIndel1 | ( | const std::string & | indelSeq | ) |

Set the sequence of the first indel allele if the first indel is an deletion.

Parameters

  indelSeq | sequence of the first indel allele (deletion).

Returns
  true if successfully set, false if not.

Definition at line 399 of file GlfRecord.cpp.

{
myRec2Base.indelLen1 = 0 - (indelSeq.length());
myIndelSeq1 = indelSeq;
return(true);
}

## setDeletionIndel2()

bool GlfRecord::setDeletionIndel2 | ( | const std::string & | indelSeq | ) |

Set the sequence of the 2nd indel allele if the 2nd indel is an deletion.

Parameters

  indelSeq | sequence of the 2nd indel allele (deletion).

Returns
  true if successfully set, false if not.

Definition at line 413 of file GlfRecord.cpp.

{
myRec2Base.indelLen2 = 0 - (indelSeq.length());
myIndelSeq2 = indelSeq;
return(true);
}

## setInsertionIndel1()

bool GlfRecord::setInsertionIndel1 | ( | const std::string & | indelSeq | ) |

Set the sequence of the first indel allele if the first indel is an insertion.

Parameters

  indelSeq | sequence of the first indel allele (insertion).

Returns
  true if successfully set, false if not.

Definition at line 392 of file GlfRecord.cpp.

{
myRec2Base.indelLen1 = indelSeq.length();
myIndelSeq1 = indelSeq;
return(true);
}

## setInsertionIndel2()

bool GlfRecord::setInsertionIndel2 | ( | const std::string & | indelSeq | ) |

Set the sequence of the 2nd indel allele if the 2nd indel is an insertion.

Parameters

  indelSeq | sequence of the 2nd indel allele (insertion).

Returns
  true if successfully set, false if not.

Definition at line 406 of file GlfRecord.cpp.

{
myRec2Base.indelLen2 = indelSeq.length();
myIndelSeq2 = indelSeq;
return(true);
}

## setLk()

bool GlfRecord::setLk | ( | int | index,
|  | uint8_t | value )

Set the likelihood for the specified genotype.

Throws an exception if index is out of range.

Parameters

  index

  index for the genotype for which the likelihood is being set.

  Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
  Genotype | AA | AC | AG | AT | CC | CG | CT | GG | GT | TT

  value | likelihood for the genotype at the specified index.

Returns
  true if successfully set, false if not.

Definition at line 340 of file GlfRecord.cpp.

{
if((index < 0) || (index >= NUM_REC1_LIKELIHOOD))
{
// Out of range.
throw(GlfException(GlfStatus::UNKNOWN,
"Trying to set Record Type 1 likelihood position< 0 or >= 10."));
return(false);
}
// In range.
myRec1Base.lk[index] = value;
return(true);
}

References GlfStatus::UNKNOWN.

## setLkHet()

bool GlfRecord::setLkHet | ( | uint8_t | lk | ) |

Set the likelihood of a heterozygote.

Parameters

  lk | likelihood of a heterozygote (capped at 255)

Returns
  true if successfully set, false if not.

Definition at line 386 of file GlfRecord.cpp.

{
myRec2Base.lkHet = lk;
return(true);
}

## setLkHom1()

bool GlfRecord::setLkHom1 | ( | uint8_t | lk | ) |

Set the likelihood of the first homozygous indel allele.

Parameters

  lk | likelihood of the 1st homozygous indel allele (capped at 255)

Returns
  true if successfully set, false if not.

Definition at line 374 of file GlfRecord.cpp.

{
myRec2Base.lkHom1 = lk;
return(true);
}

## setLkHom2()

bool GlfRecord::setLkHom2 | ( | uint8_t | lk | ) |

Set the likelihood of the 2nd homozygous indel allele.

Parameters

  lk | likelihood of the 2nd homozygous indel allele (capped at 255)

Returns
  true if successfully set, false if not.

Definition at line 380 of file GlfRecord.cpp.

{
myRec2Base.lkHom2 = lk;
return(true);
}

## setMinDepth()

bool GlfRecord::setMinDepth | ( | uint32_t | minDepth | ) |

Set the minimum likelihood and the read depth.

Parameters

  minDepth | minimum likelihood and read depth. Formatted as: min_lk<<24|read_dpeth. (min_lk capped at 255)

Returns
  true if successfully set, false if not.

Definition at line 222 of file GlfRecord.cpp.

{
myRec1Base.min_depth = minDepth;
myRec2Base.min_depth = minDepth;
return(true);
}

Referenced by setMinLk(), and setReadDepth().

## setMinLk()

bool GlfRecord::setMinLk | ( | uint8_t | minLk | ) |

Set the minimum likelihood.

Parameters

  minLk | minimum likelihood (capped at 255).

Returns
  true if successfully set, false if not.

Definition at line 229 of file GlfRecord.cpp.

{
setMinDepth((myRec1Base.min_depth & READ_DEPTH_MASK) |
(minLk << MIN_LK_SHIFT));
return(true);
}
GlfRecord::setMinDepth
bool setMinDepth(uint32_t minDepth)
Set the minimum likelihood and the read depth.
Definition GlfRecord.cpp:222

References setMinDepth().

## setOffset()

bool GlfRecord::setOffset | ( | uint32_t | offset | ) |

Set the offset from the precedent record.

0-based coordinate of the record minus the coordinate of the precedent record. For the first record in a reference sequence, the previous coordinate is 0. For insertions between x & x+1, the coordinate is x. For deletions between x & y, the coordinate is x.

Parameters

  offset | offset from the precedent record.

Returns
  true if successfully set, false if not.

Definition at line 215 of file GlfRecord.cpp.

{
myRec1Base.offset = offset;
myRec2Base.offset = offset;
return(true);
}

## setReadDepth()

bool GlfRecord::setReadDepth | ( | uint32_t | readDepth | ) |

Set the the read depth.

Parameters

  readDepth | read depth.

Returns
  true if successfully set, false if not.

Definition at line 236 of file GlfRecord.cpp.

{
setMinDepth((myRec1Base.min_depth & MIN_LK_MASK) |
(readDepth & READ_DEPTH_MASK));
return(true);
}

References setMinDepth().

## setRecordType()

bool GlfRecord::setRecordType | ( | uint8_t | recType | ) |

Set the record type.

Parameters

  recType | record type: 1 - simple likelihood record, 2 - indel likelihood record, 0 - end maker

Returns
  true if the record type was successfully set, false if not.

Definition at line 194 of file GlfRecord.cpp.

{
myRecTypeRefBase =
(myRecTypeRefBase & REF_BASE_MASK) | (recType << REC_TYPE_SHIFT);
return(true);
}

## setRefBaseInt()

bool GlfRecord::setRefBaseInt | ( | uint8_t | refBase | ) |

Set the reference base from an integer value.

Parameters

  refBase

  integer representation of the reference base.

  Int Value | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15
  Character Base | X | A | C | M | G | R | S | V | T | W | Y | H | K | D | B | N

Returns
  true if the reference base was successfully set, false if not.

Definition at line 201 of file GlfRecord.cpp.

{
myRecTypeRefBase =
(myRecTypeRefBase & REC_TYPE_MASK) | (refBase & REF_BASE_MASK);
return(true);
}

## setRmsMapQ()

bool GlfRecord::setRmsMapQ | ( | uint8_t | rmsMapQ | ) |

Set the RMS of mapping qualities of reads covering the site.

Parameters

  rmsMapQ | RMS of mapping qualities

Returns
  true if successfully set, false if not.

Definition at line 243 of file GlfRecord.cpp.

{
myRec1Base.rmsMapQ = rmsMapQ;
myRec2Base.rmsMapQ = rmsMapQ;
return(true);
}

## setRtypeRef()

bool GlfRecord::setRtypeRef | ( | uint8_t | rtypeRef | ) |

Set the record type and reference base.

Parameters

  rtypeRef | record type & reference base. Formatted as: record_type<<4|numeric_ref_base.

Returns
  true if the record type and reference base were successfully set, false if not.

Definition at line 188 of file GlfRecord.cpp.

{
myRecTypeRefBase = rtypeRef;
return(true);
}

## write()

bool GlfRecord::write | ( | IFILE | filePtr | ) | const

Write the record to the specified file.

Parameters

  filePtr | file to write to that is in the correct position.

Returns
  true if the record was successfully written to the file, false if not.

Definition at line 113 of file GlfRecord.cpp.

{
// TODO, split up by types of records...
switch(getRecordType())
{
case 0:
writeRtypeRef(filePtr);
break;
case 1:
// write type 1.
writeType1(filePtr);
break;
case 2:
// write type 2.
writeType2(filePtr);
break;
default:
// unknown type, return error.
String errorMsg = "Failed to write the record: unknown type: ";
errorMsg += getRecordType();
std::string errorString = errorMsg.c_str();
throw(GlfException(GlfStatus::INVALID, errorString));
return(false);
break;
};
return(true);
}

References getRecordType(), and GlfStatus::INVALID.

Referenced by GlfFile::writeRecord().

## Member Data Documentation

## indelLen1

int16_t GlfRecord::indelLen1

Definition at line 317 of file GlfRecord.h.

## indelLen2

int16_t GlfRecord::indelLen2

Definition at line 318 of file GlfRecord.h.

## lk

uint8_t GlfRecord::lk[GlfRecord::NUM_REC1_LIKELIHOOD]

Definition at line 304 of file GlfRecord.h.

## lkHet

uint8_t GlfRecord::lkHet

Definition at line 316 of file GlfRecord.h.

## lkHom1

uint8_t GlfRecord::lkHom1

Definition at line 314 of file GlfRecord.h.

## lkHom2

uint8_t GlfRecord::lkHom2

Definition at line 315 of file GlfRecord.h.

## min_depth

uint32_t GlfRecord::min_depth

Definition at line 302 of file GlfRecord.h.

## offset

uint32_t GlfRecord::offset

Definition at line 301 of file GlfRecord.h.

## rmsMapQ

uint8_t GlfRecord::rmsMapQ

Definition at line 303 of file GlfRecord.h.

The documentation for this class was generated from the following files:

- glf/GlfRecord.h
- glf/GlfRecord.cpp