simLRR: Simulate LRR

View source: R/simLRR.R

simLRRR Documentation

Simulate LRR

Description

The ratio Z = LR(M,p)/LR(R,p) is simulated where M is a list of mutation matrices and R a reversed version. The alternative hypothesis is that all individuals are unrelated and so it does not matter if matrix M or R is used.

Usage

simLRR(
  M,
  R = NULL,
  markerNames,
  method = "PR",
  ped1 = nuclearPed(1),
  ids = c(1, 3),
  nsim = 2,
  seed = NULL
)

Arguments

M

List of mutation matrices, one for each marker.

R

List of reversed mutation matrices, one for each marker.

markerNames

Character vector, names of markers

method

Character, reversing method.

ped1

A ped object.

ids

A numeric with ID labels of one or more pedigree members.

nsim

Integer.

seed

Integer.

Details

If R == NULL, mutation matrices are reversed.

Value

LRR

Author(s)

Thore Egeland.

See Also

[findReversible()].

Examples

## Not run: 
library(pedmut)
library(pedtools)
p = c("1" = 0.1, "2" = 0.9)
M = list(mutationMatrix("equal", rate = 0.001, afreq = p),
         mutationMatrix("equal", rate = 0.001, afreq = p))
mN = c("L1", "L2")
markerNames = mN; method = "PR"; ped1 = nuclearPed(1); ids = c(1,3); nsim = 2; seed = 17
res = simLRR(M, markerNames = mN, nsim = 10, seed = 177)
res = simLRR(M[[1]], markerNames = mN[1], nsim = 2, seed = 177)
M = lapply(NorwegianFrequencies, function(x){
  mat = mutationMatrix("stequal",
  alleles = names(x),
  rate = 0.001,
  rate2 = 0,
  range = 0,
  afreq = x)
  mat
})
mN = names(NorwegianFrequencies)
simLRR(M, markerNames = mN, nsim = 10, seed = 177)

## End(Not run)

thoree/mut2 documentation built on June 11, 2025, 4:02 p.m.