Learn R Programming

paramlink (version 1.1-0)

lod: Two-point LOD score

Description

Calculates the two-point LOD scores of a pedigree for the specified markers. The recombination ratio between the disease and marker loci can be either fixed at specific values, or optimized.

Usage

lod(x, markers=seq_len(x$nMark), theta=0, loop_breakers=NULL, 
    max.only=FALSE, verbose=FALSE, tol=0.01)

Arguments

x

a linkdat object.

markers

an integer vector denoting which markers to use.

theta

either a numeric containing specific recombination ratio(s), or the word "max", indicating that the recombination ratio should be optimized by the program.

loop_breakers

a numeric containing IDs of individuals to be used as loop breakers. Relevant only if the pedigree has loops. See breakLoops.

max.only

a logical indicating whether only the maximum LOD score should be returned.

verbose

a logical: verbose output or not.

tol

a numeric passed on to optimize as its tolerance parameter.

Value

If max.only=FALSE, a linkres object, essentially a matrix containing the LOD scores. If theta is numeric, the matrix has dimensions length(theta), length(markers), and the entry in row t_0, column m_0 is the lod score of the pedigree for marker m_0 assuming a recombination rate of t_0.

If theta="max", the linkres matrix has one column per marker and two rows: The first containing the LOD score and the second the optimal recombination ratio for each marker.

If a marker has incompatible values (i.e. if a child of homozygous 1/1 parents has a 2 allele), the corresponding matrix entries are NaN.

If max.only=TRUE, only the highest LOD score is returned, as a numeric of length 1.

Details

The LOD score is defined as LOD(theta) = log10(L(theta)) - log10(L(theta=0.5)), where L(theta) denotes the likelihood of the observed pedigree data as a function of the recombination ratio theta between the marker and the disease locus.

See Also

likelihood, optimize, breakLoops

Examples

Run this code
# NOT RUN {
x = linkdat(toyped, model=1)
res = lod(x)
res_theta = lod(x, theta=c(0, 0.1, 0.2, 0.5))
res_max = lod(x, theta="max")
stopifnot(all(0.3 == round(c(res, res_theta['0',], res_max['LOD',]), 1)))

# bigger pedigree with several markers
y = linkdat(dominant)
y = setModel(y, model=1, penetrances=c(.001, .9, .99))
lod(y, markers=305:310)
lod(y, markers=305:310, theta="max")

# Example with pedigree with loops:
z = linkdat(twoloops, model=2) # fully penetrant autosomal recessive model.

# add SNP for which individuals 15 and 16 are homozygous for the rare allele.
m = marker(z, 15:16, c(1,1), alleles=1:2, afreq=c(0.001, 0.999))
z = addMarker(z, m)
res1 = lod(z)
# manual specification of loop breakers gives same result
res2 = lod(z, loop_breakers=c(8,12))

# making the marker triallelic and adding some genotypes.
z = modifyMarker(z, marker=1, ids=c(7,9,11,13), genotype=3, alleles=1:3, afreq=c(0.001, 0.499, 0.5))
plot(z, 1)
res3 = lod(z)

z = modifyMarker(z, marker=1, alleles=1:4, afreq=c(0.001, 0.499, 0.25, 0.25)) 
res4 = lod(z)

stopifnot(all(3 == round(c(res1, res2, res3, res4), 1)))
# }

Run the code above in your browser using DataLab