R/update.pathway.definition.R

update.pathway.definition <- function(pathway, exc.snps, exc.genes = NULL){
  
  if(length(exc.snps) == 0 && length(exc.genes) == 0){
    return(pathway)
  }
  
  id <- which(!(pathway$Gene %in% exc.genes))
  if(length(id) == 0){
    msg <- "All SNPs excluded in update.pathway.definition"
    stop(msg)
  }
  pathway <- pathway[id, ]
  
  id <- which(!(pathway$SNP %in% exc.snps))
  if(length(id) == 0){
    msg <- "All SNPs excluded in update.pathway.definition"
    stop(msg)
  }
  pathway <- pathway[id, ]
  rownames(pathway) <- NULL
  
  pathway
  
}

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.