@@ -39,7 +39,6 @@ library(yaml)
3939library(shinyngs)
4040library(plotly)
4141library(DT)
42- library(ggplot2)
4342```
4443
4544<!-- Define some functions -->
@@ -875,7 +874,7 @@ cat(differential_summary_string)
875874
876875# Display all warnings related to number of rows
877876if (length(warnings_list) > 0) {
878- for (warning in warnings_list) cat(warning)
877+ for (warning in warnings_list) { cat(warning) }
879878}
880879
881880for (i in 1:nrow(contrasts)){
@@ -895,11 +894,7 @@ for (i in 1:nrow(contrasts)){
895894 full_de <- differential_results[[i]]
896895 full_de <- subset(full_de, (! is.na(full_de[[params$meta$params$differential_fc_column]])) & (! is.na(full_de[[params$meta$params$differential_qval_colum]])) )
897896
898- up_tbl <- sig_differential[[pvt]][[i]][["up"]]
899- if (!is.null(up_tbl) && nrow(up_tbl) > 0) {
900- up_tbl$Direction <- "Up"
901- parts[["Up"]] <- up_tbl
902- }
897+ # We'll color by whether features are differential according to supplied thresholds
903898
904899 p_value_types <- list(Adjusted = params$meta$params$differential_qval_column, Unadjusted = params$meta$params$differential_pval_column)
905900 p_value_thresholds <- list(Adjusted = params$meta$params$differential_max_qval, Unadjusted = params$meta$params$differential_max_pval)
@@ -953,11 +948,8 @@ for (i in 1:nrow(contrasts)){
953948 cat(paste0("<i>", zero_p, " feature", ifelse(zero_p>1, "s are", " is"), " not shown because of p value = 0; please refer to the results tables.</i><br><br>"))
954949 }
955950
956- # Put Direction first, prettify col names, then optional global rounding
957- first_cols <- c("Direction", setdiff(colnames(combined), "Direction"))
958- combined <- combined[, first_cols, drop = FALSE]
959- colnames(combined) <- prettifyVariablename(colnames(combined))
960- combined <- round_dataframe_columns(combined, digits = params$round_digits)
951+ p <- do.call(plotly_scatterplot, plot_args) %>%
952+ layout(xaxis = list(range=list(-max_fc, max_fc)))
961953
962954 print(htmltools::tagList(p))
963955 cat("\n\n")
@@ -996,8 +988,10 @@ for (i in 1:nrow(contrasts)){
996988 } else {
997989 cat("Column 'Gene biotype' does not exist. Skipping plot.\n")
998990 }
999- } else {
1000- cat("No significantly differential genes in either direction.\n\n")
991+ }else{
992+ cat(paste0("No significantly differential '", dir, "' genes.\n\n"))
993+ }
994+ }
1001995 }
1002996 cat(":::")
1003997}
0 commit comments