cdbn_standard_gwas: Wrapper for my standard GWAS functions for the CDBN.

Description Usage Arguments Value Examples

View source: R/cdbn_kinship.R

Description

This is a wrapper to make my standard GWAS simpler to execute.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
cdbn_standard_gwas(
  snp,
  df = CDBNgenomics::BLUPs[, c(1, 10, 15, 28)],
  type = c("linear", "logistic"),
  ncores = nb_cores(),
  outputdir = ".",
  covar = NULL,
  lambdagc = TRUE,
  savegwas = FALSE,
  saveplots = TRUE,
  saveannos = FALSE,
  txdb = NULL,
  minphe = 200,
  ...
)

Arguments

snp

A "bigSNP" object; load with bigsnpr::snp_attach(). Here, genomic information for Phaseolus vulgaris from the Common Dry Bean Nursery.

df

Dataframe of phenotypes where the first column is Taxa.

type

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

ncores

Number of cores to use. Default detects this with 'nb_cores()'.

outputdir

String or file.path() to the output directory. Default is the working directory.

covar

Optional covariance matrix to include in the regression. You can generate these using get_SVD().

lambdagc

Default is TRUE - should lambda_GC be used to find the best population structure correction? Alternatively, you can provide a data frame containing "NumPCs" and the phenotype names containing lambda_GC values. This is saved to the output directory by cdbn_standard_gwas and otherwise found from a GWAS result using 'bigsnpr:::getLambdaGC()'.

savegwas

Logical. Should the gwas output be saved as a rds to the working directory? These files are typically quite large. Default is FALSE.

saveplots

Logical. Should Manhattan and QQ-plots be generated and saved to the working directory? Default is TRUE.

saveannos

Logical. Should annotation tables for top SNPs be generated and saved to the working directory? Default is FALSE. Can take additional arguments; requires a txdb.sqlite object used in AnnotationDbi.

txdb

A txdb object such as 'Pvulgaris_442_v2.1.gene.sqlite'. Load this into your environment with AnnotationDbi::loadDb.

minphe

Integer. What's the minimum number of phenotyped individuals to conduct a GWAS on? Default is 200. Use lower values with caution.

...

Other arguments to get_lambda_GC or get_annotations.

Value

A big_SVD object.

Examples

1
2
3
4
5
6
## Not run: 
cdbn_standard_gwas(snp, df = phenotypes, type = "linear", covar = svd,
    ncores = nb_cores(), lambdagc = TRUE, savegwas = TRUE, saveplots = TRUE,
    saveannos = TRUE, txdb = txdb)

## End(Not run)

Alice-MacQueen/CDBNgenomics documentation built on Aug. 18, 2020, 4:39 p.m.