Combines gene PIPs by context, type or group.

combine_gene_pips(
  susie_alpha_res,
  group_by = "molecular_id",
  by = c("context", "type", "group"),
  method = c("combine_cs", "sum"),
  filter_cs = TRUE,
  keep_alpha_in_cs_only = FALSE,
  include_cs_id = TRUE,
  include_set_id = FALSE,
  missing_value = NA
)

Arguments

susie_alpha_res

a data frame of annotated susie alpha result.

group_by

column name to group genes by.

by

option to combine PIPs by: "context" (default), "type", or "group".

method

method to combine PIPs of molecular traits targeting the same gene. options: "combine_cs" (default): first sums PIPs of molecular traits of a genes in each credible set, and then combine PIPs using the following formula: \(1 - \prod_k (1 - \text{PIP}_k)\), where \(\text{PIP}_k\) is the summed PIP of the \(k\)-th credible set of a gene. This is the default option for combining PIPs from fine-mapping with LD. "sum": sum over PIPs of all molecular traits for the same gene. This summation is the expected number of causal molecular traits in this gene, and could be higher than 1. We will use this option for combining PIPs from fine-mapping without LD.

filter_cs

If TRUE, limits gene results to credible sets (CS).

keep_alpha_in_cs_only

If TRUE, only keep single effects (alpha) in credible sets when calculating combined PIP. This is similar to prune_by_cs in susie.

include_cs_id

If TRUE, include credible set IDs of the genes in the output

include_set_id

If TRUE, include susie set IDs of the genes in the output

missing_value

set missing value as (default: NA)

Value

a data frame of combined gene PIPs for each context, type or group