dive_phe2effects: Wrapper to run mash given a phenotype data frame

Description Usage Arguments Value

View source: R/dive_phe2effects.R

Description

This function allows you to go from a phenotype data.frame of a few phenotypes you want to compare to filebacked matrix of univariate GWAS effects, standard errors, and -log10pvalues. This output object can be used in "dive_effects2mash" function. Some exception handling has been built into this function, but the user should stay cautious and skeptical of any results that seem 'too good to be true'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
dive_phe2effects(
  df,
  snp,
  type = "linear",
  svd = NULL,
  suffix = "",
  outputdir = ".",
  min.phe = 200,
  ncores = NA,
  save.plots = TRUE,
  thr.r2 = 0.2,
  roll.size = 50,
  verbose = TRUE
)

Arguments

df

Dataframe containing phenotypes for mash where the first column is 'sample.ID', which should match values in the snp$fam$sample.ID column.

snp

A "bigSNP" object; load with snp_attach().

type

Character string, or a character vector the length of the number of phenotypes. Type of univarate regression to run for GWAS. Options are "linear" or "logistic".

svd

A "big_SVD" object; Optional covariance matrix to use for population structure correction.

suffix

Optional character vector to give saved files a unique search string/name.

outputdir

Optional file path to save output files.

min.phe

Integer. Minimum number of individuals phenotyped in order to include that phenotype in GWAS. Default is 200. Use lower values with caution.

ncores

Optional integer to specify the number of cores to be used for parallelization. You can specify this with bigparallelr::nb_cores().

save.plots

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

thr.r2

Value between 0 and 1. Threshold of r2 measure of linkage disequilibrium. Markers in higher LD than this will be subset using clumping.

roll.size

Integer. Used to create the svd for GWAS.

verbose

Output some information on the iterations? Default is TRUE.

Value

A mash object made up of all phenotypes where univariate GWAS ran successfully.


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