annotate ggplotpointscript.R @ 5:f018aced4abe draft

Deleted selected files
author moheydarian
date Thu, 08 Dec 2016 19:57:28 -0500
parents 37e17dfc9add
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
1 #TO ACCOMPANY ggplot_point.xml version 0.1.2
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
2 # Setup R error handling to go to stderr
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
3 options(show.error.messages=F, error=function(){cat(geterrmessage(),file=stderr());q("no",1,F)})
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
4
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
5 # We need to not crash galaxy with an UTF8 error on German LC settings.
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
6 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
7
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
8
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
9 # Import library
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
10 library("getopt")
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
11 library("ggplot2")
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
12 options(stringAsfactors = FALSE, useFancyQuotes = FALSE)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
13 # Take in trailing command line arguments
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
14 args <- commandArgs(trailingOnly = TRUE)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
15
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
16
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
17 # get options, using the spec as defined by the enclosed list.
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
18 # we read the options from the default: commandArgs(TRUE).
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
19 option_specification = matrix(c(
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
20 'input', 'i', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
21 'title', 't',2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
22 'size', 's', 2, 'double',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
23 'xlab', 'x', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
24 'ylab', 'y', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
25 'xplot', 'z', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
26 'yplot', 'j', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
27 'xaxismin', 'e', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
28 'xaxismax', 'f', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
29 'yaxismin', 'g', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
30 'yaxismax', 'h', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
31 'alpha', 'a', 2, 'double',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
32 'points', 'p', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
33 'theme', 'l', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
34 'scaling', 'b', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
35 'transform', 'w', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
36 'dim', 'k', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
37 'woutputdim', 'c', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
38 'houtputdim', 'd', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
39 'factor', 'n', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
40 'factorcol', 'm', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
41 'colors', 'q', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
42 'colororder', 'r', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
43 'pointcolor', 'u', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
44 'axistitlecust', 'v', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
45 'axistitlecolor', '1', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
46 'axistitlesize', '2', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
47 'axistitleface', '3', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
48 'axistextcust', '4', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
49 'axistextcolor', '5', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
50 'axistextsize', '6', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
51 'axistextface', '7', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
52 'plottitlecust', '8', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
53 'plottitlecolor', '9', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
54 'plottitlesize', '10', 2, 'integer',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
55 'plottitleface', '11', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
56 'gridlinecust', '12', 2, 'character',
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
57 'output', 'o', 2, 'character'
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
58 ), byrow=TRUE, ncol=4);
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
59
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
60 # Parse options
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
61 options = getopt(option_specification);
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
62
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
63
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
64
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
65 # Print options to see what is going on
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
66 cat("\n input: ",options$input)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
67 cat("\n title: ",options$title)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
68 cat("\n xlab: ",options$xlab)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
69 cat("\n ylab: ",options$ylab)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
70 cat("\n points: ",options$points)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
71 cat("\n theme: ",options$theme)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
72 cat("\n scaling: ",options$scaling)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
73 cat("\n transform: ",options$transform)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
74
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
75
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
76
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
77 #Choose between automatically scaled x and y axis or user defined
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
78 if(options$scaling == "Automatic"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
79 gg_scalex = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
80 gg_scaley = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
81 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
82 gg_scalex = xlim(options$xaxismin,options$xaxismax)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
83 gg_scaley = ylim(options$yaxismin,options$yaxismax)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
84 cat("\n xaxismin: ",options$xaxismin)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
85 cat("\n xaxismax: ",options$xaxismax)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
86 cat("\n yaxismin: ",options$yaxismin)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
87 cat("\n yaxismax: ",options$yaxismax)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
88 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
89
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
90 # Choose theme for plot
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
91 if(options$theme == "bw"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
92 gg_theme = theme_bw()
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
93 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
94 gg_theme = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
95 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
96
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
97 #Choose dimensions of output pdf
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
98 if(options$dim == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
99 gg_width = 7
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
100 gg_height = 7
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
101 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
102 gg_width = options$woutputdim
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
103 gg_height = options$houtputdim
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
104 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
105
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
106 input <-read.table(options$input, check.names=TRUE, header=TRUE, row.names=NULL)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
107
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
108 #renaming columns so ggplot can use them
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
109 names(input)[options$xplot] <- "xcol"
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
110 names(input)[options$yplot] <- "ycol"
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
111
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
112 #choosing whether to plot data as multiple groups on one plot(factoring) OR multiple groups on different plots
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
113 if(options$factor == "Multiple"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
114 gg_facet = facet_wrap( ~ factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
115 gg_factor = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
116 color_scale = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
117
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
118 if(options$points == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
119 gg_point = geom_point(size=1, alpha=1, gg_factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
120 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
121 gg_point = geom_point(size=options$size, alpha=options$alpha, colour=options$pointcolor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
122 cat("\n size: ",options$size)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
123 cat("\n alpha: ",options$alpha)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
124 cat("\n pointcolor: ",options$pointcolor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
125 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
126
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
127 names(input)[options$factorcol] <- "factor"
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
128
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
129 cat("\n factor: ",options$factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
130 cat("\n factorcol: ",options$factorcol)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
131 } else if(options$factor == "Single"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
132 gg_facet = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
133 gg_factor = aes(colour=factor(factor))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
134
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
135 if(options$points == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
136 gg_point = geom_point(size=1, alpha=1, gg_factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
137 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
138 gg_point = geom_point(size=options$size, alpha=options$alpha, gg_factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
139 cat("\n size: ",options$size)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
140 cat("\n alpha: ",options$alpha)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
141 cat("\n pointcolor: ",options$pointcolor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
142 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
143
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
144 if(options$colors == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
145 color_scale = scale_colour_hue(direction=options$colororder)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
146 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
147 color_scale = scale_color_brewer(palette=options$colors, direction=options$colororder)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
148 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
149
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
150 names(input)[options$factorcol] <- "factor"
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
151
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
152 cat("\n factor: ",options$factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
153 cat("\n factorcol: ",options$factorcol)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
154 cat("\n color_scale: ",options$colors)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
155 cat("\n color_order: ",options$colororder)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
156 } else{
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
157 gg_facet = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
158 gg_factor = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
159 color_scale = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
160
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
161 if(options$points == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
162 gg_point = geom_point(size=1, alpha=1, gg_factor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
163 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
164 gg_point = geom_point(size=options$size, alpha=options$alpha, colour=options$pointcolor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
165 cat("\n size: ",options$size)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
166 cat("\n alpha: ",options$alpha)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
167 cat("\n pointcolor: ",options$pointcolor)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
168 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
169 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
170
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
171
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
172 #Selecting whether or not to log transform data
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
173 if(options$transform == "log2"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
174 input[, options$xplot] <- log2(input[options$xplot])
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
175 input[, options$yplot] <- log2(input[options$yplot])
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
176 }else if(options$transform == "log2plus1"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
177 input[, options$xplot] <- log2(input[options$xplot]+1)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
178 input[, options$yplot] <- log2(input[options$yplot]+1)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
179 }else if(options$transform == "log10"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
180 input[, options$xplot] <- log10(input[options$xplot])
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
181 input[, options$yplot] <- log10(input[options$yplot])
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
182 }else if(options$transform == "log10plus1"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
183 input[, options$xplot] <- log10(input[options$xplot]+1)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
184 input[, options$yplot] <- log10(input[options$yplot]+1)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
185 }else{
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
186 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
187
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
188
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
189 #axis label custization
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
190 if(options$axistitlecust == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
191 gg_axistitle = theme(axis.title = element_text(color = NULL, size = NULL, face = NULL))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
192 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
193 gg_axistitle = theme(axis.title = element_text(color = options$axistitlecolor, size = options$axistitlesize, face = options$axistitleface))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
194 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
195
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
196
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
197 #axis text(tick) custization
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
198 if(options$axistextcust == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
199 gg_axistext = theme(axis.text = element_text(color = NULL, size = NULL, face = NULL))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
200 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
201 gg_axistext = theme(axis.text = element_text(color = options$axistextcolor, size = options$axistextsize, face = options$axistextface))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
202 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
203
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
204
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
205 #plot title custimization
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
206 if(options$plottitlecust == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
207 gg_plottitle = theme(plot.title = element_text(color = NULL, size = NULL, face = NULL))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
208 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
209 gg_plottitle = theme(plot.title = element_text(color = options$plottitlecolor, size = options$plottitlesize, face = options$plottitleface))
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
210 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
211
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
212 #grid line customization
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
213 if(options$gridlinecust == "Default"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
214 gg_gridline = NULL
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
215 } else if(options$gridlinecust == "hidemajor"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
216 gg_gridline = theme(panel.grid.major = element_blank())
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
217 } else if(options$gridlinecust == "hideminor"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
218 gg_gridline = theme(panel.grid.minor = element_blank())
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
219 } else if(options$gridlinecust == "hideboth"){
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
220 gg_gridline = theme(panel.grid.minor = element_blank(), panel.grid.major = element_blank())
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
221 } else {
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
222 }
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
223
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
224
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
225 #this is the actual ggplot command to make the final plot(s)
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
226 ggplot(input, aes(xcol,ycol))+gg_point+gg_facet+
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
227 gg_theme+gg_scalex+gg_scaley+color_scale+ggtitle(options$title)+xlab(options$xlab)+ylab(options$ylab)+
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
228 gg_axistitle+gg_axistext+gg_plottitle+gg_gridline
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
229
37e17dfc9add Uploaded
moheydarian
parents:
diff changeset
230 ggsave(file=options$output, width=gg_width, height=gg_height)