BaseComposition Class Reference

Class that tracks the composition of base by read location. More...

`#include <BaseComposition.h>`

## Public Member Functions

| BaseComposition ()
| Constructor.
bool | updateComposition (unsigned int rawSequenceCharIndex, char baseChar)
| Update the composition for the specified index with the specified character. More...
BaseAsciiMap::SPACE_TYPE | getSpaceType ()
| Get the space type for this composition.
void | resetBaseMapType ()
| Reset the base map type for this composition.
void | setBaseMapType (BaseAsciiMap::SPACE_TYPE spaceType)
| Set the base map type for this composition.
void | print ()
| Print the composition.
void | clear ()
| Clear the composition stored in the base count vector.

## Detailed Description

Class that tracks the composition of base by read location.

Definition at line 27 of file BaseComposition.h.

## Member Function Documentation

## updateComposition()

bool BaseComposition::updateComposition | ( | unsigned int | rawSequenceCharIndex,
|  | char | baseChar
| ) |  |

Update the composition for the specified index with the specified character.

Returns
  false if the character is not a valid raw sequence character, true if it is valid.

Definition at line 32 of file BaseComposition.cpp.

{
bool validIndex = true;
// Each time we return to index 0, reset the primer count in the base/ascii
// map.
if(rawSequenceCharIndex == 0)
{
myBaseAsciiMap.resetPrimerCount();
}
// Check to see if the vector size is already sized to include this
// index. If it is not sized appropriately, add entries until it contains
// the rawSequenceCharIndex.
while(rawSequenceCharIndex >= myBaseCountVector.size())
{
// Add an entry of the base count array object to the vector.
BaseCount baseCountEntry;
myBaseCountVector.push_back(baseCountEntry);
}
// Get the base info for the specified character.
int baseIndex = myBaseAsciiMap.getBaseIndex(baseChar);
// Increment the count for the given character. This method returns false
// if the character's index falls outside the range of the base array.
// This relies on the myBaseAsciiMap indexes and the BaseCOunt object array
// to use the same indexing values for valid bases.
validIndex =
myBaseCountVector[rawSequenceCharIndex].incrementCount(baseIndex);
// Return whether or not the specified character was valid.
return(validIndex);
}
BaseAsciiMap::resetPrimerCount
void resetPrimerCount()
Reset the number of primers to 0.
Definition: BaseAsciiMap.h:158
BaseAsciiMap::getBaseIndex
int getBaseIndex(const char &letter)
Returns the baseIndex value for the character passed in.
Definition: BaseAsciiMap.h:94
BaseCount
This class is a wrapper around an array that has one index per base and an extra index for a total co...
Definition: BaseCount.h:28

References BaseAsciiMap::getBaseIndex(), and BaseAsciiMap::resetPrimerCount().

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

- fastq/BaseComposition.h
- fastq/BaseComposition.cpp