| addSwitch | R Documentation |
Add switch points to haplotypes by swapping the two haplotype rows for an individual from each switch point to the end of the chromosome.
addSwitch(haplotypeMatrix, switchPoints, minLength)
haplotypeMatrix |
|
switchPoints |
|
minLength |
|
Important: Each switch point causes a swap of the two haplotype rows for that individual from the switch position to the end.
The switchPoints list must have one element per individual (not per haplotype row).
If an element is 0, no switch is applied for that individual.
If you rely on minLength to ignore nearby switches, verify your installed version enforces this rule.
A matrix of the same dimension as haplotypeMatrix with switches applied.
groupMatSingle and fixSW
haplotype <- matrix(c(0, 0, 0, 0,
1, 1, 1, 1,
0, 0, 1, 1,
1, 1, 0, 0,
1, 1, 1, 1,
0, 0, 0, 0), byrow = TRUE, nrow = 6)
switchPoints <- list(firstInd = c(2), secondInd = c(1, 3), lastInd = 0)
addSwitch(haplotype, switchPoints, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.