-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
78 lines (54 loc) · 1.51 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
77
#!/usr/bin/env nextflow
readsQueue = Channel.fromFilePairs( ['./*_L001_R{1,2}_001.fastq.gz','./*_{1,2}.fastq','./*_{1,2}.fastq.gz'] )
params.cpus = 8
params.memory = 15
seqycleanforks = params.cpus - 1
resultsDir=workflow.launchDir+"/results"
process runSeqyclean {
storeDir resultsDir+'/cleanedreads'
stageInMode = 'copy'
maxForks = seqycleanforks
input:
set id, file(fastq_names) from readsQueue
output:
set val(id), file("${id}_clean_PE1.fastq.gz"), file("${id}_clean_PE2.fastq.gz") into cleanreadsQueue
"""
seqyclean -gz -minlen 25 -qual -c /Adapters_plus_PhiX_174.fasta -1 ${fastq_names[0]} -2 ${fastq_names[1]} -o ${id}_clean
"""
}
process runShovill {
storeDir resultsDir+'/shovill'
stageInMode = 'copy'
maxForks = 1
input:
set id, file(R1), file(R2) from cleanreadsQueue
output:
set val(id), file("${id}.fasta") into quastQueue, legstaQueue
"""
shovill --outdir . --force --cpus ${params.cpus} --ram ${params.memory} --gsize 3400000 --R1 ${R1} --R2 ${R2};
mv contigs.fa ${id}.fasta
"""
}
process runQuast {
storeDir resultsDir+'/quast'
stageInMode = 'copy'
input:
file assemblies from quastQueue.collect()
output:
file "report.tsv" into quastResults
file "report.html" into quastReports
"""
quast.py -o . -t ${params.cpus} ${assemblies}
"""
}
process runLegsta {
storeDir resultsDir
stageInMode = 'copy'
input:
file assemblies from legstaQueue.collect()
output:
file "legsta_results.tsv" into legstaResults
"""
legsta *.fasta > legsta_results.tsv
"""
}