create_betas: Generate a beta vector

Description Usage Arguments Value Examples

View source: R/simulation_multi.R

Description

This functions simulate a beta vector with the variation of genetic effect being controlled in a pre-specified range. It takes maf vector of length P, range of desired variation due to genetic effect, and the range of the number of causal variants. The variation is calculated by

2 ∑_p β_p^2 f_p (1 - f_p)

where f_p is the allele frequency of variant p and β_p is the log aFC of variant p.

Usage

1
create_betas(maf, genetic_var, ncausal)

Arguments

maf

allele frequencies of the variants of interest

genetic_var

the range of variation due to genetic effect

ncausal

the range of the number of causal variants

Value

a vector of simulated beta vector

Examples

1
2
3
4
5
create_betas(
  maf = runif(100),
  genetic_var = c(0.015, 0.075),
  ncausal = c(1, 3)
)

liangyy/mixqtl documentation built on Sept. 17, 2020, 11:36 a.m.