PedigreeDescription.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __PEDDESCRIBE_H__
00019 #define __PEDDESCRIBE_H__
00020
00021 #include "PedigreeGlobals.h"
00022 #include "PedigreePerson.h"
00023 #include "StringArray.h"
00024 #include "IntArray.h"
00025
00026 #include <stdio.h>
00027
00028
00029 #define pcSkip 0
00030 #define pcMarker 1
00031 #define pcTrait 2
00032 #define pcAffection 3
00033 #define pcCovariate 4
00034 #define pcString 5
00035 #define pcZygosity 6
00036 #define pcEnd 7
00037
00038
00039 #define pcUndocumentedTraitCovariate 1001
00040
00041 class PedigreeDescription : public PedigreeGlobals
00042 {
00043 public:
00044 int columnCount;
00045 IntArray columns, columnHash;
00046
00047 PedigreeDescription();
00048 ~PedigreeDescription();
00049
00050 void Load(IFILE & Input, bool warnIfLinkage = false);
00051 void Load(const char * filename, bool warnIfLinkage = false);
00052
00053 void LoadLinkageDataFile(IFILE & input);
00054 void LoadLinkageDataFile(const char * filename);
00055
00056 void LoadMendelDataFile(IFILE & input);
00057 void LoadMendelDataFile(const char * filename);
00058
00059 void LoadMap(IFILE & Input);
00060 void LoadMap(const char * filename);
00061
00062 PedigreeDescription & operator = (PedigreeDescription & rhs);
00063
00064 int CountTextColumns();
00065
00066
00067 const char * ColumnSummary(String & string);
00068
00069
00070 bool mendelFormat;
00071
00072 String filename;
00073
00074 void AddMarkerColumn(const char * markerName);
00075 void AddTraitColumn(const char * traitName);
00076 void AddAffectionColumn(const char * affectionName);
00077 void AddCovariateColumn(const char * covariateName);
00078 void AddStringColumn(const char * stringName);
00079 void AddZygosityColumn();
00080 void AddSkippedColumn();
00081
00082 private:
00083 int ReadLineHelper(IFILE & input, String & buffer, StringArray & tokens);
00084
00085 int CountColumns(int type);
00086 void UpdateSummary(String & string, int type, const char * label);
00087 };
00088
00089 #endif
00090