Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

Genotype Class Reference

Genotype is a data type derived from Data. More...

#include <Genotype.h>

Inheritance diagram for Genotype:

Data List of all members.

Public Types

enum  { SNP_A_ORDINAL = 1, SNP_C_ORDINAL = 2, SNP_G_ORDINAL = 3, SNP_T_ORDINAL = 4 }

Public Member Functions

 Genotype ()
 Genotype (const char *g)
 Genotype (const std::string &g)
 Genotype (const int allele1, const int allele2)
bool isMissing (void) const
void setMissing (void)
void set (const char *genotype)
void set (const std::string &genotype)
const std::string get (void) const
void set (const int allele1, const int allele2)
void setAllele1 (const int allele1)
void setAllele2 (const int allele2)
void setAllele1 (const char *allele1)
void setAllele2 (const char *allele2)
void setAllele1 (const std::string &allele1)
void setAllele2 (const std::string &allele2)
const Number getAllele1 (void) const
const Number getAllele2 (void) const
Genotypeoperator+= (const int allele)
Genotypeoperator-= (const int allele)
Genotypeoperator+= (const Number &allele)
Genotypeoperator-= (const Number &allele)
bool operator< (const Data &b) const
bool operator== (const Data &b) const
const DATATYPE getDataType (void) const
virtual Genotypeclone () const

Static Public Member Functions

static void addGenotypeMissingValue (std::string &value)
static bool isMissingValue (std::string value)
static bool isA (const std::string &s)
 Determines whether a string is a valid Genotype string.

Private Member Functions

void _orderAlleles (void)
void _setNormalizedStringRepresentation (void)
const char * _itoa (unsigned int i) const
const char * _snpOrdinalToCString (unsigned int allele)
const char * _setAllele (const char *input, unsigned &value, bool &snp)

Private Attributes

bool _isMissing
bool _isSNP
std::string _genotype
unsigned int _allele1
unsigned int _allele2

Static Private Attributes

static std::set< std::string > _genotypeMissingValue
static const char _normalDelimiter = '/'
static const char _alternateDelimiter = '|'

Detailed Description

Genotype is a data type derived from Data.

Genotype deals with both microsatellite marker alleles and SNP alleles.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
SNP_A_ORDINAL 
SNP_C_ORDINAL 
SNP_G_ORDINAL 
SNP_T_ORDINAL 


Constructor & Destructor Documentation

Genotype::Genotype  )  [inline]
 

Genotype::Genotype const char *  g  )  [inline]
 

Genotype::Genotype const std::string &  g  )  [inline]
 

Genotype::Genotype const int  allele1,
const int  allele2
[inline]
 


Member Function Documentation

const char * Genotype::_itoa unsigned int  i  )  const [private]
 

void Genotype::_orderAlleles void   )  [private]
 

_orderAlleles(): The normal convention is to have the lesser allele shown first:

const char * Genotype::_setAllele const char *  s,
unsigned &  value,
bool &  snp
[private]
 

_setAllele(): set an allele from a char* input

void Genotype::_setNormalizedStringRepresentation void   )  [private]
 

_setNormalizedStringRepresentation(): Convert genotype to the normalized form d{1,}/d{1,} or [ACGT]/[ACGT]

const char * Genotype::_snpOrdinalToCString unsigned int  allele  )  [private]
 

_snpOrdinalToCString(): Convert unsigned int to a SNP ordinal.

static void Genotype::addGenotypeMissingValue std::string &  value  )  [inline, static]
 

Genotype * Genotype::clone  )  const [virtual]
 

Implements Data.

const std::string Genotype::get void   )  const [virtual]
 

Implements Data.

const Number Genotype::getAllele1 void   )  const [inline]
 

const Number Genotype::getAllele2 void   )  const [inline]
 

const DATATYPE Genotype::getDataType void   )  const [inline, virtual]
 

Implements Data.

bool Genotype::isA const std::string &  s  )  [static]
 

Determines whether a string is a valid Genotype string.

isA(): Determines whether a string is a valid Genotype string

bool Genotype::isMissing void   )  const [inline, virtual]
 

Implements Data.

bool Genotype::isMissingValue std::string  value  )  [static]
 

Genotype & Genotype::operator+= const Number allele  ) 
 

Genotype & Genotype::operator+= const int  allele  ) 
 

Genotype & Genotype::operator-= const Number allele  ) 
 

Genotype & Genotype::operator-= const int  allele  ) 
 

bool Genotype::operator< const Data b  )  const [virtual]
 

operator <

NOTA BENE: This is used for SORTING ONLY

Implements Data.

bool Genotype::operator== const Data b  )  const [virtual]
 

Implements Data.

void Genotype::set const int  allele1,
const int  allele2
 

void Genotype::set const std::string &  genotype  )  [virtual]
 

Implements Data.

void Genotype::set const char *  genotype  )  [virtual]
 

Implements Data.

void Genotype::setAllele1 const std::string &  allele1  ) 
 

void Genotype::setAllele1 const char *  allele1  ) 
 

void Genotype::setAllele1 const int  allele1  ) 
 

void Genotype::setAllele2 const std::string &  allele2  ) 
 

void Genotype::setAllele2 const char *  allele2  ) 
 

void Genotype::setAllele2 const int  allele2  ) 
 

void Genotype::setMissing void   )  [inline, virtual]
 

Implements Data.


Member Data Documentation

unsigned int Genotype::_allele1 [private]
 

unsigned int Genotype::_allele2 [private]
 

const char Genotype::_alternateDelimiter = '|' [static, private]
 

std::string Genotype::_genotype [private]
 

String representation of the genotype alleles

std::set< std::string > Genotype::_genotypeMissingValue [static, private]
 

bool Genotype::_isMissing [private]
 

bool Genotype::_isSNP [private]
 

Is the genotype for a SNP?

const char Genotype::_normalDelimiter = '/' [static, private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 18 16:24:39 2011 for MADELINE by  doxygen 1.4.4