64
64
# ' ggplot2::ggtitle("prim6 replicates")
65
65
# ' tagClustersGR(exampleCAGEexp) |> plotReverseCumulatives()
66
66
# '
67
- # ' @importFrom ggplot2 aes geom_line geom_abline facet_wrap geom_text geom_vline ggplot
67
+ # ' @importFrom ggplot2 aes geom_line geom_abline facet_wrap geom_text geom_vline ggplot scale_x_log10 scale_y_log10
68
68
# ' @importFrom rlang .data
69
69
# ' @importFrom scales hue_pal
70
70
# ' @importFrom stats cor median
@@ -81,9 +81,7 @@ setGeneric( "plotReverseCumulatives",
81
81
.plotReverseCumulatives <-
82
82
function ( object , values = c(" raw" , " normalized" )
83
83
, fitInRange = c(10 , 1000 )
84
- , group = NULL
85
- , xlim = c(1 , 1e5 )
86
- , ylim = c(1 , 1e6 )) {
84
+ , group = NULL ) {
87
85
if (is.null(object @ metadata $ colData ))
88
86
stop(" Expects a List-like object with a colData DataFrame in its metadata slot." )
89
87
@@ -130,14 +128,12 @@ setGeneric( "plotReverseCumulatives",
130
128
reference.library.size <- 10 ^ floor(log10(median(sapply(object , sum ))))
131
129
reference.intercept <- log10(reference.library.size / VGAM :: zeta(- 1 * reference.slope )) # intercept on log10 scale used for plotting with abline
132
130
133
- plot_out <- ggplot(intermediate_df ) +
131
+ ggplot(intermediate_df ) +
134
132
aes(x = x , y = y ) +
135
133
geom_line() +
136
134
facet_wrap(. ~ sampleLabels ) +
137
- xlim(xlim [1 ], xlim [2 ]) +
138
- ylim(ylim [1 ], ylim [2 ]) +
139
- scale_x_continuous(trans = ' log10' ) +
140
- scale_y_continuous(trans = ' log10' ) +
135
+ scale_x_log10() +
136
+ scale_y_log10() +
141
137
labs(title = " Reference distribution:" ,
142
138
subtitle = paste0(" alpha= " , sprintf(" %.2f" , - 1 * reference.slope ), " T= " , reference.library.size ),
143
139
x = xlab , y = ylab ) +
@@ -152,12 +148,7 @@ setGeneric( "plotReverseCumulatives",
152
148
# ToDo: what is the intended behaviour?
153
149
warning(" reference distribution not fitted" )
154
150
}
155
-
156
- if (TOPLOT ){
157
- print(plot_out )
158
- }
159
-
160
- return (list (plot_out , reference.slope , reference.library.size , reference.intercept ))
151
+
161
152
}
162
153
163
154
# ' @rdname plotReverseCumulatives
@@ -284,7 +275,7 @@ setMethod( "plotInterquantileWidth", "CAGEexp"
284
275
285
276
binsize <- round(max(iqwidths $ iq_width )/ 2 )
286
277
287
- iqwidth_plot <- ggplot(iqwidths ) +
278
+ ggplot(iqwidths ) +
288
279
aes_string(x = " iq_width" ) +
289
280
scale_fill_manual(values = names(sampleLabels(object ))) +
290
281
geom_histogram(bins = binsize ) +
@@ -295,11 +286,6 @@ setMethod( "plotInterquantileWidth", "CAGEexp"
295
286
xlab(" Interquantile width (bp)" ) +
296
287
ylab(" Frequency" )
297
288
298
- if (TOPLOT ){
299
- print(iqwidth_plot )
300
- }
301
-
302
- return (iqwidth_plot )
303
289
})
304
290
305
291
# ' @name plotExpressionProfiles
0 commit comments