Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions 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

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.

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)
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.

💯

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>
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>


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
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.

🌟


</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
)
```
Loading