-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
64 lines (45 loc) · 1.45 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
workflow {
Channel
.of(file(params.fastq_1, type: "file", checkIfExists: true))
.set { fastq_1_ch }
Channel
.of(file(params.fastq_2, type: "file", checkIfExists: true))
.set { fastq_2_ch }
etoki_prepare(params.sample_uuid, fastq_1_ch, fastq_2_ch) | etoki_assemble
}
process etoki_prepare {
label 'process_medium'
publishDir "${params.out_dir}/${sample_uuid}/trimmed_reads/", mode: 'copy', overwrite: true
container 'biowilko/etoki:1.2.1'
input:
val sample_uuid
path fastq_1
path fastq_2
output:
val sample_uuid
path "${sample_uuid}_L1_R1.fastq.gz"
path "${sample_uuid}_L1_R2.fastq.gz"
script:
"""
EToKi.py prepare --pe ${fastq_1},${fastq_2} -p ${sample_uuid} --n_cpu ${task.cpus} --max_base ${params.max_bases}
"""
}
process etoki_assemble {
label 'process_medium'
publishDir "${params.out_dir}/${sample_uuid}/assembly/", mode: "copy", pattern: "${sample_uuid}.result.fasta", overwrite: true
container 'biowilko/etoki:1.2.1'
errorStrategy { task.exitStatus == 255 ? "ignore" : "terminate" }
input:
val sample_uuid
path fastq_1
path fastq_2
output:
path "${sample_uuid}.result.fasta"
script:
"""
EToKi.py assemble --pe ${fastq_1},${fastq_2} -p ${sample_uuid} --n_cpu ${task.cpus}
if [ -f ${sample_uuid}/etoki.fasta ]; then
mv ${sample_uuid}/etoki.fasta ${sample_uuid}.result.fasta
fi
"""
}