Learn R Programming

paramlink (version 0.8-3)

likelihood: Pedigree likelihood

Description

Calculates various forms of pedigree likelihoods.

Usage

likelihood(x, ...)
## S3 method for class 'linkdat':
likelihood(x, locus1, locus2=NULL, theta=NULL, 
                    startdata=NULL, eliminate=0, logbase=NULL, ...)
## S3 method for class 'singleton':
likelihood(x, locus1, logbase=NULL, ...)
## S3 method for class 'list':
likelihood(x, locus1, ...)

likelihoodSNP(x, marker, theta=NULL, afreq=NULL, logbase=NULL, TR.MATR=NULL, 
              singleNum.geno=NULL)

Arguments

x
a linkdat object, a singleton object, or a list of such objects. In likelihoodSNP, x must be a linkdat object, with x$model different from NULL.
locus1
a marker object compatible with x. If x is a list, then locus1 must be a list of corresponding marker objects.
locus2
either NULL, the character "disease", or a marker object compatible with x. See Details.
theta
the recombination rate between locus1 and locus2 (in likelihoodSNP: between the marker and the disease locus). To make biological sense theta should be between 0 and 0.5.
eliminate
mostly for internal use: a non-negative integer indicating the number of iterations in the internal genotype-compatibility algorithm. Positive values can save time if partialmarker is non-empty and the number of alleles is large.
logbase
a numeric, or NULL. If numeric the loglikelihood is returned, with logbase as basis for the logarithm.
marker
an integer between 0 and x$nMark, indicating which marker to use in the calculation.
afreq
a numeric containing the marker allele frequencies.
startdata
for internal use.
TR.MATR
for internal use: an 10*10*10 array with haplotype transmission probabilities, for speedy computation with diallelic markers.
singleNum.geno
for internal use: a numeric vector containing SNP genotypes coded as a single integer: 00 -> 0, 11 -> 1, 22 -> 2, 12/21 -> 3, 01/10 -> 4, 02/20 -> 5. If this is non-NULL the marker argument is ignored.
...
further arguments. Not used.

Value

  • The likelihood of the data. If the parameter logbase is numeric, the output is log(likelihood, logbase).

Details

The likelihoods are calculated using the Elston-Stewart algorithm. If locus2 = NULL, the result is the likelihood of the genotypes observed at the marker in locus1. If locus2 = "disease", the result is the likelihood of the marker genotypes in locus1, given the affection statuses of the pedigree members, the disease model and the recombination rate theta between the marker and disease loci. (This computation is central in parametric linkage analysis.) If locus2 is a marker object, the result is the likelihood of the genotypes at the two markers, given the recombination rate theta between them. The function likelihoodSNP is a fast version of likelihood.linkdat in the case where locus2 = "disease" and the marker in locus1 is diallelic.

See Also

lod

Examples

Run this code
data(toyped)
x = linkdat(toyped, model=1) #dominant model

lod1 = likelihoodSNP(x, marker=1, theta=0, logbase=10) - 
       likelihoodSNP(x, marker=1, theta=0.5, logbase=10)
lod2 = lod(x, markers=1, theta=0)
# should be the same:
stopifnot(identical(lod1, as.numeric(lod2)), round(lod1, 2)==0.3)

Run the code above in your browser using DataLab