From 45241c8dc11b979442c75baf660714729d8bf1c3 Mon Sep 17 00:00:00 2001 From: Eva Caceres Date: Tue, 5 May 2026 13:06:36 +0200 Subject: [PATCH] added rmarkdown script --- assets/cnv_report.Rmd | 91 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 assets/cnv_report.Rmd diff --git a/assets/cnv_report.Rmd b/assets/cnv_report.Rmd new file mode 100644 index 0000000..fe03633 --- /dev/null +++ b/assets/cnv_report.Rmd @@ -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) +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. + +--- + +
+Input data (click to expand) + +- **Gene-level CNV file:** `r params$cnv_gene` +- **Segment-level CNV file:** `r params$cnv_segment` + +
+ + +
+How to use the yables (click to expand) + +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$` + +
+ +--- + + +```{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 +) +```