gwas_merge: Format data for CAUSE

Description Usage Arguments Details Value

View source: R/gwas_merge.R

Description

Format GWAS summary statistics for CAUSE

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
gwas_merge(
  X1,
  X2,
  X1_formatted = FALSE,
  X2_formatted = FALSE,
  snp_name_cols = c("snp", "snp"),
  beta_hat_cols = c("beta_hat", "beta_hat"),
  se_cols = c("se", "se"),
  A1_cols = c("A1", "A1"),
  A2_cols = c("A2", "A2"),
  pval_cols = c(NA, NA),
  compute_pvals = TRUE
)

Arguments

X1

data.frame with data for GWAS 1

X2

data.frame with data for GWAS 2

snp_name_cols

A vector of length 2 specifying the name of the snp column in X1 and X2 respectively. This is the column on which the data will be merged.

beta_hat_cols

A vector of length 2 specifying the name of the snp column in X1 and X2 respectively. If effect sizes are provided as odds ratios they must be converted back into coeffecient estimates by taking the log.

se_cols

A vector of length 2 specifying the name of the snp column in X1 and X2 respectively.

A1_cols

Column names for effect allele

A2_cols

Column names for other allele

pval_cols

Column names for p-values. Can be ommitted or either element can be NA.

compute_pvals

If p-values are missing in one or both studies, should the function compute them. If true, p-values will be computed as '2*pnorm(-abs(beta_hat/se))'.

Details

This function will try to merge data sets X1 and X2 on the specified columns. Where necessary, it will flip the sign of effects so that the effect allele is the same in both data sets. It will remove variants with ambiguous alleles or where the alleles (G/C or A/T) or with alleles that do not match between data sets (e.g A/G in one data set and A/C in the other). It will not remove variants that are simply strand flipped between the two data sets (e. g. A/C in one data set, T/G in the other).

Value

An object of class cause_data and data.frame.


jean997/cause documentation built on Dec. 25, 2021, 10 p.m.