-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add markdown script for CNV report generation #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cnv_report
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 😊
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? 🤔
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,91 @@ | ||||||
| --- | ||||||
| title: "CNV Report" | ||||||
| date: "`r format(Sys.time(), '%Y-%m-%d %H:%M %Z')`" | ||||||
| output: | ||||||
| html_document: | ||||||
| theme: cosmo | ||||||
| highlight: tango | ||||||
| code_folding: hide | ||||||
| toc: false | ||||||
| params: | ||||||
| cnv_gene: "" | ||||||
| cnv_segment: "" | ||||||
| --- | ||||||
|
|
||||||
| ```{r setup, include=FALSE} | ||||||
| library(readr) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||||||
| library(DT) | ||||||
| knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE) | ||||||
| ``` | ||||||
|
|
||||||
|
|
||||||
| This report provides an interactive view of Copy Number Variation (CNV) results at both the gene and segment level. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| <details> | ||||||
| <summary><strong>Input data (click to expand)</strong></summary> | ||||||
|
|
||||||
| - **Gene-level CNV file:** `r params$cnv_gene` | ||||||
| - **Segment-level CNV file:** `r params$cnv_segment` | ||||||
|
|
||||||
| </details> | ||||||
|
|
||||||
|
|
||||||
| <details> | ||||||
| <summary><strong>How to use the yables (click to expand)</strong></summary> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The tables below allow sorting and filtering. | ||||||
|
|
||||||
| **Sorting** - Click any column header to sort ascending or descending. | ||||||
|
|
||||||
| **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$` | ||||||
|
Comment on lines
+42
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🌟 |
||||||
|
|
||||||
| </details> | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
|
|
||||||
| ```{r load-data} | ||||||
| cnv_gene <- read_tsv(params$cnv_gene) | ||||||
| cnv_segment <- read_tsv(params$cnv_segment) | ||||||
| ``` | ||||||
|
|
||||||
| ## Gene-level CNV results | ||||||
|
|
||||||
| This table summarizes CNV calls at the gene level. | ||||||
|
|
||||||
| ```{r gene-table} | ||||||
| datatable( | ||||||
| cnv_gene, | ||||||
| filter = "top", | ||||||
| options = list( | ||||||
| pageLength = 10, | ||||||
| autoWidth = TRUE, | ||||||
| search = list(regex = TRUE) | ||||||
| ), | ||||||
| rownames = FALSE | ||||||
| ) | ||||||
| ``` | ||||||
|
|
||||||
|
|
||||||
| ## Segment-level CNV results | ||||||
|
|
||||||
| This table summarizes CNV calls at the genomic segment level. | ||||||
|
|
||||||
| ```{r segment-table} | ||||||
| datatable( | ||||||
| cnv_segment, | ||||||
| filter = "top", | ||||||
| options = list( | ||||||
| pageLength = 10, | ||||||
| autoWidth = TRUE, | ||||||
| search = list(regex = TRUE) | ||||||
| ), | ||||||
| rownames = FALSE | ||||||
| ) | ||||||
| ``` | ||||||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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! 😉