merlinLod: Multipoint LOD scores by MERLIN

View source: R/merlinLod.R

merlinLodR Documentation

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

}


paramlink2 documentation built on Feb. 16, 2023, 6:05 p.m.