Skip to content

feat: Add markdown script for CNV report generation#89

Open
fevac wants to merge 1 commit into
cnv_reportfrom
add_cnv_rmarkdown
Open

feat: Add markdown script for CNV report generation#89
fevac wants to merge 1 commit into
cnv_reportfrom
add_cnv_rmarkdown

Conversation

@fevac
Copy link
Copy Markdown
Collaborator

@fevac fevac commented May 5, 2026

This script is part of https://github.com/Clinical-Genomics/MTP-oncoflow/issues/34

Added

  • Markdown script for CNV report generation, that takes two CNV tables (at gene and segment level) and creates a interactive report where those tables are searchable and sortable.

Notes

  • This PR displays tables as-is. The report will need to be optimised once we know which values are relevant to display after assessing the verification cases.

  • Standalone script usage:

Rscript -e "rmarkdown::render('cnv_report.Rmd', params = list(cnv_gene = 'path/to/cnv_gene.tsv', cnv_segment = 'path/to/cnv_segment.tsv'), output_file = 'cnv_report.html')"

@fevac fevac requested a review from a team as a code owner May 5, 2026 11:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

PR checklist

  • Fill in description of the PR and link to any relevant issues.
  • If you've fixed a bug, added a subworkflow or any other code that should be tested, add tests!
  • If you've added a new tool, update citations according to the instructions under Adding Citations.
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • README.md is updated (including authors/contributors).

See Contributing Guidelines for more details on how to contribute according to pipeline conventions.

Comment thread assets/cnv_report.Rmd
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Changelog will be updated as part of parent issue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the CI checks might fail, you should still be able to merge to your feature branch since it's not a protected branch! 😉

Copy link
Copy Markdown
Contributor

@fellen31 fellen31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Comment thread assets/cnv_report.Rmd


<details>
<summary><strong>How to use the yables (click to expand)</strong></summary>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<summary><strong>How to use the yables (click to expand)</strong></summary>
<summary><strong>How to use the tables (click to expand)</strong></summary>

Comment thread assets/cnv_report.Rmd
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this script is to be used within a module, I would put this script within the module: https://docs.seqera.io/nextflow/modules/developing-modules#resources 😊

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious: How would this work if we were to use a shared module, like nf-co.re/modules/rmarkdownnotebook? 🤔
Do you have any idea @fellen31 ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure...old way of doing things was to put all scripts in a shared ./bin/ folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah it seems that the module itself receives the path to the file as an input, so I guess it doesn't really matter where the file is located.

But otherwise, putting it in a shared ./bin/ directory would probably be the way to go since nextflow will automatically detect it there, as far as I understand!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's only if the script is to be used within the script: block (and not as an input file). If it is actually an input, then I guess assets is fine.

Comment thread assets/cnv_report.Rmd
---

```{r setup, include=FALSE}
library(readr)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Comment thread assets/cnv_report.Rmd
Comment on lines +42 to +46
**Filtering** - Use the boxes at the top of each column to filter results. The tables support **regular expression (regex)** search:

- Exact match (recommended for genes): `^TP53$` → matches only TP53
- Starts with: `^BRCA`
- Ends with: `TP53$`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌟

Copy link
Copy Markdown
Contributor

@kristinebilgrav kristinebilgrav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@mathiasbio
Copy link
Copy Markdown
Contributor

A small thing I noticed when looking at the example report was that the Gene column search was a little buggy. The filtering seemed to work but the searchbar didn't display the genename you search for. But maybe that can be addressed later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants