Learn R Programming

mlPhaser (version 0.01)

recurseHaplos: Recurse to get haplo groups

Description

Recursive function to extract valid groups of haplotypes explaining a genotype

Usage

recurseHaplos(validHaplotypes, remGenotype, group)

Arguments

validHaplotypes
A list of haplotypes to choose from
remGenotype
The remaining part of the genotype
group
The valid group to this point.

Value

NULL. N.B. requires access to a globally accessible storage variable: validHaploGroups

Details

This recursive function subtracts haplotypes from a genotypes to find 'groups' of haplotypes that can fully explain a genotype. To make the function general and cope with ploidy > 2, I made it recursive. It will keep going until it has run out of genotype and/or it has run out of valid haplotypes. This should probably stay as an internal function because of its recursive nature. N.B. requires access to a globally accessible storage variable: validHaploGroups