libStatGen Software  1
GenotypeLists.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 __GENOTYPE_ELIMINATION__
00019 #define __GENOTYPE_ELIMINATION__
00020 
00021 #include "Pedigree.h"
00022 
00023 class GenotypeList
00024 {
00025 public:
00026 
00027     IntArray allele1, allele2;
00028     IntArray alleles;
00029 
00030     bool ignore;
00031     int  checked;
00032 
00033     GenotypeList();
00034 
00035     static bool EliminateGenotypes(Pedigree & ped, Family * family, int marker);
00036 
00037     void   Dimension(int genotypes);
00038     void   Delete(int genotype);
00039 
00040     bool   Matches(int genotype, int allele);
00041     bool   Matches(int allele);
00042 
00043     int    SaveGenotype(int genotype);
00044     void   SetGenotype(int genotype, int al1, int al2);
00045 
00046 private:
00047     static void InitializeList(GenotypeList * list, Pedigree & p, Family * f, int marker);
00048     static bool PairwiseCheck(GenotypeList * list, Pedigree & p, Family * f);
00049     static bool FamilyCheck(GenotypeList * list, Pedigree & p, Family * f);
00050 
00051     static bool CheckTrio(GenotypeList * list, int fatid, int motid, int child, int i, int j, int k);
00052     static bool TrimParent(GenotypeList * list, Person & person, int fatid, int motid);
00053     static bool Cleanup(GenotypeList * list, Person & person, int fatid, int motid, int child, int geno);
00054 
00055     static void Print(GenotypeList * List, Pedigree & p, Family * f, int marker);
00056 };
00057 
00058 
00059 
00060 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends