diff --git a/CHANGELOG.md b/CHANGELOG.md index 49736ab7..c8663f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Changed` +- [[#232](https://github.com/nf-core/differentialabundance/pull/232)] - Mention missing dots in volcano plot, change rounding, turn off rounding by default ([@WackerO](https://github.com/WackerO), review by [@pinin4fjords](https://github.com/pinin4fjords)) + ## v1.4.0 - 2023-11-27 ### `Added` diff --git a/assets/differentialabundance_report.Rmd b/assets/differentialabundance_report.Rmd index d81e4515..1c509001 100644 --- a/assets/differentialabundance_report.Rmd +++ b/assets/differentialabundance_report.Rmd @@ -176,12 +176,7 @@ round_dataframe_columns <- function(df, columns = NULL, digits = -1) { if (is.null(columns)) { columns <- colnames(df)[(unlist(lapply(df, is.numeric), use.names=F))] # extract only numeric columns for rounding } - - df[,columns] <- round( - data.frame(df[, columns], check.names = FALSE), - digits = digits - ) - + df[,columns] <- format(data.frame(df[, columns], check.names = FALSE), scientific=T, digits=params$report_round_digits) # Convert columns back to numeric for (c in columns) { @@ -833,7 +828,6 @@ for (i in 1:nrow(contrasts)){ cat("\n##### ", pvt, " p values\n") pval_column <- p_value_types[[pvt]] - de_fc <- abs(full_de[[params$differential_fc_column]]) >= log2(params$differential_min_fold_change) de_fc_label <- paste("abs(logFC) >=", log2(params$differential_min_fold_change)) @@ -872,6 +866,13 @@ for (i in 1:nrow(contrasts)){ # Let's equalize the axes max_fc <- max(abs(full_de[[params$differential_fc_column]])) * 1.1 + + # Print warning if any p values are 0 + zero_p <- length(which(full_de[[pval_column]]==0)) + if (zero_p) { + cat(paste0("", zero_p, " feature", ifelse(zero_p>1, "s are", " is"), " not shown because of p value = 0; please refer to the results tables.

")) + } + p <- do.call(plotly_scatterplot, plot_args) %>% layout(xaxis = list(range=list(-max_fc, max_fc))) diff --git a/conf/test.config b/conf/test.config index 2a7929f4..4d4e9454 100644 --- a/conf/test.config +++ b/conf/test.config @@ -50,5 +50,6 @@ params { gene_sets_files = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/gene_set_analysis/mh.all.v2022.1.Mm.symbols.gmt' // Report options + report_round_digits = 3 report_contributors = 'Jane Doe\nDirector of Institute of Microbiology\nUniversity of Smallville;John Smith\nPhD student\nInstitute of Microbiology\nUniversity of Smallville' }