R/split.sum.stat.R

split.sum.stat <- function(sum.stat, sub.pathway){
  
  ngrp <- length(sub.pathway)
  
  ss <- list()
  nstudy <- length(sum.stat$stat)
  for(i in 1:ngrp){
    snps <- sub.pathway[[i]]$SNP
    ss[[i]] <- sum.stat
    for(j in 1:nstudy){
      ss[[i]]$stat[[j]] <- ss[[i]]$stat[[j]][ss[[i]]$stat[[j]]$SNP %in% snps, ]
    }
    ss[[i]]$snps.in.study <- snps
    ss[[i]]$SNP.sample.size <- ss[[i]]$SNP.sample.size[snps, ]
  }
  
  ss
  
}

Try the ARTP2 package in your browser

Any scripts or data that you put into this service are public.

ARTP2 documentation built on May 2, 2019, 3:38 p.m.