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,
  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

A tab-delimited data frame with colname "#chrom", "start", "end", "path", where "path" column contains file paths for both LD matrix and bim file and is separated by ",". Bim file input would expect no headers, while the columns are aligned in the order of "chrom", "variants", "GD", "pos", "A1", "A2", "variance", "allele_freq", "n_nomiss".

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".

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