GenotypeList Class Reference
Collaboration diagram for GenotypeList:
[legend]

## Public Member Functions

void | Dimension (int genotypes)
void | Delete (int genotype)
bool | Matches (int genotype, int allele)
bool | Matches (int allele)
int | SaveGenotype (int genotype)
void | SetGenotype (int genotype, int al1, int al2)

## Static Public Member Functions

static bool | EliminateGenotypes (Pedigree &ped, Family *family, int marker)

## Public Attributes

IntArray | allele1
IntArray | allele2
IntArray | alleles
bool | ignore
int | checked

## Detailed Description

Definition at line 23 of file GenotypeLists.h.

## Constructor & Destructor Documentation

## GenotypeList()

GenotypeList::GenotypeList | ( |  | ) |

Definition at line 24 of file GenotypeLists.cpp.

{
ignore = false;
}

## Member Function Documentation

## Delete()

void GenotypeList::Delete | ( | int | genotype | ) |

Definition at line 332 of file GenotypeLists.cpp.

{
allele1.Delete(genotype);
allele2.Delete(genotype);
}

## Dimension()

void GenotypeList::Dimension | ( | int | genotypes | ) |

Definition at line 320 of file GenotypeLists.cpp.

{
allele1.Dimension(genotypes);
allele2.Dimension(genotypes);
}

## EliminateGenotypes()

bool GenotypeList::EliminateGenotypes | ( | Pedigree & | ped,
|  | Family * | family,
|  | int | marker
| ) |  |

static

Definition at line 29 of file GenotypeLists.cpp.

{
// First, allocate a genotype list for the family
GenotypeList * list = new GenotypeList [family->count];
// Next, update the possible allele lists for each individual
InitializeList(list, ped, family, marker);
// Then, do multiple rounds of elimination until a problem is found
// or no changes are made
#ifdef DEBUG_ELIMINATOR
Print(list, ped, family, marker);
#endif
while (PairwiseCheck(list, ped, family) || FamilyCheck(list, ped, family))
#ifdef DEBUG_ELIMINATOR
Print(list, ped, family, marker)
#endif
;
for (int i = 0; i < family->count; i++)
if (!list[i].ignore && list[i].allele1.Length() == 0)
{
printf("%s - Family %s has a subtle genotype inconsistency\n",
(const char *) ped.markerNames[marker], (const char *) family->famid);
delete [] list;
return false;
}
delete [] list;
return true;
}
GenotypeList
Definition: GenotypeLists.h:24

## Matches() [1/2]

bool GenotypeList::Matches | ( | int | allele | ) |

Definition at line 290 of file GenotypeLists.cpp.

{
return allele1.Find(allele) != -1 || allele2.Find(allele) != -1;
}

## Matches() [2/2]

bool GenotypeList::Matches | ( | int | genotype,
|  | int | allele
| ) |  |

Definition at line 285 of file GenotypeLists.cpp.

{
return allele1[genotype] == allele || allele2[genotype] == allele;
}

## SaveGenotype()

int GenotypeList::SaveGenotype | ( | int | genotype | ) |

Definition at line 295 of file GenotypeLists.cpp.

{
if (checked > genotype)
return genotype;
if (checked != genotype)
{
allele1.Swap(genotype, checked);
allele2.Swap(genotype, checked);
}
return checked++;
}

## SetGenotype()

void GenotypeList::SetGenotype | ( | int | genotype,
|  | int | al1,
|  | int | al2
| ) |  |

Definition at line 326 of file GenotypeLists.cpp.

{
allele1[genotype] = al1;
allele2[genotype] = al2;
}

## Member Data Documentation

## allele1

IntArray GenotypeList::allele1

Definition at line 27 of file GenotypeLists.h.

## allele2

IntArray GenotypeList::allele2

Definition at line 27 of file GenotypeLists.h.

## alleles

IntArray GenotypeList::alleles

Definition at line 28 of file GenotypeLists.h.

## checked

int GenotypeList::checked

Definition at line 31 of file GenotypeLists.h.

## ignore

bool GenotypeList::ignore

Definition at line 30 of file GenotypeLists.h.

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

- general/GenotypeLists.h
- general/GenotypeLists.cpp