Title: | Parametric Linkage Analysis |
---|---|
Description: | Parametric linkage analysis of monogenic traits in medical pedigrees. Features include singlepoint analysis, multipoint analysis via 'MERLIN' (Abecasis et al. (2002) <doi:10.1038/ng786>), visualisation of log of the odds (LOD) scores and summaries of linkage peaks. Disease models may be specified to accommodate phenocopies, reduced penetrance and liability classes. 'paramlink2' is part of the 'pedsuite' package ecosystem, presented in 'Pedigree Analysis in R' (Vigeland, 2021, ISBN:9780128244302). |
Authors: | Magnus Dehli Vigeland [aut, cre]
|
Maintainer: | Magnus Dehli Vigeland <[email protected]> |
License: | GPL-3 |
Version: | 1.0.6 |
Built: | 2025-02-04 04:55:07 UTC |
Source: | https://github.com/magnusdv/paramlink2 |
Create a disease model in form of a disModel
object, for use in e.g.
lod()
.
diseaseModel(model = NULL, chrom = NULL, penetrances = NULL, dfreq = NULL)
diseaseModel(model = NULL, chrom = NULL, penetrances = NULL, dfreq = NULL)
model |
An existing
In all of the above, the disease is assumed to be fully penetrant, and with a disease allele frequency of 1e-5. |
chrom |
Either "AUTOSOMAL" or "X". Lower case versions are allowed and will be converted automatically. |
penetrances |
For autosomal models, a numeric of length 3 corresponding
to For X-linked models, a list of two vectors named |
dfreq |
A number in |
An object of class disModel
, which is a list with entries chrom
,
penetrances
and dfreq
.
# Fully penetrant AD model: m1 = diseaseModel(model = "AD") # The above is equivalent to m2 = diseaseModel(chrom = "Aut", penetrances = c(0,1,1), dfreq = 1e-5) stopifnot(identical(m1, m2)) # X-linked recessive model: m3 = diseaseModel(model = "XR", dfreq = 0.01) # Long version of the above: m4 = diseaseModel(chrom = "X", penetrances = list(male = c(0,1), female = c(0,0,1)), dfreq = 0.01) stopifnot(identical(m3, m4))
# Fully penetrant AD model: m1 = diseaseModel(model = "AD") # The above is equivalent to m2 = diseaseModel(chrom = "Aut", penetrances = c(0,1,1), dfreq = 1e-5) stopifnot(identical(m1, m2)) # X-linked recessive model: m3 = diseaseModel(model = "XR", dfreq = 0.01) # Long version of the above: m4 = diseaseModel(chrom = "X", penetrances = list(male = c(0,1), female = c(0,0,1)), dfreq = 0.01) stopifnot(identical(m3, m4))
A dataset with SNP genotypes for 14 members of a pedigree affected with a dominant disorder.
dominant1
dominant1
A list with 3 elements:
ped
: A pedtools::ped object describing a pedigree with 19 individuals,
including genotypes for 14 members at 248 markers on Chromosome 1.
aff
: A vector indicating the affected pedigree members.
map
: A data frame with 3 columns (chrom
, marker
, cm
) describing the
centiMorgan positions of the markers.
data(dominant1) ped = dominant1$ped aff = dominant1$aff model = diseaseModel("AD") # Compute singlepoint LODs lods = lod(ped, aff = aff, model = model) # LOD score graph plot(lods)
data(dominant1) ped = dominant1$ped aff = dominant1$aff model = diseaseModel("AD") # Compute singlepoint LODs lods = lod(ped, aff = aff, model = model) # LOD score graph plot(lods)
Functions for printing, summarizing and plotting the results of a linkage analysis.
## S3 method for class 'linkres' print(x, ...) ## S3 method for class 'linkres' summary(object, ...) ## S3 method for class 'linkres' plot( x, chrom = NULL, type = "l", lwd = NA, ylim = NULL, xlab = NULL, ylab = NULL, ... ) ## S3 method for class 'linkres' points(x, chrom = NULL, type = "l", lwd = NA, ...)
## S3 method for class 'linkres' print(x, ...) ## S3 method for class 'linkres' summary(object, ...) ## S3 method for class 'linkres' plot( x, chrom = NULL, type = "l", lwd = NA, ylim = NULL, xlab = NULL, ylab = NULL, ... ) ## S3 method for class 'linkres' points(x, chrom = NULL, type = "l", lwd = NA, ...)
x , object
|
A |
... |
further arguments. |
chrom |
(Optional) A numeric indicating which chromosomes to be included in the plot. |
lwd , type , ylim
|
Graphical parameters passed on to |
xlab , ylab
|
Axis labels. |
These functions are called for their side effects.
lod()
, merlinLod()
, lodPeaks()
# Pedigree with 5 simulated SNP markers x = nuclearPed(3) x = setMarkers(x, alleleMatrix = cbind( m1 = c("1/1", "1/2", "1/2", "1/2", "1/2"), m2 = c("1/2", "1/2", "1/2", "1/2", "1/2"), m3 = c("1/1", "1/2", "1/2", "1/2", "1/1")), sep="/") # Mother and all children affected aff = c(1, 2, 2, 2, 2) # LOD scores under autosomal dominant model lods = lod(x, aff, model = diseaseModel(model = "AD")) summary(lods) as.data.frame(lods) plot(lods)
# Pedigree with 5 simulated SNP markers x = nuclearPed(3) x = setMarkers(x, alleleMatrix = cbind( m1 = c("1/1", "1/2", "1/2", "1/2", "1/2"), m2 = c("1/2", "1/2", "1/2", "1/2", "1/2"), m3 = c("1/1", "1/2", "1/2", "1/2", "1/1")), sep="/") # Mother and all children affected aff = c(1, 2, 2, 2, 2) # LOD scores under autosomal dominant model lods = lod(x, aff, model = diseaseModel(model = "AD")) summary(lods) as.data.frame(lods) plot(lods)
Calculates the singlepoint log of the odds (LOD) scores of a pedigree for the specified markers, assuming a fixed recombination rate between the disease and each marker locus.
lod( x, aff, model, rho = 0, liability = NULL, markers = NULL, maxOnly = NA, loopBreakers = NULL, peelOrder = NULL, verbose = FALSE )
lod( x, aff, model, rho = 0, liability = NULL, markers = NULL, maxOnly = NA, loopBreakers = NULL, peelOrder = NULL, verbose = FALSE )
x |
A |
aff |
A vector naming the affected pedigree members, or a numeric vector
of length |
model |
A |
rho |
A number between 0 and 0.5 (inclusive); the hypothesised recombination ratio between the marker and the disease locus. |
liability |
NULL (default) or a vector of length |
markers |
A vector of marker names or indices referring to markers
attached to |
maxOnly |
a logical indicating whether only the maximum LOD score should be returned. By default this is always done if the number of markers is 1. |
loopBreakers |
A vector of ID labels indicating loop breakers. (Only relevant for inbred pedigrees.) |
peelOrder |
For internal use. |
verbose |
a logical: verbose output or not. |
The LOD score of a marker is defined as
where the
logarithms are base 10, and denotes the likelihood of the
observed marker genotypes given a recombination ratio
between the
marker and the disease locus.
The likelihoods are computed with the pedprobr package.
If the number of markers is 1, or if maxOnly = TRUE
, a single
number is returned.
Otherwise a linkres
object, which is basically a data frame with columns
CHROM
, MARKER
, MB
and LOD
.
Magnus Dehli Vigeland
linkres, merlinLod()
, diseaseModel()
, lodPeaks()
x = nuclearPed(2) |> addMarker(geno = c("1/2", "1/1", "1/2", "1/2")) aff = c(2,1,2,2) model = diseaseModel(model = "AD") lod(x, aff, model)
x = nuclearPed(2) |> addMarker(geno = c("1/2", "1/1", "1/2", "1/2")) aff = c(2,1,2,2) model = diseaseModel(model = "AD") lod(x, aff, model)
Identify and summarise LOD score peaks.
lodPeaks(x, threshold, width = 1) peakSummary(x, threshold, width = 1, physmap = NULL)
lodPeaks(x, threshold, width = 1) peakSummary(x, threshold, width = 1, physmap = NULL)
x |
A linkres object, or data frame with columns |
threshold |
A single number |
width |
A positive integer |
physmap |
A matrix or data frame with three columns: Marker name, chromosome and physical position. |
A peak is defined as a run of at least width
consecutive markers with LOD
score above or equal to threshold
. If possible, one flanking marker is
included on each side of the peak.
A list of data frames.
# Use built-in dataset `dominant1` lods = lod(x = dominant1$ped, aff = dominant1$aff, model = diseaseModel("AD")) # All peaks above LOD = 1.5 lodPeaks(lods, threshold = 1.5) peakSummary(lods, threshold = 1.5)
# Use built-in dataset `dominant1` lods = lod(x = dominant1$ped, aff = dominant1$aff, model = diseaseModel("AD")) # All peaks above LOD = 1.5 lodPeaks(lods, threshold = 1.5) peakSummary(lods, threshold = 1.5)
This function is a wrapper for the parametric linkage functionality of the MERLIN software. For this to work, MERLIN must be installed and correctly pointed to in the PATH environment variable.
merlinLod( x, aff, model, map = NULL, markers = NULL, rho = 0, liability = NULL, maxOnly = NA, options = "", dir = tempdir(), cleanup = TRUE, verbose = FALSE, ... )
merlinLod( x, aff, model, map = NULL, markers = NULL, rho = 0, liability = NULL, maxOnly = NA, options = "", dir = tempdir(), cleanup = TRUE, verbose = FALSE, ... )
x |
A |
aff |
A vector naming the affected pedigree members, or a numeric vector
of length |
model |
A |
map |
A data frame with columns according to MERLIN format for map files. |
markers |
A vector of marker names or indices referring to markers
attached to |
rho |
A numeric with values between 0 and 0.5: The recombination
value(s) for which the LOD score is computed. The value of Note: This parameter only works when |
liability |
NULL (default) or a vector of length |
maxOnly |
a logical indicating whether only the maximum LOD score should be returned. By default this is always done if the number of markers is 1. |
options |
A character with additional options to the MERLIN command. |
dir |
Path to a directory where the MERLIN input files should be created. |
cleanup |
A logical indicating if MERLIN files should be removed after use. Default: TRUE. |
verbose |
a logical: verbose output or not. |
... |
Further arguments passed on to |
By default the following MERLIN command is run (via a call to system()
)
after creating appropriate files in a temporary (or user specified) directory:
_merlin.freq --model _merlin.model --tabulate --markerNames --quiet
The resulting multipoint LOD scores are extracted from the output and returned in R as a linkres object.
If the number of markers is 1, or if maxOnly = TRUE
, a single
number is returned.
Otherwise a linkres
object similar to the output of lod()
, but with an
additional column CM
.
https://csg.sph.umich.edu/abecasis/merlin/
#--------------------------------- # Requires MERLIN to be installed #--------------------------------- if(pedprobr::checkMerlin()) { # Pedigree with a single marker x = nuclearPed(3, sex = c(1,2,2)) |> addMarker(geno = c("1/1", "1/2", "1/2", "1/2", "1/2")) # Simple AD model merlinLod(x, aff = 2:5, model = diseaseModel("AD")) # With liability classes mod = diseaseModel("AD", penetrances = cbind(f0 = 0, f1 = 1:0, f2 = 1:0)) merlinLod(x, aff = 2:4, mod, liability = c(1,1,1,1,2)) # X merlinLod(x, aff = 3:5, model = diseaseModel("XR")) }
#--------------------------------- # Requires MERLIN to be installed #--------------------------------- if(pedprobr::checkMerlin()) { # Pedigree with a single marker x = nuclearPed(3, sex = c(1,2,2)) |> addMarker(geno = c("1/1", "1/2", "1/2", "1/2", "1/2")) # Simple AD model merlinLod(x, aff = 2:5, model = diseaseModel("AD")) # With liability classes mod = diseaseModel("AD", penetrances = cbind(f0 = 0, f1 = 1:0, f2 = 1:0)) merlinLod(x, aff = 2:4, mod, liability = c(1,1,1,1,2)) # X merlinLod(x, aff = 3:5, model = diseaseModel("XR")) }