Type: | Package |
Title: | Parametric Linkage Analysis |
Version: | 1.0.6 |
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). |
License: | GPL-3 |
URL: | https://github.com/magnusdv/paramlink2 |
BugReports: | https://github.com/magnusdv/paramlink2/issues |
Depends: | R (≥ 4.1), pedtools |
Imports: | pedprobr |
Suggests: | spelling, testthat |
Encoding: | UTF-8 |
Language: | en-GB |
LazyData: | true |
RoxygenNote: | 7.3.2 |
SystemRequirements: | MERLIN (https://csg.sph.umich.edu/abecasis/merlin/) for multipoint linkage analysis. |
NeedsCompilation: | no |
Packaged: | 2024-09-07 13:29:02 UTC; magnu |
Author: | Magnus Dehli Vigeland
|
Maintainer: | Magnus Dehli Vigeland <m.d.vigeland@medisin.uio.no> |
Repository: | CRAN |
Date/Publication: | 2024-09-07 13:50:02 UTC |
paramlink2: 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).
Author(s)
Maintainer: Magnus Dehli Vigeland m.d.vigeland@medisin.uio.no (ORCID)
See Also
Useful links:
Disease models for linkage analysis
Description
Create a disease model in form of a disModel
object, for use in e.g.
lod()
.
Usage
diseaseModel(model = NULL, chrom = NULL, penetrances = NULL, dfreq = NULL)
Arguments
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 |
Value
An object of class disModel
, which is a list with entries chrom
,
penetrances
and dfreq
.
See Also
Examples
# 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))
Dominant linkage analysis example
Description
A dataset with SNP genotypes for 14 members of a pedigree affected with a dominant disorder.
Usage
dominant1
Format
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.
Examples
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)
S3 methods for class 'linkres'.
Description
Functions for printing, summarizing and plotting the results of a linkage analysis.
Usage
## 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, ...)
Arguments
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. |
Value
These functions are called for their side effects.
See Also
lod()
, merlinLod()
, lodPeaks()
Examples
# 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)
Singlepoint LOD score
Description
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.
Usage
lod(
x,
aff,
model,
rho = 0,
liability = NULL,
markers = NULL,
maxOnly = NA,
loopBreakers = NULL,
peelOrder = NULL,
verbose = FALSE
)
Arguments
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. |
Details
The LOD score of a marker is defined as
LOD(\rho) = \log
\frac{L(\rho)}{L(0.5)}
where the
logarithms are base 10, and L(\rho)
denotes the likelihood of the
observed marker genotypes given a recombination ratio \rho
between the
marker and the disease locus.
The likelihoods are computed with the pedprobr package.
Value
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
.
Author(s)
Magnus Dehli Vigeland
See Also
linkres, merlinLod()
, diseaseModel()
, lodPeaks()
Examples
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)
LOD score peaks
Description
Identify and summarise LOD score peaks.
Usage
lodPeaks(x, threshold, width = 1)
peakSummary(x, threshold, width = 1, physmap = NULL)
Arguments
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. |
Details
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.
Value
A list of data frames.
See Also
Examples
# 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)
Multipoint LOD scores by MERLIN
Description
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.
Usage
merlinLod(
x,
aff,
model,
map = NULL,
markers = NULL,
rho = 0,
liability = NULL,
maxOnly = NA,
options = "",
dir = tempdir(),
cleanup = TRUE,
verbose = FALSE,
...
)
Arguments
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 |
Details
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.
Value
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
.
References
https://csg.sph.umich.edu/abecasis/merlin/
See Also
Examples
#---------------------------------
# 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"))
}