From eb4454674dc8a3ffe27f2ed756d985c6f3b9a956 Mon Sep 17 00:00:00 2001 From: Lukas Forer Date: Sat, 2 Mar 2024 11:02:05 +0100 Subject: [PATCH] Add contamination status to summary table and commit snapshots --- reports/report.Rmd | 21 ++++++++++++-- tests/mitocalling.nf.test.snap | 50 +++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/reports/report.Rmd b/reports/report.Rmd index 642ccda..0164a8c 100644 --- a/reports/report.Rmd +++ b/reports/report.Rmd @@ -134,11 +134,21 @@ Row colors <- c("#28a745", "#dc3545") names(colors) <- c("PASSED", "FAILED") +colors_contamination <- c("#dddddd","#28a745", "#dc3545") +names(colors_contamination) <- c("-", "NO", "YES") + statistics %>% - mutate (Sample_Link = link_to_sample(Sample_Label)) %>% - select("Sample_Link", "MeanDepth", "CoveragePercentage", "CoveredBases", "MeanBaseQuality", "MeanMapQuality", "qc") %>% + mutate ( + Sample_Link = link_to_sample(Sample_Label), + contamination = case_when( + qc == "FAILED" ~ "-", + Sample_Label %in% contaminated_samples$Sample_Label ~ "YES", + TRUE ~ "NO" + ) + ) %>% + select("Sample_Link", "MeanDepth", "CoveragePercentage", "CoveredBases", "MeanBaseQuality", "MeanMapQuality", "qc", "contamination") %>% datatable( - colnames=c("Sample", "Mean Coverage", "Covered Bases (%)", "Covered Bases", "Mean Base Quality", "Mean Mapping Quality", "QC"), + colnames=c("Sample", "Mean Coverage", "Covered Bases (%)", "Covered Bases", "Mean Base Quality", "Mean Mapping Quality", "QC", "Cont."), options = list( bPaginate = FALSE ), @@ -149,6 +159,11 @@ statistics %>% 'qc', backgroundColor = styleEqual(c("PASSED", "FAILED"), colors), color = 'white' + ) %>% + formatStyle( + 'contamination', + backgroundColor = styleEqual(c("-", "NO", "YES"), colors_contamination), + color = 'white' ) ``` diff --git a/tests/mitocalling.nf.test.snap b/tests/mitocalling.nf.test.snap index 96415dc..9198b0d 100644 --- a/tests/mitocalling.nf.test.snap +++ b/tests/mitocalling.nf.test.snap @@ -9,6 +9,21 @@ }, "timestamp": "2024-02-26T23:09:58.251860914" }, + "Runs with 6 samples provided as testdata with mutect2": { + "content": [ + "variants.annotated.txt:md5,efeb591e666bd107fbb0ce47898b6304", + { + "tasksFailed": 0, + "tasksCount": 24, + "tasksSucceeded": 24 + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-03-02T10:54:19.802653" + }, "Runs with single BAM file and mutserve": { "content": [ "variants.annotated.txt:md5,aac0aee87ce1a91f8c35264be248b52e" @@ -29,34 +44,49 @@ }, "timestamp": "2024-02-26T23:03:07.470112898" }, - "Runs with 6 samples provided as testdata": { + "Runs with two files and one goes through QC": { "content": [ - "variants.annotated.txt:md5,efeb591e666bd107fbb0ce47898b6304", + "variants.annotated.txt:md5,3946a3bd26ceafe8f61903499bfcbb35", { "tasksFailed": 0, - "tasksCount": 24, - "tasksSucceeded": 24 + "tasksCount": 12, + "tasksSucceeded": 12 } ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-03-01T13:54:57.136897" + "timestamp": "2024-02-28T12:32:40.624776" }, - "Runs with two files and one goes through QC": { + "Runs with 6 samples provided as testdata with fusion": { "content": [ - "variants.annotated.txt:md5,3946a3bd26ceafe8f61903499bfcbb35", + "variants.annotated.txt:md5,b8a0bbf624f5b0ecaac01ca441b50a76", { "tasksFailed": 0, - "tasksCount": 12, - "tasksSucceeded": 12 + "tasksCount": 40, + "tasksSucceeded": 40 } ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-28T12:32:40.624776" + "timestamp": "2024-03-02T10:58:52.06124" + }, + "Runs with 6 samples provided as testdata with mutserve": { + "content": [ + "variants.annotated.txt:md5,5c726eaa61eacfb09c64ebaeb9a2a75a", + { + "tasksFailed": 0, + "tasksCount": 25, + "tasksSucceeded": 25 + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-03-02T10:50:44.742545" } } \ No newline at end of file