R/med_all_spc_function.R

Defines functions med_all_spc

Documented in med_all_spc

#' SNP-Peak-Clinical Mediation Table
#'
#' @description Create a table of SNP-Peak-Clinical mediation results
#'  for all chromosomes
#' @param chrs character vector of chromosome names
#' @param covar covariates string, each covariate separated by +
#' @param simulations number of simulations to run
#' @keywords mediation spc
#' @export

med_all_spc <- function(chrs, covar, simulations) {
    all.list = vector(mode = "list", length = length(chrs))
    for (chr in chrs) {
        load(paste("data/spc.res/res_", chr, ".RData", sep = ""))
        med_dat = med.res.data
        ans = med_chr_spc(matches, med_dat, covar, simulations)
        all.list[[chr]] = ans
    }
    data.table::rbindlist(all.list, idcol = "Chr")
}
tydarnell/GeneticMediation documentation built on May 17, 2020, 2:33 a.m.