Skip to content

Commit

Permalink
Merge pull request #346 from atrigila/add_plots
Browse files Browse the repository at this point in the history
Add plots by biotype
  • Loading branch information
atrigila authored Nov 13, 2024
2 parents abc126b + 8e6f078 commit 398f8de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [[#345](https://github.com/nf-core/differentialabundance/pull/345)] - Plot differentially expressed genes by gene biotype ([@atrigila](https://github.com/atrigila), review by [@grst](https://github.com/grst))
- [[#343](https://github.com/nf-core/differentialabundance/pull/343)] - Add pipeline-level nf-tests ([@atrigila](https://github.com/atrigila), review by [@pinin4fjords](https://github.com/pinin4fjords) and [@nschcolnicov](https://github.com/nschcolnicov))
- [[#286](https://github.com/nf-core/differentialabundance/pull/286)] - Integration of limma voom for rnaseq data ([@KamilMaliszArdigen](https://github.com/KamilMaliszArdigen), review by [@pinin4fjords](https://github.com/pinin4fjords))

Expand Down
19 changes: 19 additions & 0 deletions assets/differentialabundance_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,25 @@ for (i in 1:nrow(contrasts)){
if (nrow(contrast_de) > 0){
contrast_de <- round_dataframe_columns(contrast_de, digits=params$report_round_digits)
print( htmltools::tagList(datatable(contrast_de, caption = paste('Differential genes', dir, 'in', contrast_descriptions[i], " (check", differential_files[[i]], "for more detail)"), rownames = FALSE) ))
# Plot Differentially Expressed Genes by Gene Biotype
gene_biotype_table <- contrast_de %>%
group_by(`Gene biotype`) %>%
summarise(count = dplyr::n(), .groups = 'drop') %>%
filter(count > 0) %>%
arrange(desc(count))
gene_biotype_plot <- ggplot(gene_biotype_table, aes(x = reorder(`Gene biotype`, -count), y = count)) +
geom_bar(stat = "identity", position = position_dodge()) +
labs(
title = paste0("Differentially Expressed Genes by Gene Biotype (", dir, ")"),
x = "Gene Biotype",
y = "Number of Differentially Expressed Genes" ) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
print(gene_biotype_plot)
}else{
cat(paste0("No significantly differential '", dir, "' genes.\n\n"))
}
Expand Down

0 comments on commit 398f8de

Please sign in to comment.