Loading...
Searching...
No Matches
Person Class Reference
Inheritance diagram for Person:
[legend]
Collaboration diagram for Person:
[legend]

## Public Member Functions

bool | isHalfSib (Person &sib)
bool | isSib (Person &sib)
bool | isTwin (Person &twin)
bool | isMzTwin (Person &mzTwin)
bool | CheckParents ()
void | AssessStatus ()
bool | isFounder ()
bool | isSexed ()
bool | isGenotyped (int m)
bool | isFullyGenotyped ()
bool | isControlled (int c)
bool | isFullyControlled ()
bool | isPhenotyped (int t)
bool | isFullyPhenotyped ()
bool | isDiagnosed (int a)
bool | isFullyDiagnosed ()
bool | haveData ()
bool | isAncestor (Person *descendant)
int | GenotypedMarkers ()
void | Copy (Person &rhs)
void | CopyIDs (Person &rhs)
void | CopyPhenotypes (Person &rhs)
void | WipePhenotypes (bool remove_genotypes=true)

## Static Public Member Functions

static void | Order (Person *&p1, Person *&p2)
Static Public Member Functions inherited from PedigreeGlobals
static int | GetTraitID (const char *name)
static int | GetMarkerID (const char *name)
static int | GetCovariateID (const char *name)
static int | GetAffectionID (const char *name)
static int | GetStringID (const char *name)
static int | LookupTrait (const char *name)
static int | LookupMarker (const char *name)
static int | LookupCovariate (const char *name)
static int | LookupAffection (const char *name)
static int | LookupString (const char *name)
static void | GrowMarkerInfo ()
static MarkerInfo * | GetMarkerInfo (String &name)
static MarkerInfo * | GetMarkerInfo (int marker)
static int | SortMarkersInMapOrder (IntArray &markers, int chromosome=-1)
static void | GetOrderedMarkers (IntArray &markers)
static void | FlagMissingMarkers (IntArray &missingMarkers)
static bool | MarkerPositionsAvailable ()
static bool | AlleleFrequenciesAvailable ()
static void | VerifySexSpecificOrder ()
static void | LoadAlleleFrequencies (const char *filename, bool required=false)
static void | LoadAlleleFrequencies (IFILE &file)
static void | LoadMarkerMap (const char *filename, bool filter=false)
static void | LoadMarkerMap (IFILE &file, bool filter=false)
static void | LoadBasepairMap (const char *filename)
static void | LoadBasepairMap (IFILE &file)
static void | WriteMapFile (const char *filename)
static void | WriteMapFile (FILE *file)
static void | WriteFreqFile (const char *filename, bool old_format=false)
static void | WriteFreqFile (FILE *file, bool old_format=false)
static int | LoadAllele (int marker, String &label)
static int | LoadAllele (MarkerInfo *info, String &label)

## Public Attributes

String | famid
String | pid
String | motid
String | fatid
int | sex
int | zygosity
int | serial
int | traverse
Alleles * | markers
double * | traits
char * | affections
double * | covariates
String * | strings
Person * | father
Person * | mother
int | sibCount
Person ** | sibs
int | ngeno
bool | filter

## Additional Inherited Members

Static Public Attributes inherited from PedigreeGlobals
static int | traitCount = 0
static int | markerCount = 0
static int | affectionCount = 0
static int | covariateCount = 0
static int | stringCount = 0
static bool | chromosomeX = false
static bool | sexSpecificMap = false
static StringArray | traitNames
static StringArray | covariateNames
static StringArray | affectionNames
static StringArray | markerNames
static StringArray | stringNames
static StringIntHash | markerLookup
static StringIntHash | traitLookup
static StringIntHash | affectionLookup
static StringIntHash | covariateLookup
static StringIntHash | stringLookup
static int | markerInfoCount = 0
static int | markerInfoSize = 0
static MarkerInfo ** | markerInfo = NULL
static StringHash | markerInfoByName
static MarkerInfo ** | markerInfoByInteger = NULL

## Detailed Description

Definition at line 31 of file PedigreePerson.h.

## Constructor & Destructor Documentation

## Person()

Person::Person | ( |  | ) |

Definition at line 28 of file PedigreePerson.cpp.

{
zygosity = sex = 0;
serial = traverse = -1;
markers = new Alleles [markerCount];
traits = new double [traitCount];
covariates = new double [covariateCount];
affections = new char [affectionCount];
strings = new String [stringCount];
for (int i = 0; i < traitCount; i++) traits[i] = _NAN_;
for (int i = 0; i < covariateCount; i++) covariates[i] = _NAN_;
for (int i = 0; i < affectionCount; i++) affections[i] = 0;
filter = false;
father = mother = NULL;
sibs = NULL;
sibCount = 0;
ngeno = 0;
hasBothParents = hasAllTraits = hasAllAffections = hasAllCovariates = false;
}

## ~Person()

Person::~Person | ( |  | ) |

Definition at line 53 of file PedigreePerson.cpp.

{
delete [] markers;
delete [] traits;
delete [] affections;
delete [] covariates;
delete [] strings;
if (sibCount) delete [] sibs;
}

## Member Function Documentation

## AssessStatus()

void Person::AssessStatus | ( |  | ) |

Definition at line 147 of file PedigreePerson.cpp.

{
hasBothParents = father != NULL && mother != NULL;
hasAllTraits = hasAllAffections = hasAllCovariates = true;
ngeno = 0;
for (int m = 0; m < markerCount; m++)
if (isGenotyped(m))
ngeno++;
for (int t = 0; t < traitCount; t++)
if (!isPhenotyped(t))
{
hasAllTraits = false;
break;
}
for (int c = 0; c < covariateCount; c++)
if (!isControlled(c))
{
hasAllCovariates = false;
break;
}
for (int a = 0; a < affectionCount; a++)
if (!isDiagnosed(a))
{
hasAllAffections = false;
break;
}
}

## CheckParents()

bool Person::CheckParents | ( |  | ) |

Definition at line 107 of file PedigreePerson.cpp.

{
hasBothParents = father != NULL && mother != NULL;
if (!hasBothParents)
{
if (father != NULL || mother != NULL)
{
printf("Parent named %s for Person %s in Family %s is missing\n",
(father == NULL) ? (const char *) fatid : (const char *) motid,
(const char *) pid, (const char *) famid);
return false;
}
else
return true;
}
if (father->sex == SEX_FEMALE || mother->sex == SEX_MALE)
// If parents are switched around, we can fix it...
{
Person * swap = father;
father = mother;
mother = swap;
String temp = fatid;
fatid = motid;
motid = temp;
}
if (father->sex == SEX_FEMALE || mother->sex == SEX_MALE)
// If things still don't make sense then the problem is more serious ...
{
printf("Parental sex codes don't make sense for Person %s in Family %s\n",
(const char *) pid, (const char *) famid);
return false;
}
return true;
}

## Copy()

void Person::Copy | ( | Person & | rhs | ) |

Definition at line 64 of file PedigreePerson.cpp.

{
CopyIDs(rhs);
CopyPhenotypes(rhs);
}

## CopyIDs()

void Person::CopyIDs | ( | Person & | rhs | ) |

Definition at line 97 of file PedigreePerson.cpp.

{
famid = rhs.famid;
pid = rhs.pid;
fatid = rhs.fatid;
motid = rhs.motid;
sex = rhs.sex;
zygosity = rhs.zygosity;
}

## CopyPhenotypes()

void Person::CopyPhenotypes | ( | Person & | rhs | ) |

Definition at line 70 of file PedigreePerson.cpp.

{
for (int i = 0; i < Person::traitCount; i++)
traits[i] = rhs.traits[i];
for (int i = 0; i < Person::affectionCount; i++)
affections[i] = rhs.affections[i];
for (int i = 0; i < Person::covariateCount; i++)
covariates[i] = rhs.covariates[i];
for (int i = 0; i < Person::markerCount; i++)
markers[i] = rhs.markers[i];
ngeno = rhs.ngeno;
}

## GenotypedMarkers()

int Person::GenotypedMarkers | ( |  | ) |

Definition at line 190 of file PedigreePerson.cpp.

{
int count = 0;
for (int m = 0; m < Person::markerCount; m++)
if (markers[m].isKnown())
count++;
return count;
}

## haveData()

bool Person::haveData | ( |  | ) |

Definition at line 201 of file PedigreePerson.cpp.

{
if (ngeno)
return true;
for (int i = 0; i < affectionCount; i++)
if (affections[i] != 0)
return true;
for (int i = 0; i < traitCount; i++)
if (traits[i] != _NAN_)
return true;
return false;
}

## isAncestor()

bool Person::isAncestor | ( | Person * | descendant | ) |

Definition at line 217 of file PedigreePerson.cpp.

{
if (traverse > descendant->traverse)
return false;
if (serial == descendant->serial)
return true;
if (descendant->isFounder())
return false;
return (isAncestor(descendant->mother) ||
isAncestor(descendant->father));
}

## isControlled()

bool Person::isControlled | ( | int | c | ) |

inline

Definition at line 107 of file PedigreePerson.h.

{
return covariates[c] != _NAN_;
}

## isDiagnosed()

bool Person::isDiagnosed | ( | int | a | ) |

inline

Definition at line 123 of file PedigreePerson.h.

{
return affections[a] != 0;
}

## isFounder()

bool Person::isFounder | ( |  | ) |

inline

Definition at line 91 of file PedigreePerson.h.

{
return !hasBothParents;
}

## isFullyControlled()

bool Person::isFullyControlled | ( |  | ) |

inline

Definition at line 111 of file PedigreePerson.h.

{
return hasAllCovariates;
}

## isFullyDiagnosed()

bool Person::isFullyDiagnosed | ( |  | ) |

inline

Definition at line 127 of file PedigreePerson.h.

{
return hasAllAffections;
}

## isFullyGenotyped()

bool Person::isFullyGenotyped | ( |  | ) |

inline

Definition at line 103 of file PedigreePerson.h.

{
return ngeno == markerCount;
}

## isFullyPhenotyped()

bool Person::isFullyPhenotyped | ( |  | ) |

inline

Definition at line 119 of file PedigreePerson.h.

{
return hasAllTraits;
}

## isGenotyped()

bool Person::isGenotyped | ( | int | m | ) |

inline

Definition at line 99 of file PedigreePerson.h.

{
return markers[m].isKnown();
}

## isHalfSib()

bool Person::isHalfSib | ( | Person & | sib | ) |

inline

Definition at line 61 of file PedigreePerson.h.

{
return hasBothParents &&
((sib.father == father) ^(sib.mother == mother));
}

## isMzTwin()

bool Person::isMzTwin | ( | Person & | mzTwin | ) |

inline

Definition at line 78 of file PedigreePerson.h.

{
return (zygosity & 1) && (zygosity == mzTwin.zygosity) && isSib(mzTwin);
}

## isPhenotyped()

bool Person::isPhenotyped | ( | int | t | ) |

inline

Definition at line 115 of file PedigreePerson.h.

{
return traits[t] != _NAN_;
}

## isSexed()

bool Person::isSexed | ( |  | ) |

inline

Definition at line 95 of file PedigreePerson.h.

{
return sex != 0;
}

## isSib()

bool Person::isSib | ( | Person & | sib | ) |

inline

Definition at line 67 of file PedigreePerson.h.

{
return hasBothParents &&
(sib.father == father) && (sib.mother == mother);
}

## isTwin()

bool Person::isTwin | ( | Person & | twin | ) |

inline

Definition at line 73 of file PedigreePerson.h.

{
return (zygosity != 0) && (zygosity == twin.zygosity) && isSib(twin);
}

## Order()

void Person::Order | ( | Person *& | p1,
|  | Person *& | p2 )

static

Definition at line 180 of file PedigreePerson.cpp.

{
if (p1->traverse > p2->traverse)
{
Person * temp = p1;
p1 = p2;
p2 = temp;
}
}

## WipePhenotypes()

void Person::WipePhenotypes | ( | bool | remove_genotypes = true | ) |

Definition at line 83 of file PedigreePerson.cpp.

{
for (int i = 0; i < traitCount; i++) traits[i] = _NAN_;
for (int i = 0; i < covariateCount; i++) covariates[i] = _NAN_;
for (int i = 0; i < affectionCount; i++) affections[i] = 0;
if (remove_genotypes)
{
for (int i = 0; i < markerCount; i++)
markers[i][0] = markers[i][1] = 0;
ngeno = 0;
}
}

## Member Data Documentation

## affections

char* Person::affections

Definition at line 44 of file PedigreePerson.h.

## covariates

double* Person::covariates

Definition at line 45 of file PedigreePerson.h.

## famid

String Person::famid

Definition at line 34 of file PedigreePerson.h.

## father

Person* Person::father

Definition at line 48 of file PedigreePerson.h.

## fatid

String Person::fatid

Definition at line 37 of file PedigreePerson.h.

## filter

bool Person::filter

Definition at line 56 of file PedigreePerson.h.

## markers

Alleles* Person::markers

Definition at line 42 of file PedigreePerson.h.

## mother

Person* Person::mother

Definition at line 49 of file PedigreePerson.h.

## motid

String Person::motid

Definition at line 36 of file PedigreePerson.h.

## ngeno

int Person::ngeno

Definition at line 54 of file PedigreePerson.h.

## pid

String Person::pid

Definition at line 35 of file PedigreePerson.h.

## serial

int Person::serial

Definition at line 40 of file PedigreePerson.h.

## sex

int Person::sex

Definition at line 38 of file PedigreePerson.h.

## sibCount

int Person::sibCount

Definition at line 51 of file PedigreePerson.h.

## sibs

Person** Person::sibs

Definition at line 52 of file PedigreePerson.h.

## strings

String* Person::strings

Definition at line 46 of file PedigreePerson.h.

## traits

double* Person::traits

Definition at line 43 of file PedigreePerson.h.

## traverse

int Person::traverse

Definition at line 40 of file PedigreePerson.h.

## zygosity

int Person::zygosity

Definition at line 39 of file PedigreePerson.h.

The documentation for this class was generated from the following files:

- general/PedigreePerson.h
- general/PedigreePerson.cpp