-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsourmash.nf
78 lines (59 loc) · 1.34 KB
/
sourmash.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
77
78
#!/usr/bin/env nextflow
params.reads = 'data/*.fq'
params.adapt = 'data/adapters.fasta'
files = Channel.fromPath(params.reads)
adapters = file(params.adapt)
process adapter_trimming {
input:
val file from files
file 'adapters.fasta' from adapters
output:
file "*.fastq" into adapt_trimmed
script:
"""
scythe -q sanger -a adapters.fasta -o "${file.baseName}.fastq" $file
"""
}
process quality_trimming {
input:
file fastq from adapt_trimmed
output:
file "*" into trimmed
script:
"""
sickle se -f $fastq -t sanger -o "${fastq.baseName}" -q 20
"""
}
process sourmash_compute {
input:
file trimmed
output:
file "*.sig" into sourmash_compute
script:
"""
sourmash compute -f $trimmed
"""
}
process sourmash_compare {
input:
file '*.sig' from sourmash_compute.toList()
output:
file "cmp" into sourmash_compare
file "cmp.labels.txt" into labels
script:
"""
sourmash compare *.sig -o cmp
"""
}
process sourmash_plot {
publishDir 'results'
input:
file "cmp" from sourmash_compare
file "cmp.labels.txt" from labels
output:
file "*.png" into plots
script:
"""
sourmash plot cmp --labels
"""
}