Learn R Programming

hsphase (version 3.0.0)

fixSW: Fixing Switch Errors

Description

Fix switch errors in haplotypes for a half-sib family.

Usage

fixSW(haplotype, ohMax = 0, windowsSize = 100, minLength = 100, cpus = 2)

Value

A haplotype matrix with switch errors corrected.

Arguments

haplotype

matrix. Haplotypes for a half-sib family (two rows per individual).

ohMax

integer. Maximum tolerated opposing homozygotes when grouping each partition (increase if genotyping errors exist).

windowsSize

integer. Partition size (number of SNPs).

minLength

integer. Minimum length between switches.

cpus

integer. Number of CPU threads.

See Also

groupMatSingle and addSwitch

Examples

Run this code
haplotype <- .simulateHalfsib(7, 2500, type = "haplotype")$phased
switches <- list(500,0,0,1200,c(1000,2000),500,1200)

haplotype2 <- addSwitch(haplotype, switches, 0)

gMat <- groupMatSingle(haplotype2, 100, 2, "haplotype")
imageplot(gMat, title = "Before fixing switches")

haplotype3 <- fixSW(haplotype2, 0, 100, 100)

gMat2 <- groupMatSingle(haplotype3, 100, 2, "haplotype")
imageplot(gMat2, title = "After fixing switches")

Run the code above in your browser using DataLab