get_effects: Get weights for markers using beta distribution.

Description Usage Arguments Value Author(s)

View source: R/get_effects.R

Description

Given a vector of minor-allele frequencies (maf) for a number of markers and a number of markers to assign an effect to, the function randomly selects N markers below or above provided maf threshold (default 1 from Beta distribution with given parameters so that the magnitude of the effect depends on the allele frequency. Desired fraction of the effects will be negative. Monomorphic markers with 'maf = 0' will be automatically excluded from sampling!

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
get_effects(
  maf,
  N,
  get_betas_fun = dbeta,
  get_betas_args = list(shape1 = 1, shape2 = 25),
  thr = 0.01,
  rare = T,
  frac_negative = 0,
  seed = F
)

Arguments

maf

- vector of minor-allele frequencies

N

- number of markers to be assigned an effect

get_betas_fun

- name of a function for getting Beta parameters given a vector x of MAFs.

get_betas_args

- a list with additional function parameters for the function defined in 'get_betas'

thr

- threshold for maf. All markers with maf <= thr will be treated as rare.

rare

- a boolean, if TRUE, markers below and equal to the 'thr' will be sampled, i.e. the rare variants

frac_negative

- fraction of effects to be set to negative

seed

- set seed for sampling, if FALSE, default 'sample' seed will be used

Value

a list with two elements: 'marker_idx' is a vector of indices of the markers assigned an effect and 'effects' is a vector of effects, one for each marker

Author(s)

Marcin Kierczak <marcin.kierczak_NO_SPAM_scilifelab.se>


NBISweden/a_johansson_2020 documentation built on April 18, 2021, 1:09 a.m.