PedigreeDescription.h

00001 /*
00002  *  Copyright (C) 2010  Regents of the University of Michigan
00003  *
00004  *   This program is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 // Possible pedigree columns
00029 #define  pcSkip      0
00030 #define  pcMarker    1
00031 #define  pcTrait     2
00032 #define  pcAffection 3
00033 #define  pcCovariate 4
00034 #define  pcZygosity  5
00035 #define  pcEnd       6
00036 
00037 // Undocumented pedigree column types -- not recommended
00038 #define  pcUndocumentedTraitCovariate   1001
00039 
00040 class PedigreeDescription : public PedigreeGlobals
00041 {
00042 public:
00043     int      columnCount;
00044     IntArray columns, columnHash;
00045 
00046     PedigreeDescription();
00047     ~PedigreeDescription();
00048 
00049     void Load(IFILE & Input, bool warnIfLinkage = false);
00050     void Load(const char * filename, bool warnIfLinkage = false);
00051 
00052     void LoadLinkageDataFile(IFILE & input);
00053     void LoadLinkageDataFile(const char * filename);
00054 
00055     void LoadMendelDataFile(IFILE & input);
00056     void LoadMendelDataFile(const char * filename);
00057 
00058     void LoadMap(IFILE & Input);
00059     void LoadMap(const char * filename);
00060 
00061     PedigreeDescription & operator = (PedigreeDescription & rhs);
00062 
00063     int CountTextColumns();
00064 
00065     // returns a string summarizing column contents
00066     const char * ColumnSummary(String & string);
00067 
00068     // Flag specifying Mendel format
00069     bool mendelFormat;
00070 
00071     String filename;
00072 
00073 private:
00074     int ReadLineHelper(IFILE & input, String & buffer, StringArray & tokens);
00075 
00076     int CountColumns(int type);
00077     void UpdateSummary(String & string, int type, const char * label);
00078 };
00079 
00080 #endif
00081 
Generated on Wed Nov 17 15:38:29 2010 for StatGen Software by  doxygen 1.6.3