generate_gwas_ss: Modify SNP effects to account for LD

View source: R/theoretical_gwas.R

generate_gwas_ssR Documentation

Modify SNP effects to account for LD

Description

After generating the set of causal effects at each SNP, use an LD correlation matrix to transform the effects to reflect the correlation structure at the SNPs. Note if running many repeats, only need to generate the LD-modified params once and then can repeatedly re-sample using generate_gwas_ss

Usage

generate_gwas_ss(
  params,
  nid,
  vy = 1,
  minmaf = 0.001,
  ld = NULL,
  ldobj = NULL,
  ldobjlist = NULL,
  ldobjfiles = NULL,
  ldobjdir = NULL,
  gwasglue2 = FALSE,
  nthreads = 1
)

Arguments

params

Output from generate_gwas_params

nid

sample size

vy

Variance of trait

minmaf

minimum allowed maf. default=0.01 to prevent instability

ld

LD correlation matrix. Must be same dimension as params

ldobj

LD objects (e.g. see test_ldobj)

ldobjlist

List of LD objects

ldobjfiles

Array of filenames containing LD object files (e.g. see generate_ldobj)

ldobjdir

Directory containing output from generate_ldobj

gwasglue2

Logical, creates a gwasglue2 SummarySet when @param ldobj is not NULL (default FALSE).

nthreads

Number of threads (can be slow for complete GWAS and large LD regions)

Value

Updated params


explodecomputer/simulateGP documentation built on April 3, 2024, 2:38 a.m.