simulateConfInt: Simulation of delta SPP index confidence intervals

Description Usage Arguments Value Examples

View source: R/takagi_sim.R

Description

The method for simulating delta SNP-index confidence interval thresholds as described in Takagi et al., (2013). Genotypes are randomly assigned for each indvidual in the bulk, based on the population structure. The total alternative allele frequency in each bulk is calculated at each depth used to simulate delta SNP-indeces, with a user defined number of bootstrapped replication. The requested confidence intervals are then calculated from the bootstraps.

Usage

1
2
simulateConfInt(popStruc = "F2", bulkSize, depth = 1:100,
  replications = 10000, filter = 0.3, intervals = c(0.05, 0.025))

Arguments

popStruc

the population structure. Defaults to "F2" and assumes "RIL"

bulkSize

non-negative integer vector. The number of individuals in each simulated bulk. Can be of length 1, then both bulks are set to the same size. Assumes the first value in the vector is the simulated high bulk.

depth

integer. A read depth for which to replicate SNP-index calls.

replications

integer. The number of bootstrap replications.

filter

numeric. An optional minimum SNP-index filter

intervals

numeric vector of probabilities with values in [0,1] corresponding to the requested confidence intervals

Value

A data frame of delta SNP-index thresholds corrisponding to the requested confidence intervals at the user set depths.

Examples

1
2
3
4
5
6
CI <-
simulateConfInt(
   popStruc = "F2",
   bulkSize = 50,
   depth = 1:100,
   intervals = c(0.05, 0.95, 0.025, 0.975, 0.005, 0.995, 0.0025, 0.9975)

bmansfeld/QTLseqR documentation built on Jan. 25, 2020, 8:52 p.m.