comparison egsea.R @ 1:73281fbdf6c1 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/egsea commit 225518a08941e7ef8e5c402e3696ec5fa6e592a0
author iuc
date Thu, 15 Feb 2018 02:34:59 -0500
parents a8a083193440
children ba2111ae6eb4
comparison
equal deleted inserted replaced
0:a8a083193440 1:73281fbdf6c1
48 make_option(c("-genes", "--genes"), type="character", help="Path to genes file"), 48 make_option(c("-genes", "--genes"), type="character", help="Path to genes file"),
49 make_option(c("-species", "--species"), type="character"), 49 make_option(c("-species", "--species"), type="character"),
50 make_option(c("-base_methods", "--base_methods"), type="character", help="Gene set testing methods"), 50 make_option(c("-base_methods", "--base_methods"), type="character", help="Gene set testing methods"),
51 make_option(c("-msigdb", "--msigdb"), type="character", help="MSigDB Gene Set Collections"), 51 make_option(c("-msigdb", "--msigdb"), type="character", help="MSigDB Gene Set Collections"),
52 make_option(c("-keggdb", "--keggdb"), type="character", help="KEGG Pathways"), 52 make_option(c("-keggdb", "--keggdb"), type="character", help="KEGG Pathways"),
53 make_option(c("-keggupdated", "--keggupdated"), type="logical", help="Use updated KEGG"),
53 make_option(c("-gsdb", "--gsdb"), type="character", help = "GeneSetDB Gene Sets"), 54 make_option(c("-gsdb", "--gsdb"), type="character", help = "GeneSetDB Gene Sets"),
54 make_option(c("-display_top", "--display_top"), type="integer", help = "Number of top Gene Sets to display"), 55 make_option(c("-display_top", "--display_top"), type="integer", help = "Number of top Gene Sets to display"),
55 make_option(c("-min_size", "--min_size"), type="integer", help = "Minimum Size of Gene Set"), 56 make_option(c("-min_size", "--min_size"), type="integer", help = "Minimum Size of Gene Set"),
56 make_option(c("-fdr_cutoff", "--fdr_cutoff"), type="double", help = "FDR cutoff"), 57 make_option(c("-fdr_cutoff", "--fdr_cutoff"), type="double", help = "FDR cutoff"),
57 make_option(c("-combine_method", "--combine_method"), type="character", help="Method to use to combine the p-values"), 58 make_option(c("-combine_method", "--combine_method"), type="character", help="Method to use to combine the p-values"),
58 make_option(c("-sort_method", "--sort_method"), type="character", help="Method to sort the results"), 59 make_option(c("-sort_method", "--sort_method"), type="character", help="Method to sort the results"),
59 make_option(c("-rdata", "--rdaOpt"), type="character", help="Output RData file") 60 make_option(c("-rdaOpt", "--rdaOpt"), type="character", help="Output RData file")
60 ) 61 )
61 62
62 parser <- OptionParser(usage = "%prog [options] file", option_list=option_list) 63 parser <- OptionParser(usage = "%prog [options] file", option_list=option_list)
63 args = parse_args(parser) 64 args = parse_args(parser)
64 65
186 gsdb <- unlist(strsplit(args$gsdb, ",")) 187 gsdb <- unlist(strsplit(args$gsdb, ","))
187 } else { 188 } else {
188 gsdb <- "none" 189 gsdb <- "none"
189 } 190 }
190 191
191
192 ## Index gene sets 192 ## Index gene sets
193 193
194 gs.annots <- buildIdx(entrezIDs=rownames(counts), species=args$species, msigdb.gsets=msigdb, gsdb.gsets=gsdb, kegg.exclude=kegg_exclude) 194 gs.annots <- buildIdx(entrezIDs=rownames(counts), species=args$species, msigdb.gsets=msigdb, gsdb.gsets=gsdb, kegg.exclude=kegg_exclude, kegg.updated=args$keggupdated)
195 195
196 196
197 ## Run egsea.cnt 197 ## Run egsea.cnt
198 198
199 gsa <- egsea.cnt(counts=counts, group=group, design=design, contrasts=contrasts, gs.annots=gs.annots, symbolsMap=genes, baseGSEAs=base_methods, minSize=args$min_size, display.top=args$display_top, combineMethod=args$combine_method, sort.by=args$sort_method, report.dir='./report_dir', fdr.cutoff=args$fdr_cutoff, num.threads=args$threads, report=TRUE) 199 gsa <- egsea.cnt(counts=counts, group=group, design=design, contrasts=contrasts, gs.annots=gs.annots, symbolsMap=genes, baseGSEAs=base_methods, minSize=args$min_size, display.top=args$display_top, combineMethod=args$combine_method, sort.by=args$sort_method, report.dir='./report_dir', fdr.cutoff=args$fdr_cutoff, num.threads=args$threads, report=TRUE)
200 200
201 201
202 ## Output RData file 202 ## Output RData file
203 203
204 if (!is.null(args$rdata)) { 204 if (!is.null(args$rdaOpt)) {
205 save.image(file = "EGSEA_analysis.RData") 205 save.image(file = "EGSEA_analysis.RData")
206 } 206 }