div_lambda_GC: Return lambda_GC for different numbers of PCs for GWAS on...

Description Usage Arguments Value

View source: R/wrapper.R

Description

Given a dataframe of phenotypes associated with sample.IDs and output from a PCA to control for population structure, this function will return a .csv file of the lambda_GC values for the GWAS upon inclusion of different numbers of PCs. This allows the user to choose a number of PCs that returns a lambda_GC close to 1, and thus ensure that they have done adequate correction for population structure.

Usage

1
2
3
4
5
6
7
8
9
div_lambda_GC(
  df,
  type = c("linear", "logistic"),
  snp,
  svd = NA,
  ncores = 1,
  npcs = c(0:10),
  saveoutput = FALSE
)

Arguments

df

Dataframe of phenotypes where the first column is sample.ID and each sample.ID occurs only once in the dataframe.

type

Character string. Type of univarate regression to run for GWAS. Options are "linear" or "logistic".

snp

A bigSNP object with sample.IDs that match the df.

svd

big_SVD object; Covariance matrix to include in the regression. Generate these using bigsnpr::snp_autoSVD().

ncores

Number of cores to use. Default is one.

npcs

Integer vector of principle components to use. Defaults to c(0:10).

saveoutput

Logical. Should output be saved as a csv to the working directory?

Value

A dataframe containing the lambda_GC values for each number of PCs specified. This is also saved as a .csv file in the working directory.


Alice-MacQueen/snpdiver documentation built on Dec. 17, 2021, 8:41 a.m.