libStatGen Software  1
BaseAsciiMap Class Reference

Map between characters and the associated base type. More...

#include <BaseAsciiMap.h>

Public Types

enum  SPACE_TYPE { UNKNOWN, BASE_SPACE, COLOR_SPACE }
 The type of space (color or base) to use in the mapping. More...
 

Public Member Functions

void setBaseMapType (SPACE_TYPE spaceType)
 Set the base type based on the passed in option.
 
int getBaseIndex (const char &letter)
 Returns the baseIndex value for the character passed in.
 
SPACE_TYPE getSpaceType ()
 Return the space type that is currently set.
 
void setNumPrimerBases (int numPrimerBases)
 Set the number of primer bases expected before the actual base/color space type occurs for the rest of the entries. More...
 
void resetPrimerCount ()
 Reset the number of primers to 0.
 
void resetBaseMapType ()
 Reset the base mapping type to UNKNOWN.
 

Static Public Attributes

static const int baseNIndex = 004
 Value associated with 'N' in the ascii to base map (bad read).
 
static const int baseXIndex = 005
 Value associated with any non-base character in the ascii to base map (unknown, bad data). More...
 
static const char int2base [] = "ACGTNMXXXXXXXXXX"
 Convert from int representation to the base.
 
static const char int2colorSpace [] = "0123NXXXXXXXXXXX"
 Convert from int representation to colorspace representation.
 
static unsigned char base2complement []
 This table maps 5' base space to the 3' complement base space values, as well as 5' color space values to the corresponding 3' complement color space values. More...
 
static unsigned char baseColor2int [256+1]
 Map ASCII values to a 2 (or 3) bit encoding for the base pair value for both base and color space. More...
 
static unsigned char base2int [256+1]
 Map ASCII values to a 2 (or 3) bit encoding for the base pair value for just base space (ACTGNactgn). More...
 
static unsigned char color2int [256+1]
 Map ASCII values to a 2 (or 3) bit encoding for the base pair value for just color space (0123). More...
 

Detailed Description

Map between characters and the associated base type.

Definition at line 24 of file BaseAsciiMap.h.

Member Enumeration Documentation

◆ SPACE_TYPE

The type of space (color or base) to use in the mapping.

Enumerator
UNKNOWN 

Base decision on the first raw seq character/type has yet to be determined.

BASE_SPACE 

Bases only (A,C,G,T,N).

COLOR_SPACE 

Color space only (0,1,2,3,.).

Definition at line 44 of file BaseAsciiMap.h.

44  {
45  /// Base decision on the first raw seq character/type has yet
46  /// to be determined.
47  UNKNOWN,
48  BASE_SPACE, ///< Bases only (A,C,G,T,N).
49  COLOR_SPACE ///< Color space only (0,1,2,3,.).
50  };
Color space only (0,1,2,3,.).
Definition: BaseAsciiMap.h:49
Base decision on the first raw seq character/type has yet to be determined.
Definition: BaseAsciiMap.h:47
Bases only (A,C,G,T,N).
Definition: BaseAsciiMap.h:48

Member Function Documentation

◆ setNumPrimerBases()

void BaseAsciiMap::setNumPrimerBases ( int  numPrimerBases)
inline

Set the number of primer bases expected before the actual base/color space type occurs for the rest of the entries.

Definition at line 152 of file BaseAsciiMap.h.

153  {
154  myNumPrimerBases = numPrimerBases;
155  }

Member Data Documentation

◆ base2complement

unsigned char BaseAsciiMap::base2complement
static
Initial value:
=
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"0123NNNNNNNNNNNN"
"NTNGNNNCNNNNNNNN"
"NNNNANNNNNNNNNNN"
"NTNGNNNCNNNNNNNN"
"NNNNANNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"
"NNNNNNNNNNNNNNNN"

This table maps 5' base space to the 3' complement base space values, as well as 5' color space values to the corresponding 3' complement color space values.

In both cases, invalids are mapped to 'N', which isn't accurate for ABI SOLiD, but internally it shouldn't matter (on output it will).

Definition at line 41 of file BaseAsciiMap.h.

Referenced by BaseUtilities::getAsciiQuality(), GenomeSequence::getChromosome(), and GenomeSequence::getChromosomeSize().

◆ base2int

unsigned char BaseAsciiMap::base2int
static
Initial value:
=
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\000\005\001\005\005\005\002\005\005\005\005\005\005\004\005"
"\005\005\005\005\003\005\005\005\005\005\005\005\005\005\005\005"
"\005\000\005\001\005\005\005\002\005\005\005\005\005\005\004\005"
"\005\005\005\005\003\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"

Map ASCII values to a 2 (or 3) bit encoding for the base pair value for just base space (ACTGNactgn).

'A'/'a' -> 0; 'C'/'c' -> 1; 'G'/'g' -> 2; 'T'/'t' -> 3; 'N'/'n' -> 4; anything else -> 5.

Definition at line 61 of file BaseAsciiMap.h.

Referenced by GenomeSequence::getBase(), GenomeSequence::loadDBSNP(), GenomeSequence::open(), resetBaseMapType(), and setBaseMapType().

◆ baseColor2int

unsigned char BaseAsciiMap::baseColor2int
static
Initial value:
=
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\004\005"
"\000\001\002\003\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\000\005\001\005\005\005\002\005\005\005\005\005\005\004\005"
"\005\005\005\005\003\005\005\005\005\005\005\005\005\005\005\005"
"\005\000\005\001\005\005\005\002\005\005\005\005\005\005\004\005"
"\005\005\005\005\003\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"

Map ASCII values to a 2 (or 3) bit encoding for the base pair value for both base and color space.

'A'/'a'/'0' -> 0; 'C'/'c'/'1' -> 1; 'G'/'g'/'2' -> 2; 'T'/'t'/'3' -> 3; 'N'/'n'/'4' -> 4; anything else -> 5.

Definition at line 56 of file BaseAsciiMap.h.

◆ baseXIndex

const int BaseAsciiMap::baseXIndex = 005
static

Value associated with any non-base character in the ascii to base map (unknown, bad data).

Definition at line 31 of file BaseAsciiMap.h.

◆ color2int

unsigned char BaseAsciiMap::color2int
static
Initial value:
=
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\004\005"
"\000\001\002\003\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"
"\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005\005"

Map ASCII values to a 2 (or 3) bit encoding for the base pair value for just color space (0123).

'0' -> 0; '1' -> 1; '2' -> 2; '3' -> 3; '4' -> 4; anything else -> 5.

Definition at line 65 of file BaseAsciiMap.h.

Referenced by resetBaseMapType(), and setBaseMapType().


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