-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.nf
More file actions
60 lines (50 loc) · 1.5 KB
/
main.nf
File metadata and controls
60 lines (50 loc) · 1.5 KB
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
59
60
process PRETEXTMAP {
tag "$meta.id"
label 'process_single'
conda "${moduleDir}/environment.yml"
container "quay.io/sanger-tol/pretext:0.0.8-yy5-c1"
input:
tuple val(meta), path(input)
tuple val(meta2), path(fasta), path(fai)
output:
tuple val(meta), path("*.pretext") , emit: pretext
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def VERSION = "0.1.9"
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "--reference ${fasta}" : ""
"""
if [[ $input == *.pairs.gz ]]; then
zcat $input | PretextMap \\
$args \\
-o ${prefix}.pretext
else
samtools \\
view \\
$reference \\
-h \\
$input | PretextMap \\
$args \\
-o ${prefix}.pretext
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
pretextmap: $VERSION
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )
END_VERSIONS
"""
stub:
def VERSION = "0.1.9"
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.pretext
cat <<-END_VERSIONS > versions.yml
"${task.process}":
pretextmap: $VERSION
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}