R/gmtlist2file.R

Defines functions gmtlist2file

Documented in gmtlist2file

#' write gmt list into gmt file
#' 
#' write gmt list into gmt file
#' 
#' @param gmtlist a list containing gmt
#' @param filename output filename
#' @return NA
#' 
#' @export
#' 
#' @seealso gmt2list
#' @examples 
#' anno <- "c2.cp.kegg.v7.01.symbols.gmt.xz"
#' annofile <- system.file("extdata", anno, package="cogena")
#' gl <- gmt2list(annofile)
#' gmtfile <- gmtlist2file(gl, filename="")
#' 
gmtlist2file <- function(gmtlist, filename){
    gsname=names(gmtlist) 
    for (i in seq_along(gmtlist) ){ 
        cat(gsname[i], length(gmtlist[[i]]), gmtlist[[i]], file=filename, append=TRUE, sep = "\t")
        cat("\n", append=TRUE, file=filename)
    }
}

Try the cogena package in your browser

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

cogena documentation built on Nov. 8, 2020, 6:54 p.m.