commonfactorGWAS: Estimate SNP effects on a single common factor

View source: R/commonfactorGWAS.R

commonfactorGWASR Documentation

Estimate SNP effects on a single common factor

Description

Function to obtain SNP effects on common factor along with index of SNP heterogeneity

Usage

commonfactorGWAS(covstruc=NULL,SNPs=NULL,estimation="DWLS",cores=NULL,toler=FALSE,SNPSE=FALSE,parallel=TRUE,GC="standard",MPI=FALSE,TWAS=FALSE,smooth_check=FALSE, ...)

Arguments

covstruc

Output from Genomic SEM 'ldsc' function

SNPs

Summary statistics file created using the 'sumstats' function

estimation

The estimation method to be used when running the factor model. The options are Diagonally Weighted Least Squares ("DWLS", this is the default) or Maximum Likelihood ("ML")

cores

The number of cores to use on your computer for parallel processing. If no number is provided, the default is to use one less core then is available on your computer

toler

The tolerance to use for matrix inversion.

SNPSE

Whether the user wants to provide a different standard error (SE) of the SNP variance than the package default. The default is to use .0005 to reflect the fact that the SNP SE is assumed to be population fixed.

parallel

Whether the function should run using parallel or serial processing. Default = TRUE

GC

Level of Genomic Control (GC) you want the function to use. The default is 'standard' which adjusts the univariate GWAS standard errors by multiplying them by the square root of the univariate LDSC intercept. Additional options include 'conserv' which corrects standard errors using the univariate LDSC intercept, and 'none' which does not correct the standard errors.

MPI

Whether the function should use multi-node processing (i.e., MPI). Please note that this should only be used on a computing cluster on which the R package Rmpi is already installed.

TWAS

Whether the function is being used to estimate a multivariate TWAS using read_fusion output for the SNPs argument.

smooth_check

Whether the function should save the consequent largest Zstatistic difference between the pre and post-smooth matrices.

Value

The function outputs a series of SNP effects with their SEs and estimate of QSNP (the heterogeneity index). The output is a single object.


MichelNivard/GenomicSEM documentation built on June 15, 2024, 10:41 a.m.