-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.nf
58 lines (44 loc) · 1.53 KB
/
main.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Channel
.fromPath(params.bamFile)
.ifEmpty { exit 1, "--bamFile not specified or no file found at that destination with the suffix .bam. Please make sure to provide the file path correctly}" }
.set { chronicler_bam }
Channel.fromPath(params.vepFile)
.ifEmpty { exit 1, "--vepFile not specified or no file found at that destination with the suffix .html. Please make sure to provide the file path correctly}" }
.set { chronicler_vep }
process genomechronicler {
tag "$bam"
publishDir "$params.outdir/GenomeChronicler", mode: 'copy'
input:
file(bam) from chronicler_bam
file(vep) from chronicler_vep
output:
file("${bam.simpleName}_report.pdf") into html_report
file("*") into all_results
script:
optional_argument = vep.endsWith("no_vepFile.txt") ? '' : "--vepFile ${vep}"
"""
genomechronicler \
--resultsDir '/GenomeChronicler' \
--bamFile $bam \
$optional_argument &> STDERR.txt
cp -r /GenomeChronicler/results/results_${bam.simpleName} .
cp /GenomeChronicler/results/results_${bam.simpleName}/${bam.simpleName}_*.pdf ${bam.simpleName}_report.pdf
mv STDERR.txt results_${bam.simpleName}/
mkdir dump
cp -r /GenomeChronicler/ dump
"""
}
process pdf2html {
tag "$pdf_report"
publishDir "$params.outdir/MultiQC/", mode: 'copy'
container 'darrenmei96/pdf2htmlex-with-msfonts'
input:
file(pdf_report) from html_report
output:
file("multiqc_report.html") into html_result
script:
"""
pdf2htmlEX $pdf_report
mv ${pdf_report.baseName}.html multiqc_report.html
"""
}