Skip to content

Commit

Permalink
Merge pull request #126 from Plant-Food-Research-Open/patch/124
Browse files Browse the repository at this point in the history
Fixed issues in genepal-report
  • Loading branch information
GallVp authored Dec 10, 2024
2 parents e1cceba + b9b7d37 commit 496ff62
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.6.0 - [6-Dec-2024]
## v0.6.0 - [10-Dec-2024]

### 'Added'

Expand All @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

1. Fixed an issue where TSEBRA failed because LIFTOFF lifted non-protein coding genes [#121](https://github.com/Plant-Food-Research-Open/genepal/issues/121)
2. Switched branch name from `master` to `main` in the GHA CIs
3. Fixed an issue in `genepal_report.Rmd` which caused the pangene matrix plot to fail when the number of clusters exceeded 65536 [#124](https://github.com/Plant-Food-Research-Open/genepal/issues/124)
4. Fixed an issue where `GENEPALREPORT` process failed due to OOM kill signal from SLURM [#123](https://github.com/Plant-Food-Research-Open/genepal/issues/123)

### `Dependencies`

Expand Down
29 changes: 25 additions & 4 deletions bin/genepal_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,43 @@ cat("<br>")


```{r pheatmap, eval=(exists("n0_df") && !is.null(n0_df$heatmap)), results='hide', fig.align='center', fig.cap="Heatmap showing number of proteins present in each orthocluster (clusters where all individuals have 1 copy are excluded). Columns = Orthologue cluster, Row = Individual", fig.width=7, fig.height=7, dpi=150, warning=FALSE}
pheatmap(n0_df$heatmap,
# Max 65536 allowed
# https://github.com/Plant-Food-Research-Open/genepal/issues/124
n_cols <- ncol(n0_df$heatmap)
max_cols_allowed <- min(n_cols, 5000)
# Approach 1: Random selection of columns
# selected_cols <- sample(n_cols, max_cols_allowed)
# Approach 2: First N largest clusters
selected_cols <- order(colSums(n0_df$heatmap), decreasing = TRUE)[seq(1, max_cols_allowed)]
prefix_text <- ""
if ( n_cols != max_cols_allowed ) {
prefix_text <- paste0("Top ", max_cols_allowed, " ")
}
pheatmap(n0_df$heatmap[, selected_cols],
show_colnames = FALSE,
main = "Orthologue clusters containing accessory proteins",
main = paste0(prefix_text, "Orthologue clusters"),
legend = TRUE,
legend_labels = TRUE,
border_color = "white"
)
pheatmap(n0_df$heatmap,
pheatmap(n0_df$heatmap[, selected_cols],
filename = file.path(outputs_folder, "pangene.matrix.heatmap.pdf"),
show_colnames = FALSE,
main = "Orthologue clusters containing accessory proteins",
main = paste0(prefix_text, "Orthologue clusters"),
legend = TRUE,
legend_labels = TRUE,
border_color = "white"
)
write.csv(x = transform_hogs(n0o), file = file.path(outputs_folder, "pangenome.matrix.csv"), row.names = FALSE)
```


Expand Down
3 changes: 3 additions & 0 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ process {
cpus = { 8 * task.attempt }
time = { 7.days * task.attempt }
}
withName:GENEPALREPORT {
memory = { 20.GB * task.attempt }
}
}

0 comments on commit 496ff62

Please sign in to comment.