Skip to contents

Function Conditions: - processes data in the format of either the output from load_twas_weights/generate_twas_db or refined_twas_weights_data from twas pipeline. - For the first format, we expect there is only one gene/events's information, that can be accessed through `region_info_obj` and refined_twas_weights_data contains per region multiple gene/event's refined weights data.

Usage

harmonize_twas(
  twas_weights_data,
  ld_meta_file_path,
  gwas_meta_file,
  ld_reference_sample_size,
  column_file_path = NULL,
  comment_string = "#"
)

Arguments

twas_weights_data

List of list of twas weights output from from generate_twas_db function.

ld_meta_file_path

Path to LD reference: either a PLINK2/PLINK1 prefix, or a tab-delimited metadata file with columns "#chrom", "start", "end", "path" (auto-detected).

gwas_meta_file

A file path for a dataframe table with column of "study_id", "chrom" (integer), "file_path", "column_mapping_file". Each file in "file_path" column is tab-delimited dataframe of GWAS summary statistics with column name "chrom" (or #chrom" if tabix-indexed), "pos", "A2", "A1".

ld_reference_sample_size

Sample size of the LD reference panel (integer). Required. Used to compute per-variant variance as 2*p*(1-p)*n/(n-1). For ADSP R4, use 17000.

Value

A list of list for harmonized weights and dataframe of gwas summary statistics that is add to the original input of twas_weights_data under each context.

Details

Main Steps: 1. allele QC for TWAS weights against the LD meta 2. allele QC for GWA summary stats against the LD meta 3. adjust susie/mvsusie weights based on the overlap variants