|
24 | 24 | #' |
25 | 25 | #' @importFrom RColorBrewer brewer.pal |
26 | 26 | #' @importFrom rARPACK svds |
| 27 | +#' @importFrom graphics boxplot |
| 28 | +#' @importFrom utils write.csv |
| 29 | +#' @importFrom stats setNames var |
27 | 30 | #' @export |
28 | 31 | #' |
29 | 32 | #' @return An object that represents the SCONE report app. |
@@ -66,15 +69,15 @@ sconeReport = function(x, methods, |
66 | 69 | stop("reshape2 package needed for sconeReport()") |
67 | 70 | } |
68 | 71 |
|
69 | | - if (!require("plotly", quietly = TRUE)) { |
| 72 | + if (!requireNamespace("plotly", quietly = TRUE)) { |
70 | 73 | stop("plotly package needed for sconeReport()") |
71 | 74 | } |
72 | 75 |
|
73 | | - if (!require("visNetwork", quietly = TRUE)) { |
| 76 | + if (!requireNamespace("visNetwork", quietly = TRUE)) { |
74 | 77 | stop("visNetwork package needed for sconeReport()") |
75 | 78 | } |
76 | 79 |
|
77 | | - if (!require("ggplot2", quietly = TRUE)) { |
| 80 | + if (!requireNamespace("ggplot2", quietly = TRUE)) { |
78 | 81 | stop("ggplot2 package needed for sconeReport()") |
79 | 82 | } |
80 | 83 |
|
@@ -223,18 +226,18 @@ sconeReport = function(x, methods, |
223 | 226 | ), |
224 | 227 | shiny::tabPanel("PCA", |
225 | 228 | shiny::br(), |
226 | | - shiny::p(paste0("This panel shows principal ", |
| 229 | + shiny::p(paste0("This panel shows principal ", |
227 | 230 | "component analysis ", |
228 | 231 | "(PCA) results", |
229 | 232 | " on different subsets ", |
230 | 233 | "of genes.")), |
231 | 234 | shiny::br(), |
232 | | - shiny::h6("Variance Explained (All Genes)"), |
| 235 | + shiny::h6("Variance Explained (All Genes)"), |
233 | 236 | shiny::p(paste0("Use this plot", |
234 | 237 | " to decide on the ", |
235 | 238 | "dimensionality of the reduced", |
236 | 239 | " spaced used for evaluation.")), |
237 | | - shiny::plotOutput("plot_scree",width = "650px", |
| 240 | + shiny::plotOutput("plot_scree",width = "650px", |
238 | 241 | height = "400px"), |
239 | 242 | shiny::br(), |
240 | 243 | shiny::h6("2D (All Genes)"), |
@@ -264,7 +267,7 @@ sconeReport = function(x, methods, |
264 | 267 | ), |
265 | 268 | shiny::tabPanel("QC", |
266 | 269 | shiny::br(), |
267 | | - shiny::p(paste0("This panel shows the absolute", |
| 270 | + shiny::p(paste0("This panel shows the absolute", |
268 | 271 | " correlations between", |
269 | 272 | " Principal", |
270 | 273 | " Components (PCs) of", |
@@ -326,7 +329,7 @@ sconeReport = function(x, methods, |
326 | 329 | ), |
327 | 330 | shiny::tabPanel("Control Genes", |
328 | 331 | shiny::br(), |
329 | | - shiny::p(paste0("Heatmap of control genes, ", |
| 332 | + shiny::p(paste0("Heatmap of control genes, ", |
330 | 333 | "colored by all", |
331 | 334 | " three categories.")), |
332 | 335 | shiny::br(), |
@@ -625,7 +628,7 @@ sconeReport = function(x, methods, |
625 | 628 | fill = cc[sort(unique(factor(strat_col())))]) |
626 | 629 | }) |
627 | 630 |
|
628 | | - output$plot3d_base <- shiny::renderPlotly({ |
| 631 | + output$plot3d_base <- plotly::renderPlotly({ |
629 | 632 | PC1 <- PC2 <- PC3 <- NULL |
630 | 633 | df <- setNames(data.frame(pc_obj_base()$x[,1:3]), |
631 | 634 | c("PC1", "PC2", "PC3")) |
@@ -665,7 +668,7 @@ sconeReport = function(x, methods, |
665 | 668 | abs(cor(qc,pc_obj_base()$x)) |
666 | 669 | }) |
667 | 670 |
|
668 | | - output$qccorPlot <- shiny::renderPlotly({ |
| 671 | + output$qccorPlot <- plotly::renderPlotly({ |
669 | 672 | metric <- value <- PC <- NULL |
670 | 673 |
|
671 | 674 | df = reshape2::melt(cor_qc()[,1:input$dim]) |
@@ -696,7 +699,7 @@ sconeReport = function(x, methods, |
696 | 699 | fill = cc[sort(unique(factor(strat_col())))]) |
697 | 700 | }) |
698 | 701 |
|
699 | | - output$plot3d_qc <- shiny::renderPlotly({ |
| 702 | + output$plot3d_qc <- plotly::renderPlotly({ |
700 | 703 | if(ncol(pc_obj_qc()$x) >= 3){ |
701 | 704 | PC1 <- PC2 <- PC3 <- NULL |
702 | 705 | df <- setNames(data.frame(pc_obj_qc()$x[,1:3]), |
|
0 commit comments