Package 'paramlink2'

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: 2024-09-07 14:13:43 UTC
Source: https://github.com/magnusdv/paramlink2

Help Index


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 disModel object (to be modified by other arguments), or one of the following two-letter keywords:

  • AD = autosomal dominant

  • AR = autosomal recessive

  • XD = X-linked dominant

  • XR = X-linked recessive

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 ⁠(f0, f1, f2)⁠, where fi is the probability of being affected given i disease alleles. It can also be a matrix with 3 columns, in which case each row represents a liability class.

For X-linked models, a list of two vectors named male and female, of lengths 2 and 3 respectively: ⁠(f0, f1)⁠ for males and ⁠(f0, f1, f2)⁠ for females. Alternatively, each list entry may be a matrix or data frame (with the same number of columns) where each row represents a liability class.

dfreq

A number in ⁠[0,1]⁠: The population frequency of the disease allele.

Value

An object of class disModel, which is a list with entries chrom, penetrances and dfreq.

See Also

lod()

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 linkres object (normally produced by lod() or merlinLod()).

...

further arguments.

chrom

(Optional) A numeric indicating which chromosomes to be included in the plot.

lwd, type, ylim

Graphical parameters passed on to plot().

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 ped object.

aff

A vector naming the affected pedigree members, or a numeric vector of length pedsize(x) with affection statuses for all pedigree members (2 = affected; 1 = unaffected; 0 = unknown). Alternatively, aff can be a list of vectors, named affected, unaffected and unknown. It suffices to give (any) two of these vectors.

model

A disModel object, typically created with diseaseModel().

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 pedsize(x) indicating the liability class (a row number of model$penetrances) of each individual.

markers

A vector of marker names or indices referring to markers attached to x. By default all markers are included.

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(ρ)=logL(ρ)L(0.5)LOD(\rho) = \log \frac{L(\rho)}{L(0.5)}

where the logarithms are base 10, and L(ρ)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 CHROM, MB, LOD.

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

linkres, lod(), merlinLod()

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 ped object.

aff

A vector naming the affected pedigree members, or a numeric vector of length pedsize(x) with affection statuses for all pedigree members (2 = affected; 1 = unaffected; 0 = unknown). Alternatively, aff can be a list of vectors, named affected, unaffected and unknown. It suffices to give (any) two of these vectors.

model

A disModel object, typically created with diseaseModel().

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 x. By default all markers are included.

rho

A numeric with values between 0 and 0.5: The recombination value(s) for which the LOD score is computed. The value of rho is converted to centiMorgans using Haldane's map function and included in the MERLIN command using the --position parameter.

Note: This parameter only works when markers has length 1.

liability

NULL (default) or a vector of length pedsize(x) indicating the liability class (a row number of model$penetrances) of each individual.

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 pedprobr::merlin(). In particular, merlinpath should be supplied if the merlin executables are not on the system's search path.

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

lod()

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"))

}