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

DataTable Class Reference

#include <DataTable.h>

List of all members.

Public Types

enum  TableType {
  PEDIGREE, GENETICMAP, DECOMPOSED, RESULTS,
  ALLELEFREQUENCY, UNKNOWNTABLETYPE
}

Public Member Functions

 DataTable (TableParser &parser)
 ~DataTable ()
void addColumn (DataColumn *column)
unsigned getColumnOrdinal (const char *name) const
std::string getColumnName (unsigned ordinal) const
unsigned getNumberOfColumns (void) const
DataColumn * getColumn (unsigned ordinal) const
DataColumn * getColumn (const std::string &name) const
void deleteFrontColumn ()
void display ()
void printInputTableAsTabDelimited (std::string filename) const
void printPedigreeTableAsTabDelimited (std::string filename) const
const TableType getTableType (void) const
std::string getTableTypeAsString (void) const
const unsigned getNumberOfRows (void) const
bool columnExists (const std::string &name) const
void toggleColumnsForPedigree (const std::vector< std::string > &columns)
unsigned getNumberOfShowOnPedigreeColumns () const
Data * getDataAtIndex (const std::string name, unsigned long index) const
Data * getDataAtIndex (unsigned columnIndex, unsigned long index) const
int getAffectedColumnIndex (void) const
int getDeceasedColumnIndex (void) const
int getDOBColumnIndex (void) const
int getDZTwinColumnIndex (void) const
int getMZTwinColumnIndex (void) const
int getProbandColumnIndex (void) const
int getSampledColumnIndex (void) const
int getSuperscriptColumnIndex (void) const
int getConsultandColumnIndex (void) const
int getCarrierColumnIndex (void) const
int getRelationshipEndedColumnIndex (void) const
int getInfertilityColumnIndex (void) const
int getSterilityColumnIndex (void) const
unsigned getIconColumnCount (void) const
unsigned getIconColumnIndex (unsigned nth) const
unsigned getLabelColumnIndex (unsigned nth) const
const std::vector< unsigned > * getIconColumnVector (void) const
const std::vector< unsigned > * getLabelColumnVector (void) const
ColorSeriesStack * getColorSeriesStack (void) const
ColorSeries * getColorSeriesFromStack (unsigned nth) const
ColorSeries * getBlackAndWhiteSeriesFromStack (unsigned nth) const

Static Public Attributes

static const int COLUMN_IS_MISSING = -1
static FieldLabels labels

Private Member Functions

void _setDeclaredTypesFromParser (const std::vector< char > *pDeclaredTypes)
void _determineTableType (const std::vector< std::string > *pTitles)
void _classifyRemainingColumns (const std::vector< std::string > *pElements, const std::vector< std::string > *pTitles)
void _setColorSeriesStack (void)

Private Attributes

TableType _tabletype
FileTypeClassifier _fileTypeClassifier
FileTypeClassifier::FILE_TYPE _fileType
const char * _fileTypeName
std::set< DataColumn *, ltstr > _columnSet
std::vector< std::set< DataColumn *,
ltstr >::iterator > 
_columnVector
std::vector< DATATYPE > _finalTypes
unsigned long _rows
unsigned _columns
std::vector< unsigned > _iconColumns
std::vector< unsigned > _labelColumns
ColorSeriesStack * _colorSeriesStack
ColorSeriesStack * _blackAndWhiteSeriesStack
int _affectedColumnIndex
int _deceasedColumnIndex
int _dobColumnIndex
int _dzTwinColumnIndex
int _mzTwinColumnIndex
int _probandColumnIndex
int _sampledColumnIndex
int _superscriptColumnIndex
int _consultandColumnIndex
int _carrierColumnIndex
int _relationshipEndedColumnIndex
int _infertilityColumnIndex
int _sterilityColumnIndex

Classes

struct  ltstr


Detailed Description

This class is used to store data tables that have been read in from files. The files are read from a Parser class, classified, and then have their columns classified.

This class is used as a container for all types of data tables encountered in Madeline. At the same time, some aspects of the class are specific to pedigree tables (the most common table type encountered in Madeline). Due to the way that the table classi- fication code works, we felt it was better --without being very expensive-- to add some pedigree-table-specific functionality directly into DataTable rather than have to break out separate subclasses for each table type.


Member Enumeration Documentation

enum DataTable::TableType
 

Enumerator:
PEDIGREE 
GENETICMAP 
DECOMPOSED 
RESULTS 
ALLELEFREQUENCY 
UNKNOWNTABLETYPE 


Constructor & Destructor Documentation

DataTable::DataTable (  TableParser &  parser  ) 
 

DataTable::~DataTable (   ) 
 


Member Function Documentation

void DataTable::_classifyRemainingColumns (  const std::vector< std::string > *  pElements,
const std::vector< std::string > *  pTitles
)  [private]
 

void DataTable::_determineTableType (  const std::vector< std::string > *  pTitles  )  [private]
 

_determineTableType: This method determines the type of the data table. This method also classifies the column types of known core columns

void DataTable::_setColorSeriesStack (  void   )  [private]
 

void DataTable::_setDeclaredTypesFromParser (  const std::vector< char > *  pDeclaredTypes  )  [private]
 

void DataTable::addColumn (  DataColumn *  column  ) 
 

bool DataTable::columnExists (  const std::string &  name  )  const
 

columnExists(): Check if a column exists in a data table by searching the table header.

void DataTable::deleteFrontColumn (   ) 
 

void DataTable::display (   ) 
 

int DataTable::getAffectedColumnIndex (  void   )  const [inline]
 

ColorSeries * DataTable::getBlackAndWhiteSeriesFromStack (  unsigned  nth  )  const
 

int DataTable::getCarrierColumnIndex (  void   )  const [inline]
 

ColorSeries * DataTable::getColorSeriesFromStack (  unsigned  nth  )  const
 

ColorSeriesStack * DataTable::getColorSeriesStack (  void   )  const
 

DataColumn * DataTable::getColumn (  const std::string &  name  )  const
 

getColumn(): Get a column by name.

DataColumn * DataTable::getColumn (  unsigned  ordinal  )  const
 

getColumn(): Get a column by index/ordinal.

std::string DataTable::getColumnName (  unsigned  ordinal  )  const
 

getColumnName(): Returns the name of the column at physical position 'ordinal'.

unsigned DataTable::getColumnOrdinal (  const char *  name  )  const
 

getColumnOrdinal(): Returns the columns physical position.

int DataTable::getConsultandColumnIndex (  void   )  const [inline]
 

Data * DataTable::getDataAtIndex (  unsigned  columnIndex,
unsigned long  index
)  const
 

Data * DataTable::getDataAtIndex (  const std::string  name,
unsigned long  index
)  const
 

int DataTable::getDeceasedColumnIndex (  void   )  const [inline]
 

int DataTable::getDOBColumnIndex (  void   )  const [inline]
 

int DataTable::getDZTwinColumnIndex (  void   )  const [inline]
 

unsigned DataTable::getIconColumnCount (  void   )  const
 

getIconColumnCount(): Get a count of number of data fields that will be displayed on the icon. By default all the fields that have 'Affected' as the prefix will be used to display on the icon.

unsigned DataTable::getIconColumnIndex (  unsigned  nth  )  const
 

const std::vector< unsigned > * DataTable::getIconColumnVector (  void   )  const
 

getIconColumnVector(): Return a pointer to the _iconColumns vector.

int DataTable::getInfertilityColumnIndex (  void   )  const [inline]
 

unsigned DataTable::getLabelColumnIndex (  unsigned  nth  )  const
 

const std::vector< unsigned > * DataTable::getLabelColumnVector (  void   )  const
 

getlabelColumnVector(): Return a pointer to the _labelColumns vector.

int DataTable::getMZTwinColumnIndex (  void   )  const [inline]
 

unsigned DataTable::getNumberOfColumns (  void   )  const
 

getNumberOfColumns(): Returns the number of columns in the table.

const unsigned DataTable::getNumberOfRows (  void   )  const [inline]
 

unsigned DataTable::getNumberOfShowOnPedigreeColumns (   )  const
 

getNumberOfShowOnPedigreeColumns(): Get number of data columns that will be displayed on the pedigree output.

int DataTable::getProbandColumnIndex (  void   )  const [inline]
 

int DataTable::getRelationshipEndedColumnIndex (  void   )  const [inline]
 

int DataTable::getSampledColumnIndex (  void   )  const [inline]
 

int DataTable::getSterilityColumnIndex (  void   )  const [inline]
 

int DataTable::getSuperscriptColumnIndex (  void   )  const [inline]
 

const TableType DataTable::getTableType (  void   )  const [inline]
 

std::string DataTable::getTableTypeAsString (  void   )  const
 

void DataTable::printInputTableAsTabDelimited (  std::string  filename  )  const
 

void DataTable::printPedigreeTableAsTabDelimited (  std::string  filename  )  const
 

void DataTable::toggleColumnsForPedigree (  const std::vector< std::string > &  columns  ) 
 

toggleColumnsForPedigree(): User can specify any number of columns to be displayed on the pedigree. Mark all such columns for output display, if they exist.


Member Data Documentation

int DataTable::_affectedColumnIndex [private]
 

ColorSeriesStack* DataTable::_blackAndWhiteSeriesStack [private]
 

int DataTable::_carrierColumnIndex [private]
 

ColorSeriesStack* DataTable::_colorSeriesStack [private]
 

unsigned DataTable::_columns [private]
 

std::set<DataColumn *,ltstr> DataTable::_columnSet [private]
 

std::vector< std::set<DataColumn *,ltstr>::iterator > DataTable::_columnVector [private]
 

int DataTable::_consultandColumnIndex [private]
 

int DataTable::_deceasedColumnIndex [private]
 

int DataTable::_dobColumnIndex [private]
 

int DataTable::_dzTwinColumnIndex [private]
 

FileTypeClassifier::FILE_TYPE DataTable::_fileType [private]
 

FileTypeClassifier DataTable::_fileTypeClassifier [private]
 

const char* DataTable::_fileTypeName [private]
 

std::vector<DATATYPE> DataTable::_finalTypes [private]
 

std::vector<unsigned> DataTable::_iconColumns [private]
 

int DataTable::_infertilityColumnIndex [private]
 

std::vector<unsigned> DataTable::_labelColumns [private]
 

int DataTable::_mzTwinColumnIndex [private]
 

int DataTable::_probandColumnIndex [private]
 

int DataTable::_relationshipEndedColumnIndex [private]
 

unsigned long DataTable::_rows [private]
 

int DataTable::_sampledColumnIndex [private]
 

int DataTable::_sterilityColumnIndex [private]
 

int DataTable::_superscriptColumnIndex [private]
 

TableType DataTable::_tabletype [private]
 

const int DataTable::COLUMN_IS_MISSING = -1 [static]
 

FieldLabels DataTable::labels [static]
 


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