Skip to content

Commit

Permalink
Fix issue with multiple contigs in coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
lukfor committed Mar 2, 2024
1 parent d88dc17 commit 2d8ce94
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/local/quality_control.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process QUALITY_CONTROL {

publishDir "${params.output_reports}", mode: "copy", pattern: '*.html'
publishDir "${params.output_reports}/multiqc", mode: "copy", pattern: '*.html'

input:
path excluded_samples
Expand All @@ -10,6 +10,6 @@ process QUALITY_CONTROL {
path "*.html"

"""
multiqc .
multiqc . --filename index.html
"""
}
10 changes: 9 additions & 1 deletion modules/local/sample_report.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ process SAMPLE_REPORT {
echo -e "Base Quality\t${params.baseQ}" >> params.txt
echo -e "Map Quality\t${params.mapQ}" >> params.txt
echo -e "Alignment Quality\t${params.alignQ}" >> params.txt
echo -e "Mutserv\t\${MUTSERV_VERSION}" >> params.txt
echo -e "Haplocheck\t\${HAPLOCHECK_VERSION}" >> params.txt
echo -e "Haplogrep\t\${HAPLOGREP_VERSION}" >> params.txt
#TODO: split fwd and reverse? https://bioinformatics.stackexchange.com/questions/8649/how-can-i-calculate-coverage-at-single-bases-using-a-bam-file
# Extract the value of Contig and store it in a variable
contig=`awk '\$2 == "Contig" {print \$3; exit}' "${statistics}"`
echo -e "Contig\tPosition\tCoverage" > coverage.tsv
samtools depth -a ${sample_bam_file} >> coverage.tsv
samtools index ${sample_bam_file}
samtools depth -a ${sample_bam_file} -r \$contig >> coverage.tsv
Rscript -e "require('rmarkdown'); render('${report}',
params = list(
Expand Down
3 changes: 2 additions & 1 deletion reports/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ output:
flexdashboard::flex_dashboard:
orientation: rows
navbar:
- { title: "About", href: "https://mitoverse.i-med.ac.at/#!pages/contact", align: right }
- { title: "MultiQC", target: "_blank", href: "multiqc/index.html" }
- { title: "About", target: "_blank", href: "https://mitoverse.i-med.ac.at/#!pages/contact", align: right }
params:
haplogroups: ../tests/data/report/haplogroups.txt
haplocheck: ../tests/data/report/haplocheck.txt
Expand Down
16 changes: 16 additions & 0 deletions reports/sample.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ variants %>%
mutate(
Variant_Label = link_to_variant(Pos, Ref, Variant)
) %>%
arrange(Pos, Ref, Variant) %>%
select("Variant_Label", "VariantLevel", "Type_Label") %>%
datatable(
colnames=c("Variant", "Level", ""),
Expand All @@ -206,3 +207,18 @@ variants %>%
class = 'cell-border stripe'
)
```


### Paramteres and Software Version

```{r}
pipeline_params %>%
kable()
```


---

<small>
This report has been created with **[mtDNA-Server 2](https://mitoverse.i-med.ac.at)**, a nextflow pipeline developed by [Sebastian Schönherr](mailto:[email protected]), [Hansi Weissensteiner](mailto:[email protected]) and [Lukas Forer](mailto:[email protected]), Institute of Genetic Epidemiology, Medical University of Innsbruck.
</small>
67 changes: 64 additions & 3 deletions tests/mitocalling.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,90 @@
"content": [
"variants.annotated.txt:md5,52dc3737a73bb80cf3a1c8946990c3e4"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T13:11:34.901277407"
},
"Runs with 6 samples provided as testdata with mutect2": {
"content": [
"variants.annotated.txt:md5,d5bcadb427d40ffc53a118bcd9bc5aae",
{
"tasksFailed": 0,
"tasksCount": 28,
"tasksSucceeded": 28
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T14:11:30.627373"
},
"Runs with single BAM file and mutserve": {
"content": [
"variants.annotated.txt:md5,ee00b39fc49e1f34e6affab00368181f"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T13:09:45.954385792"
},
"Runs with BAM file including different header contigs": {
"content": [
"variants.annotated.txt:md5,a5345c7718757ded27246ae342b5f25b"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T13:10:28.843431233"
},
"Runs with two files and one goes through QC": {
"content": [
"variants.annotated.txt:md5,ef402762b03356a208583e434d96dfa3",
{
"tasksFailed": 0,
"tasksCount": 10,
"tasksSucceeded": 10
"tasksCount": 12,
"tasksSucceeded": 12
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T14:02:05.743122"
},
"Runs with 6 samples provided as testdata with fusion": {
"content": [
"variants.annotated.txt:md5,5043504edb7e0bf5492fafb63e64daa6",
{
"tasksFailed": 0,
"tasksCount": 40,
"tasksSucceeded": 40
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T14:15:40.016064"
},
"Runs with 6 samples provided as testdata with mutserve": {
"content": [
"variants.annotated.txt:md5,d383a9cb2a1f46c96770390c61002bfc",
{
"tasksFailed": 0,
"tasksCount": 30,
"tasksSucceeded": 30
}
],
"timestamp": "2024-03-02T13:12:29.64633988"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.3"
},
"timestamp": "2024-03-02T14:08:07.908258"
}
}

0 comments on commit 2d8ce94

Please sign in to comment.