@@ -101,6 +101,7 @@ setGeneric( "plotReverseCumulatives",
101
101
group <- " group"
102
102
}
103
103
104
+ # no need for colors if a multi-facet plot and many colors
104
105
if (is.null(object @ metadata $ colData $ Colors )) {
105
106
object @ metadata $ colData $ Colors <- scales :: hue_pal()(length(object ))
106
107
}
@@ -230,8 +231,8 @@ setMethod("plotReverseCumulatives", "GRanges",
230
231
# ' @family CAGEr plot functions
231
232
# ' @family CAGEr clusters functions
232
233
# '
233
- # ' @importFrom ggplot2 ggplot scale_fill_manual geom_histogram facet_wrap
234
- # ' @importFrom ggplot2 ggtitle xlab ylab labs
234
+ # ' @importFrom ggplot2 ggplot aes_string scale_fill_manual geom_histogram facet_wrap
235
+ # ' @importFrom ggplot2 ggtitle xlab ylab
235
236
# '
236
237
# ' @examples
237
238
# '
@@ -278,17 +279,22 @@ setMethod( "plotInterquantileWidth", "CAGEexp"
278
279
279
280
binsize <- round(max(iqwidths $ iq_width )/ 2 )
280
281
281
- ggplot2 :: ggplot(iqwidths ) +
282
- ggplot2 :: aes_string(x = " iq_width" , fill = " sampleName " ) +
283
- ggplot2 :: scale_fill_manual(values = names(sampleLabels(object ))) +
284
- ggplot2 :: geom_histogram(bins = binsize ) +
285
- ggplot2 :: facet_wrap(" ~sampleName" ) +
286
- ggplot2 :: ggtitle(paste0(
282
+ iqwidth_plot <- ggplot(iqwidths ) +
283
+ aes_string(x = " iq_width" ) +
284
+ scale_fill_manual(values = names(sampleLabels(object ))) +
285
+ geom_histogram(bins = binsize ) +
286
+ facet_wrap(" ~sampleName" ) +
287
+ ggtitle(paste0(
287
288
switch (clusters , tagClusters = " Tag Clusters" , consensusClusters = " Consenss Clusters" ),
288
289
" interquantile width (quantile " , qLow , " to " , qUp , " )" )) +
289
- ggplot2 :: xlab(" Interquantile width (bp)" ) +
290
- ggplot2 :: ylab(" Frequency" ) +
291
- ggplot2 :: labs(fill = " Sample name" )
290
+ xlab(" Interquantile width (bp)" ) +
291
+ ylab(" Frequency" )
292
+
293
+ if (TOPLOT ){
294
+ print(iqwidth_plot )
295
+ }
296
+
297
+ return (iqwidth_plot )
292
298
})
293
299
294
300
# ' @name plotExpressionProfiles
0 commit comments