Skip to contents

Extract IBD probabilities for one or more markers from an object of class IBDprob.

Usage

getProbs(IBDprob, markers, sumProbs = FALSE)

Arguments

IBDprob

An object of class IBDprob.

markers

A character vector of markers that should be extracted.

sumProbs

Should the probabilities by summed per parent. If TRUE the probability for e.g. parent A in a cross with parent B will be calculated as pA + 0.5 * pAB. If FALSE both pA and pAB will be output without further calculations.

Value

A data.frame with IBD probabilities for the extracted markers in the column and genotypes in the rows.

Examples

## Compute IBD probabilities for Steptoe Morex.
SxMIBD <- calcIBD(popType = "DH",
                  markerFile = system.file("extdata/SxM", "SxM_geno.txt",
                                        package = "statgenIBD"),
                  mapFile = system.file("extdata/SxM", "SxM_map.txt",
                                        package = "statgenIBD"))

## Get probabilities for a single marker.
probOne <- getProbs(IBDprob = SxMIBD,
                    markers = "plc")
head(probOne)
#>    geno plc_Morex plc_Steptoe
#> 1 dh001         0           1
#> 2 dh002         0           1
#> 3 dh003         0           1
#> 4 dh004         0           1
#> 5 dh005         0           1
#> 6 dh006         0           1

## Get probabilities for a multiple markers.
probMult <- getProbs(IBDprob = SxMIBD,
                     markers = c("plc", "tuba1"))
head(probMult)
#>    geno plc_Morex plc_Steptoe tuba1_Morex tuba1_Steptoe
#> 1 dh001         0           1   0.9790059    0.02099409
#> 2 dh002         0           1   0.9576280    0.04237201
#> 3 dh003         0           1   0.9790059    0.02099409
#> 4 dh004         0           1   0.0000000    1.00000000
#> 5 dh005         0           1   1.0000000    0.00000000
#> 6 dh006         0           1   1.0000000    0.00000000