Efficiently aggregate GWAS/QTL summary statistics according to some grouping column (e.g."GENEID").

aggregate_sumstats(
  merged_hits,
  drop_na = TRUE,
  agg_var = "GENEID",
  extra_cols = c("ABC.Score", "CellType"),
  sort_rows = TRUE,
  verbose = TRUE
)

Arguments

merged_hits

data.table with the columns "BETA", "P","SE", and agg_var.

drop_na

Drop rows with NA in any column.

agg_var

Variable to aggregate merged_hits by.

verbose

Print messages.

Source

data.table aggregation solution

Value

data.table with mean and standard deviation of "BETA", "P", and "SE", as well as number of rows and number of unique SNPs per grouping level.

Details

Requires the columns