merlinLod: Multipoint LOD scores by MERLIN

Description Usage Arguments Details Value References See Also Examples

View source: R/merlinLod.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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:

1
_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

http://csg.sph.umich.edu/abecasis/Merlin/

See Also

lod()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#---------------------------------
# Requires MERLIN to be installed
#---------------------------------

if(pedprobr::checkMerlin()) {

# Pedigree with a single marker
x = nuclearPed(3, sex = c(1,2,2))
x = setMarkers(x, marker(x, 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 May 5, 2021, 1:08 a.m.