libStatGen Software 1
Loading...
Searching...
No Matches
PedigreeFamily.h
1/*
2 * Copyright (C) 2010 Regents of the University of Michigan
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __PEDFAMILY_H__
19#define __PEDFAMILY_H__
20
21#include "PedigreeAlleles.h"
22#include "PedigreePerson.h"
23#include "StringBasics.h"
24
25class Pedigree;
26
27class Family
28{
29public:
30 Pedigree & ped;
31 String famid;
32 int serial;
33 int first, last; // sentinel family members
34 int count; // number of individuals in pedigree
35 int founders; // number of founders in pedigree
36 int nonFounders; // number of non-founders in pedigree
37 int mzTwins; // number of MZ twins, excluding 1st twin in set
38 int * path; // traverses the pedigree so that ancestors
39 // preceed their descendants
40
41 int generations; // Rough classification as:
42 // 1 -- all individuals are unrelated
43 // 2 -- two generations (inc. multiple couples)
44 // 3 -- three or more generations
45
46 bool isNuclear()
47 {
48 return (generations == 2) && (founders == 2);
49 }
50
51 Family(Pedigree & ped, int top, int bottom, int serial = 0);
52 ~Family();
53
54 int ConnectedGroups(IntArray * groupMembership = NULL);
55
56private:
57 void ShowInvalidCycles();
58
59 Family & operator = (Family & rhs);
60// void Mark(int who, int group, IntArray * stack, IntArray & group_id );
61};
62
63#endif
64