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 )
merged_hits | data.table
with the columns "BETA", "P","SE", and |
---|---|
drop_na | Drop rows with |
agg_var | Variable to aggregate |
verbose | Print messages. |
data.table aggregation solution
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.
Requires the columns