Description Usage Arguments Value Author(s) Examples
View source: R/makeTransitionMatrix.R
Function to generate genotypic transition probablilites matrices, which represent conditional probabilities P(g1|g2,nmeioses), where g1 is henotype of person one (AA, AB or BB), g2 is genotype of person two, and nmeioses is the number of meioses separating these two individuals (0 for twins, 1 for parent-offspring, c(2,2) for sibs, 2 for grandparent-grandchild pairs, etc.)
1 | makeTransitionMatrix(q, nmeioses = 1000)
|
nmeioses |
number of meioses separating two individuals ((a vector) of non-negative integers). If a vector, it is assumed it lists all meiotic paths connecting the pair |
q |
(a vector of) the coded allele frequency(ies) (e.g. "Q.2" of GenABEL-package) |
If q is scalar, a 3x3 matrix is returned, where elements represent conditional transition probabilities P(g1|g2,nmeioses); rows correspond to the genotypes of g1, and columns correspond to the genotypes of g2. If coded allele is 'B', then e.g. element [1,2] gives the probability P(g1='AA'|g2='AB',nmeioses=nmeioses).
If q is a vector, series of above-described matrices are returned as an 'array' object. A matrix constructed for certain element q[i] can be accessed via result[,,i].
Yurii Aulchenko
1 2 3 4 5 6 7 8 9 10 11 12 | # transition matrix for parent-offspring, for q=0.1
makeTransitionMatrix(0.1,nmeioses=1)
# for a set of q's
makeTransitionMatrix(c(0.1,0.9),nmeioses=1)
# for sibs
makeTransitionMatrix(0.1,nmeioses=c(2,2))
# for half-sibs (or grandparent-grandchild)
makeTransitionMatrix(0.1,nmeioses=2)
# for remote relatives
makeTransitionMatrix(0.1,nmeioses=10)
# for independent
makeTransitionMatrix(0.1,nmeioses=1000)
|
Loading required package: MASS
Loading required package: GenABEL.data
[,1] [,2] [,3]
[1,] 0.9 0.45 0.0
[2,] 0.1 0.50 0.9
[3,] 0.0 0.05 0.1
, , 1
[,1] [,2] [,3]
[1,] 0.9 0.45 0.0
[2,] 0.1 0.50 0.9
[3,] 0.0 0.05 0.1
, , 2
[,1] [,2] [,3]
[1,] 0.1 0.05 0.0
[2,] 0.9 0.50 0.1
[3,] 0.0 0.45 0.9
[,1] [,2] [,3]
[1,] 0.9025 0.4275 0.2025
[2,] 0.0950 0.5450 0.4950
[3,] 0.0025 0.0275 0.3025
[,1] [,2] [,3]
[1,] 0.855 0.63 0.405
[2,] 0.140 0.34 0.540
[3,] 0.005 0.03 0.055
[,1] [,2] [,3]
[1,] 0.810175781 0.80929688 0.80841797
[2,] 0.179843750 0.18062500 0.18140625
[3,] 0.009980469 0.01007813 0.01017578
[,1] [,2] [,3]
[1,] 0.81 0.81 0.81
[2,] 0.18 0.18 0.18
[3,] 0.01 0.01 0.01
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.