Skip to contents

This function is a wrapper around S-MultiXcan, a tool for identifying genes associate with a trait using GWAS summary statistics. This approach leverages the sharing of eQTLs acorss tissues to improve upon tissue-specific TWAS-methods like S-PrediXcan. This method uses data generated by s_predixcan(). The S-MultiXcan method was described in Barbeira et al. (PLOS Genetics 2019; https://doi.org/10.1371/journal.pgen.1007889). The MetaXcan tools can be found on Github (https://github.com/hakyimlab/MetaXcan) and PredictDB (https://predictdb.org/).

Usage

s_multixcan(
  df,
  models_folder,
  models_name_filter = ".*db",
  models_name_pattern,
  snp = SNP,
  effect_allele = effect_allele,
  other_allele = other_allele,
  beta = beta,
  eaf = eaf,
  chr = chr,
  pos = pos,
  se = se,
  pval = pval,
  samplesize = samplesize,
  regularization = 0.01,
  cutoff_condition_number = 30,
  cutoff_eigen_ratio = 0.001,
  cutoff_threshold = 0.4,
  cutoff_trace_ratio = 0.01,
  metaxcan_folder,
  metaxcan_filter,
  metaxcan_file_name_parse_pattern,
  snp_covariance,
  metaxcan,
  data
)

Arguments

df

Dataframe containing GWAS summary statistics

models_folder

Path to folder containing MetaXcan models (eg. "MetaXcan/data/models/eqtl/mashr/")

models_name_filter

Filter used to identify model files (default = ".*\\.db")

models_name_pattern

Filter used to extract trait name from the model (default = "mashr_(.*)\\.db")

snp

Column containing rsids

effect_allele

Column containing effect alleles

other_allele

Column containing non-effect alleles

beta

Column containing effect estimates

eaf

Column containing effect allele frequencies

chr

Column containing chromosomes

pos

Column containing positions

se

Column containing standard errors

pval

Column containing p-values

samplesize

Column containing samplesize

regularization

MetaXcan regularization (default = 0.01)

cutoff_condition_number

Numer of eigen values to use when truncating SVD components (default = 30)

cutoff_eigen_ratio

Ratio of eigenvalues to the max eigenvalue, as threshold to use when truncating SVD components. (default = 0.001)

cutoff_threshold

Threshold of variance eigenvalues when truncating SVD (default = 0.4)

cutoff_trace_ratio

Ratio of eigenvalues to trace, to use when truncating SVD (default = 0.01)

metaxcan_folder

Path to folder containing S-PrediXcan result files

metaxcan_filter

Regular expression to filter results files

metaxcan_file_name_parse_pattern

Regular expression to get phenotype name and model name from MetaXcan result files. Assumes that a first group will be matched to phenotype name, and the second to model name.

snp_covariance

Path to file containing S-MultiXcan covariance (eg. "MetaXcan/data/models/gtex_v8_expression_mashr_snp_smultixcan_covariance.txt.gz")

metaxcan

Path to MetaXcan (eg. "MetaXcan/software")

data

Path to MetaXcan data (eg. "MetaXcan/data")

Value

A dataframe containing S-MultiXcan results

See also

Other TWAS: s_predixcan()

Other Gene-based testing: magmar(), s_predixcan()

Examples

if (FALSE) {
s_multixcan(df,
  models_folder = "MetaXcan/data/models/eqtl/mashr/",
  models_name_filter = ".*\\.db",
  models_name_pattern = "mashr_(.*)\\.db",
  metaxcan_folder = "/path/to/metaxcan_files/",
  metaxcan_filter = "GWAS-trait_mashr_(.*)_S-prediXcan.csv",
  metaxcan_file_name_parse_pattern = "(.*)_mashr_(.*)_S-prediXcan.csv",
  data = "MetaXcan/data",
  metaxcan = "MetaXcan/software",
  snp_covariance = "MetaXcan/data/models/gtex_v8_expression_mashr_snp_smultixcan_covariance.txt.gz"
)
}