Mercurial > repos > sblanck > smagexp
comparison MetaMA.R @ 20:a4015af2ae12 draft
planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit a25677963b28019d4434bbe411b28168c912d71d
author | sblanck |
---|---|
date | Mon, 15 Jan 2018 04:50:08 -0500 |
parents | 56267e3293b2 |
children | f953fdee364c |
comparison
equal
deleted
inserted
replaced
19:c08d47a36c1f | 20:a4015af2ae12 |
---|---|
7 | 7 |
8 library("optparse") | 8 library("optparse") |
9 | 9 |
10 ##### Read options | 10 ##### Read options |
11 option_list=list( | 11 option_list=list( |
12 make_option("--input",type="character",default="NULL",help="list of rdata objects containing eset objects"), | 12 make_option("--input",type="character",default="NULL",help="List of rdata objects containing eset objects"), |
13 make_option("--species",type="character",default="NULL",help="Species for annotations"), | |
13 make_option("--htmloutput",type="character",default=NULL,help="Output html report"), | 14 make_option("--htmloutput",type="character",default=NULL,help="Output html report"), |
14 make_option("--htmloutputpath",type="character",default="NULL",help="Path of output html report"), | 15 make_option("--htmloutputpath",type="character",default="NULL",help="Path of output html report"), |
15 make_option("--htmltemplate",type="character",default=NULL,help="html template)") | 16 make_option("--htmltemplate",type="character",default=NULL,help="html template)") |
16 ); | 17 ); |
17 | 18 |
18 opt_parser = OptionParser(option_list=option_list); | 19 opt_parser = OptionParser(option_list=option_list); |
19 opt = parse_args(opt_parser); | 20 opt = parse_args(opt_parser); |
20 | 21 |
21 if(is.null(opt$input)){ | 22 if(is.null(opt$input)){ |
23 print_help(opt_parser) | |
24 stop("input required.", call.=FALSE) | |
25 } | |
26 if(is.null(opt$species)){ | |
22 print_help(opt_parser) | 27 print_help(opt_parser) |
23 stop("input required.", call.=FALSE) | 28 stop("input required.", call.=FALSE) |
24 } | 29 } |
25 | 30 |
26 #loading libraries | 31 #loading libraries |
30 suppressPackageStartupMessages(require(annaffy)) | 35 suppressPackageStartupMessages(require(annaffy)) |
31 suppressPackageStartupMessages(require(VennDiagram)) | 36 suppressPackageStartupMessages(require(VennDiagram)) |
32 suppressPackageStartupMessages(require(GEOquery)) | 37 suppressPackageStartupMessages(require(GEOquery)) |
33 | 38 |
34 listInput <- trimws( unlist( strsplit(trimws(opt$input), ",") ) ) | 39 listInput <- trimws( unlist( strsplit(trimws(opt$input), ",") ) ) |
40 species=opt$species | |
35 | 41 |
36 rdataList=list() | 42 rdataList=list() |
37 condition1List=list() | 43 condition1List=list() |
38 condition2List=list() | 44 condition2List=list() |
39 for (input in listInput) | 45 for (input in listInput) |
59 jpeg(file) | 65 jpeg(file) |
60 grid.draw(venn.plot) | 66 grid.draw(venn.plot) |
61 dev.off() | 67 dev.off() |
62 } | 68 } |
63 | 69 |
64 library("org.Hs.eg.db") | 70 if(!species %in% installed.packages()[,"Package"]) { |
71 source("https://bioconductor.org/biocLite.R") | |
72 biocLite(species) | |
73 } | |
74 | |
75 #library("org.Hs.eg.db") | |
65 x <- org.Hs.egUNIGENE | 76 x <- org.Hs.egUNIGENE |
66 mapped_genes <- mappedkeys(x) | 77 mapped_genes <- mappedkeys(x) |
67 link <- as.list(x[mapped_genes]) | 78 link <- as.list(x[mapped_genes]) |
68 | 79 |
69 probe2unigene<-function(expset){ | 80 probe2unigene<-function(expset){ |