ki.precompute: Pre-computes KIs for use with 'ki.db' function

Description Usage Arguments Details Value See Also Examples

Description

Pre-computes KIs for use with ki.db function

Usage

1
ki.precompute(type, freqs, markers = names(freqs), theta = 0)

Arguments

type

A character string giving the type of KI. See ibdprobs.

freqs

A list specifying the allelic frequencies. Should contain a vector of allelic frequencies for each locus, named after that locus.

markers

Character vector stating the markers to use in the KI computation. Defaults to all markers contained in freqs.

theta

numeric value specifying the amount of background relatedness.

Details

In large scale simulation studies, it is sometimes useful to precompute KIs to speedup computations.

Value

list A list of numeric vectors containing the KIs for all genotypic combinations at each locus.

See Also

ki.db

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
data(freqsNLngm);
n <- 1e6

targets <- sample.profiles(N = 1e2,freqs = freqsNLngm)
db <- sample.profiles(N = 1e5,freqs = freqsNLngm)

precomp <- ki.precompute(type = "FS",freqs = freqsNLngm)

R1 <- ki.db(x = targets,db = db,hyp.1 = "FS")
R2 <- ki.db(x = targets,db = db,precomputed.kis = precomp) # a little faster

all.equal(R1,R2)


## End(Not run)


Search within the DNAprofiles package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.