Loading...
Searching...
No Matches
PileupElement Class Reference

This is a base class pileup component, representing the information for one reference position. More...

`#include <PileupElement.h>`

Inheritance diagram for PileupElement:
[legend]

## Public Member Functions

| PileupElement ()
| Pileup element constructor.
| PileupElement (const PileupElement &q)
| Constructor that resets the pileup element, does not copy, just resets.
virtual | ~PileupElement ()
| Pileup element destructor.
virtual void | addEntry (SamRecord &record)
| Add an entry to this pileup element.
virtual void | analyze ()
| Perform the analysis associated with this class.
virtual void | reset (int32_t refPosition)
| Resets the entry, setting the new position associated with this element.
const char * | getChromosome () const
| Get the chromosome name stored in this element.
int32_t | getRefPosition () const
| Get the reference position stored in this element.
char | getRefBase ()
| Returns the reference base for this pileup element.

## Static Public Member Functions

static void | setReference (GenomeSequence *reference)
| Set the reference to use for all pilepElements.

## Static Public Attributes

static const int32_t | UNSET_POSITION = -1

## Static Protected Member Functions

static GenomeSequence * | getReference ()
| Get a pointer to the reference.

## Detailed Description

This is a base class pileup component, representing the information for one reference position.

Child classes will be defined to detail more information that needs to be saved and how it should be analyzed.

Definition at line 26 of file PileupElement.h.

## Constructor & Destructor Documentation

## PileupElement() [1/2]

PileupElement::PileupElement | ( |  | ) |

Pileup element constructor.

Definition at line 24 of file PileupElement.cpp.

: myRefPosition(UNSET_POSITION),
myChromosome("")
{
}

Referenced by PileupElement().

## PileupElement() [2/2]

PileupElement::PileupElement | ( | const PileupElement & | q | ) |

Constructor that resets the pileup element, does not copy, just resets.

Definition at line 32 of file PileupElement.cpp.

: myRefPosition(UNSET_POSITION),
myChromosome("")
{
}

References PileupElement().

## ~PileupElement()

PileupElement::~PileupElement | ( |  | ) |

virtual

Pileup element destructor.

Definition at line 38 of file PileupElement.cpp.

{
}

## Member Function Documentation

## addEntry()

void PileupElement::addEntry | ( | SamRecord & | record | ) |

virtual

Add an entry to this pileup element.

Reimplemented in PileupElementBaseQual.

Definition at line 44 of file PileupElement.cpp.

{
if(myChromosome.empty())
{
// First entry, save chromosme name.
myChromosome = record.getReferenceName();
}
}
SamRecord::getReferenceName
const char * getReferenceName()
Get the reference sequence name (RNAME) of the record.
Definition SamRecord.cpp:1298

References SamRecord::getReferenceName().

Referenced by PileupElementBaseQual::addEntry().

## analyze()

void PileupElement::analyze | ( |  | ) |

virtual

Perform the analysis associated with this class.

Reimplemented in PileupElementBaseQual, and TestPileupElement.

Definition at line 57 of file PileupElement.cpp.

{
if(myRefPosition != UNSET_POSITION)
{
std::cout << myChromosome << "\t" << myRefPosition << "\n";
}
}

## getChromosome()

const char * PileupElement::getChromosome | ( |  | ) | const

inline

Get the chromosome name stored in this element.

Definition at line 51 of file PileupElement.h.

{ return(myChromosome.c_str()); }

Referenced by PileupElementBaseQual::analyze(), and TestPileupElement::analyze().

## getRefBase()

char PileupElement::getRefBase | ( |  | ) |

Returns the reference base for this pileup element.

Only works if a reference has been set, otherwise, 'N' is returned.

Definition at line 74 of file PileupElement.cpp.

{
if(myRefPtr != NULL)
{
// Add 1 to pos because getBase expects 1-based index.
return(myRefPtr->getBase(myChromosome.c_str(), myRefPosition+1));
}
return('N');
}

## getReference()

GenomeSequence * PileupElement::getReference | ( |  | ) |

inline static protected

Get a pointer to the reference.

Definition at line 65 of file PileupElement.h.

{ return(myRefPtr); }

## getRefPosition()

int32_t PileupElement::getRefPosition | ( |  | ) | const

inline

Get the reference position stored in this element.

Definition at line 54 of file PileupElement.h.

{ return(myRefPosition); }

Referenced by PileupElementBaseQual::addEntry(), PileupElementBaseQual::analyze(), and TestPileupElement::analyze().

## reset()

void PileupElement::reset | ( | int32_t | refPosition | ) |

virtual

Resets the entry, setting the new position associated with this element.

Reimplemented in PileupElementBaseQual.

Definition at line 67 of file PileupElement.cpp.

{
myChromosome.clear();
myRefPosition = refPosition;
}

Referenced by PileupElementBaseQual::reset().

## setReference()

void PileupElement::setReference | ( | GenomeSequence * | reference | ) |

static

Set the reference to use for all pilepElements.

Definition at line 86 of file PileupElement.cpp.

{
myRefPtr = reference;
}

## Member Data Documentation

## UNSET_POSITION

const int32_t PileupElement::UNSET_POSITION = -1

static

Definition at line 29 of file PileupElement.h.

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

- bam/PileupElement.h
- bam/PileupElement.cpp