-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.nf
76 lines (65 loc) · 2.71 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
process DEEPARG_PREDICT {
tag "$meta.id"
label 'process_single'
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/deeparg:1.0.4--pyhdfd78af_0' :
'biocontainers/deeparg:1.0.4--pyhdfd78af_0' }"
/*
We have to force docker/singularity to mount a fake file to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos).
Original report: https://github.com/nf-core/funcscan/issues/23
*/
containerOptions {
"${workflow.containerEngine}" == 'singularity' ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' :
"${workflow.containerEngine}" == 'docker' ? '-v $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' :
''
}
input:
tuple val(meta), path(fasta), val(model)
path(db)
output:
tuple val(meta), path("*.align.daa") , emit: daa
tuple val(meta), path("*.align.daa.tsv") , emit: daa_tsv
tuple val(meta), path("*.mapping.ARG") , emit: arg
tuple val(meta), path("*.mapping.potential.ARG"), emit: potential_arg
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION='1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
DATABASE=`find -L $db -type d -name "database" | sed 's/database//'`
# Theano needs a writable space and uses the home directory by default,
# but the latter is not always writable, for instance when Singularity
# is run in --no-home mode
mkdir -p theano
export THEANO_FLAGS="base_compiledir=\$PWD/theano"
deeparg \\
predict \\
$args \\
-i $fasta \\
-o ${prefix} \\
-d \$DATABASE \\
--model $model
cat <<-END_VERSIONS > versions.yml
"${task.process}":
deeparg: $VERSION
END_VERSIONS
"""
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION='1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}.align.daa
touch ${prefix}.align.daa.tsv
touch ${prefix}.mapping.ARG
touch ${prefix}.mapping.potential.ARG
cat <<-END_VERSIONS > versions.yml
"${task.process}":
deeparg: $VERSION
END_VERSIONS
"""
}