Skip to content

Commit 440732c

Browse files
authored
Merge pull request #49 from ajlail98/dev
Adding coverage summary table
2 parents 8dceb6c + e061982 commit 440732c

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

modules/plot_coverage.nf

+22
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,25 @@ process MULTI_SAMPLE_PLOT {
5454
"""
5555

5656
}
57+
58+
process COVERAGE_SUMMARY {
59+
60+
/* */
61+
62+
publishDir params.alignment, mode: 'copy', overwrite: true
63+
64+
errorStrategy { task.attempt < 3 ? 'retry' : 'ignore' }
65+
maxRetries 2
66+
67+
input:
68+
path collected_passing_cov
69+
70+
output:
71+
path "coverage_summary.tsv", emit: coverage_summary
72+
73+
script:
74+
"""
75+
awk -F"\t" 'BEGIN {print "sample id\tproportion ≥ specified depth"} \$1!="sample id"{print \$1, \$4;}' *.tsv > coverage_summary.tsv
76+
"""
77+
78+
}

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ keywords = [
1919
"virus",
2020
"SARS-CoV-2",
2121
"H5N1",
22-
"influenze",
22+
"influenza",
2323
"haplotyping",
2424
]
2525
classifiers = [

subworkflows/alignment.nf

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ include { ALIGN_WITH_PRESET } from "../modules/minimap2"
55
include { CONVERT_AND_SORT ; SORT_BAM ; INDEX } from "../modules/samtools"
66
include { RASUSA_ALN_DOWNSAMPLING } from "../modules/rasusa"
77
include { MOSDEPTH } from "../modules/mosdepth"
8-
include { PLOT_COVERAGE ; MULTI_SAMPLE_PLOT } from "../modules/plot_coverage"
8+
include { PLOT_COVERAGE ; MULTI_SAMPLE_PLOT ; COVERAGE_SUMMARY } from "../modules/plot_coverage"
9+
910

1011

1112
workflow ALIGNMENT {
@@ -51,6 +52,10 @@ workflow ALIGNMENT {
5152
MOSDEPTH.out.map { _sample_id, files -> files }.flatten().filter { mosdepth_file -> mosdepth_file.toString().endsWith(".per-base.bed") }.collect(),
5253
)
5354

55+
COVERAGE_SUMMARY(
56+
PLOT_COVERAGE.out.passing_cov.collect()
57+
)
58+
5459
emit:
5560
INDEX.out
5661
}

0 commit comments

Comments
 (0)