-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquick.nf
68 lines (52 loc) · 1.61 KB
/
quick.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
nextflow.preview.dsl=2
tmerge2_path = "/users/rg/jwindsor/tmerge/2.0"
sirvs_path = "/users/rg/jwindsor/tests/tmerge/runner/data/SIRVome.gff"
venv = "/users/rg/jwindsor/venvs/tmerge2/bin/activate"
// These are tmerge 1 values with minReadSupport = 4 and tolerance = 2
sensitivy_threshold = 69.1
precision_threshold = 87.0
include gffToBED from './utils'
process runTmerge2 {
input:
path input
output:
path 'output.gff'
shell:
'''
module load Python
source !{venv}
python !{tmerge2_path}/tmerge.py -i !{input} -o output.gff -t 2 -f 4
'''
}
process runGFFCompare {
input:
path input
output:
stdout()
shell:
'''
gffcompare --strict-match --no-merge -e 0 -d 0 --debug -o !{input.baseName}.gffcompare !{input} -r !{sirvs_path} -T
cat output.gffcompare
'''
}
process checkSensitivityPrecision{
input:
val input
executor "local"
exec:
(transcript_level_row, precision, sensitivity) = (input =~ /.*Transcript level:\s*(\d*\.\d*)\s*\|\s*(\d*.\d*)/)[0]
if ((Float.parseFloat(precision) < precision_threshold) || (Float.parseFloat(sensitivity) < sensitivy_threshold)) {
throw new Exception("Sensitivity and/or precision are not above the required threshold. Sensitivity: $sensitivity, Precision: $precision")
}
}
workflow.onComplete {
if (workflow.success) {
println "Pipeline completed in: $workflow.duration"
}
else {
println "Oops!"
}
}
workflow {
Channel.fromPath("/users/rg/jwindsor/tests/tmerge/runner/data/sirv_reads.gff") | runTmerge2 | runGFFCompare | checkSensitivityPrecision
}