trans_phased {clipp} | R Documentation |
The transmission matrix for phased genotypes
Description
A function to calculate the transmission matrix for a single autosomal genetic locus with an arbitrary number of alleles and phased genotypes, based on Mendel's laws of inheritance. Phased genotypes can be used to investigate parent-of-origin effects, e.g. see (van Vliet et al., 2011).
Usage
trans_phased(n_alleles, annotate = FALSE)
Arguments
n_alleles |
A positive integer, interpreted as the number of possible alleles at the genetic locus. |
annotate |
A logical flag. When |
Details
When annotate
is FALSE
, a matrix of genetic transmission
probabilities is returned, with rows corresponding to the possible joint
parental genotypes and columns corresponding to the possible offspring
genotypes.
There are ngeno = n_alleles^2
possible phased genotypes,
and by choosing an order on these genotypes (which can be
viewed by setting annotate
to TRUE
, see below)
we can label the set of possible phased genotypes as 1:ngeno
.
Then the (ngeno * gm + gf - ngeno, go)
th element of the outputted matrix is
the conditional probability that a person has genotype go
, given that his
or her biological mother and father have genotypes gm
and gf
,
respectively.
When annotate
is TRUE
, the function converts this matrix to a data frame,
adds column names giving the offspring genotype corresponding to each
column, and adds columns gm
and gf
describing the parental genotypes
corresponding to each row.
In this data frame, phased genotypes are written in the usual form
1|1, 1|2, ...
for the alleles 1:n_alleles
, where a|b
means the
maternal allele is a
and the paternal allele is b
.
Note that if the output of this function is to be used as the trans
argument of pedigree_loglikelihood
then the annotate
option
must be set to FALSE
.
Value
Either a matrix of genetic transmission probabilities suitable to be
used as the trans
argument of pedigree_loglikelihood
(if annotate
is FALSE
), or a data frame that is an annotated version of
this matrix (if annotate
is TRUE
).
References
van Vliet CM, Dowty JG, van Vliet JL, et al. Dependence of colorectal cancer risk on the parent-of-origin of mutations in DNA mismatch repair genes. Hum Mutat. 2011;32(2):207-212.
Examples
# The transition matrix for a biallelic, autosomal locus with phased genotypes
trans_phased(2)
trans_phased(2, annotate = TRUE)