-
Notifications
You must be signed in to change notification settings - Fork 0
/
jellyFish.nf
71 lines (49 loc) · 1.5 KB
/
jellyFish.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
#!/usr/bin/env nextflow
params.fastqDir = false
params.outDir = false
params.help = false
def helpMessage() {
log.info"""
Usage:
The typical command for running the pipeline is as follows:
jellyfish.nf --coolDir ~/path/to/coolFiles/location --outDir ~/path/to/where/to/save/files
Mandatory arguments:
--fastqDir [path] Name of the a direcoty with cool files (can be local or valid S3 location).
--outDir [path] Path to a diectory to save result files (can be local or valid S3 location).
""".stripIndent()
}
if (params.help){
helpMessage()
exit 0
}
if (!(params.fastqDir && params.outDir)) {
exit 1, "--fastqDir and --outDir are required arguments. Use --help to get the full usage."
}
process jellyfish {
label 'cpu'
container "mblanche/jellyfish"
publishDir "${params.outDir}/jellyfish",
mode: 'copy'
input:
tuple id, path(fq) from Channel.fromFilePairs("${params.fastqDir}/*_{1,2}.fastq.gz")
output:
tuple id, path("*.jf") into histo_ch
script:
"""
jellyfish count -C -m 21 -s 1000M -t ${task.cpus} <(zcat ${fq}) -o ${id}.jf
"""
}
process jellyfish_histo {
label 'cpu'
container "mblanche/jellyfish"
publishDir "${params.outDir}/jf_histo",
mode: 'copy'
input:
tuple id, path(jf) from histo_ch
output:
path("*.histo")
script:
"""
jellyfish histo -t ${task.cpus} ${jf} > ${id}.histo
"""
}