5656 type_color = " PEPTIDE"
5757 }
5858
59- profile_plot = ggplot(input , aes_string (x = " RUN" , y = " newABUNDANCE" ,
60- color = type_color , linetype = " FEATURE" )) +
59+ profile_plot = ggplot(data = input , aes (x = .data $ RUN , y = .data $ newABUNDANCE ,
60+ color = .data [[ type_color ]] , linetype = .data $ FEATURE )) +
6161 facet_grid(~ LABEL ) +
62- geom_line(size = 0.5 )
62+ geom_line(linewidth = 0.5 )
6363
6464 if (is_censored ) {
6565 profile_plot = profile_plot +
66- geom_point(aes_string (x = " RUN" , y = " newABUNDANCE" , color = type_color , shape = " censored" ),
66+ geom_point(aes (x = .data $ RUN , y = .data $ newABUNDANCE , color = .data [[ type_color ]] , shape = .data $ censored ),
6767 data = input ,
6868 size = dot.size.profile ) +
6969 scale_shape_manual(values = c(16 , 1 ),
9797 scale_y_continuous(yaxis.name , limits = c(y.limdown , y.limup )) +
9898 geom_vline(xintercept = lineNameAxis + 0.5 , colour = " grey" , linetype = " longdash" ) +
9999 labs(title = unique(input $ PROTEIN )) +
100- geom_text(data = groupNametemp , aes(x = RUN , y = ABUNDANCE , label = Name ),
100+ geom_text(data = groupNametemp , aes(x = .data $ RUN , y = .data $ ABUNDANCE , label = .data $ Name ),
101101 size = text.size ,
102102 angle = text.angle ,
103103 color = " black" ) +
156156
157157 num_features = data.table :: uniqueN(input $ FEATURE )
158158 profile_plot = ggplot(data = input ,
159- aes_string (x = " RUN" , y = " newABUNDANCE" ,
160- color = " analysis" , linetype = " FEATURE" ,
161- size = " analysis" )) +
159+ aes (x = .data $ RUN , y = .data $ newABUNDANCE ,
160+ color = .data $ analysis , linetype = .data $ FEATURE ,
161+ size = .data $ analysis )) +
162162 facet_grid(~ LABEL ) +
163- geom_line(size = 0.5 )
163+ geom_line(linewidth = 0.5 )
164164
165165 if (is_censored ) { # splitting into two layers to keep red above grey
166166 profile_plot = profile_plot +
167167 geom_point(data = input [input $ PEPTIDE != " Run summary" ],
168- aes_string (x = " RUN" , y = " newABUNDANCE" ,
169- color = " analysis" , size = " analysis" ,
170- shape = " censored" )) +
168+ aes (x = .data $ RUN , y = .data $ newABUNDANCE ,
169+ color = .data $ analysis , size = .data $ analysis ,
170+ shape = .data $ censored )) +
171171 geom_point(data = input [input $ PEPTIDE == " Run summary" ],
172- aes_string (x = " RUN" , y = " newABUNDANCE" ,
173- color = " analysis" , size = " analysis" ,
174- shape = " censored" )) +
172+ aes (x = .data $ RUN , y = .data $ newABUNDANCE ,
173+ color = .data $ analysis , size = .data $ analysis ,
174+ shape = .data $ censored )) +
175175 scale_shape_manual(values = c(16 , 1 ),
176176 labels = c(" Detected data" ,
177177 " Censored missing data" ))
191191 geom_vline(xintercept = lineNameAxis + 0.5 ,
192192 colour = " grey" , linetype = " longdash" ) +
193193 labs(title = unique(input $ PROTEIN )) +
194- geom_text(data = groupNametemp , aes(x = RUN , y = ABUNDANCE , label = Name ),
194+ geom_text(data = groupNametemp , aes(x = .data $ RUN , y = .data $ ABUNDANCE , label = .data $ Name ),
195195 size = text.size ,
196196 angle = text.angle ,
197197 color = " black" ) +
209209 } else {
210210 profile_plot = profile_plot +
211211 guides(color = color_guide ) +
212- geom_point(aes_string (x = " RUN" , y = " newABUNDANCE" , size = " analysis" ,
213- color = " analysis" ), data = input )
212+ geom_point(aes (x = .data $ RUN , y = .data $ newABUNDANCE , size = .data $ analysis ,
213+ color = .data $ analysis ), data = input )
214214 }
215215 profile_plot
216216}
234234 plot_title = unique(input $ PROTEIN )
235235 }
236236
237- ggplot(input , aes_string (x = " RUN" , y = " ABUNDANCE" )) +
237+ ggplot(input , aes (x = .data $ RUN , y = .data $ ABUNDANCE )) +
238238 facet_grid(~ LABEL ) +
239- geom_boxplot(aes_string (fill = " LABEL" ), outlier.shape = 1 ,
239+ geom_boxplot(aes (fill = .data $ LABEL ), outlier.shape = 1 ,
240240 outlier.size = 1.5 ) +
241241 scale_fill_manual(values = label.color , guide = " none" ) +
242242 scale_x_discrete(" MS runs" , breaks = cumGroupAxis ) +
243243 scale_y_continuous(yaxis.name , limits = c(y.limdown , y.limup )) +
244244 geom_vline(xintercept = lineNameAxis + 0.5 , colour = " grey" ,
245245 linetype = " longdash" ) +
246246 labs(title = plot_title ) +
247- geom_text(data = groupName , aes(x = RUN , y = ABUNDANCE , label = Name ),
247+ geom_text(data = groupName , aes(x = .data $ RUN , y = .data $ ABUNDANCE , label = .data $ Name ),
248248 size = text.size , angle = text.angle , color = " black" ) +
249249 theme_msstats(" QCPLOT" , x.axis.size , y.axis.size ,
250250 legend_size = NULL )
268268 input $ Label = as.numeric(gsub(" \\ D" , " " , unique(input $ Label )))
269269 }
270270
271- plot = ggplot(aes_string (x = " Label" , y = " Mean" ), data = input ) +
272- geom_errorbar(aes(ymax = Mean + ciw , ymin = Mean - ciw ),
271+ plot = ggplot(aes (x = .data $ Label , y = .data $ Mean ), data = input ) +
272+ geom_errorbar(aes(ymax = .data $ Mean + .data $ ciw , ymin = .data $ Mean - .data $ ciw ),
273273 data = input , width = 0.1 , colour = " red" ) +
274274 geom_point(size = dot.size.condition , colour = " darkred" )
275275
283283 plot = plot +
284284 scale_y_continuous(yaxis.name , limits = c(y.limdown , y.limup )) +
285285 geom_hline(yintercept = 0 , linetype = " twodash" ,
286- colour = " darkgrey" , size = 0.6 ) +
286+ colour = " darkgrey" , linewidth = 0.6 ) +
287287 labs(title = unique(single_protein $ PROTEIN )) +
288288 theme_msstats(" CONDITIONPLOT" , x.axis.size , y.axis.size ,
289289 text_angle = text.angle )
290290 plot
291- }
291+ }
0 commit comments