libStatGen Software 1
GenotypeList Class Reference
Collaboration diagram for GenotypeList:

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.

25{
26 ignore = false;
27}

Member Function Documentation

◆ Delete()

void GenotypeList::Delete ( int  genotype)

Definition at line 332 of file GenotypeLists.cpp.

333{
334 allele1.Delete(genotype);
335 allele2.Delete(genotype);
336}

◆ Dimension()

void GenotypeList::Dimension ( int  genotypes)

Definition at line 320 of file GenotypeLists.cpp.

321{
322 allele1.Dimension(genotypes);
323 allele2.Dimension(genotypes);
324}

◆ EliminateGenotypes()

bool GenotypeList::EliminateGenotypes ( Pedigree ped,
Family family,
int  marker 
)
static

Definition at line 29 of file GenotypeLists.cpp.

30{
31 // First, allocate a genotype list for the family
32 GenotypeList * list = new GenotypeList [family->count];
33
34 // Next, update the possible allele lists for each individual
35 InitializeList(list, ped, family, marker);
36
37 // Then, do multiple rounds of elimination until a problem is found
38 // or no changes are made
39
40#ifdef DEBUG_ELIMINATOR
41 Print(list, ped, family, marker);
42#endif
43
44 while (PairwiseCheck(list, ped, family) || FamilyCheck(list, ped, family))
45#ifdef DEBUG_ELIMINATOR
46 Print(list, ped, family, marker)
47#endif
48 ;
49
50 for (int i = 0; i < family->count; i++)
51 if (!list[i].ignore && list[i].allele1.Length() == 0)
52 {
53 printf("%s - Family %s has a subtle genotype inconsistency\n",
54 (const char *) ped.markerNames[marker], (const char *) family->famid);
55
56 delete [] list;
57 return false;
58 }
59
60 delete [] list;
61 return true;
62}

◆ Matches() [1/2]

bool GenotypeList::Matches ( int  allele)

Definition at line 290 of file GenotypeLists.cpp.

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

◆ Matches() [2/2]

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

Definition at line 285 of file GenotypeLists.cpp.

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

◆ SaveGenotype()

int GenotypeList::SaveGenotype ( int  genotype)

Definition at line 295 of file GenotypeLists.cpp.

296{
297 if (checked > genotype)
298 return genotype;
299
300 if (checked != genotype)
301 {
302 allele1.Swap(genotype, checked);
303 allele2.Swap(genotype, checked);
304 }
305
306 return checked++;
307}

◆ SetGenotype()

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

Definition at line 326 of file GenotypeLists.cpp.

327{
328 allele1[genotype] = al1;
329 allele2[genotype] = al2;
330}

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: