-
Notifications
You must be signed in to change notification settings - Fork 0
/
sequeltools.nf
69 lines (50 loc) · 1.41 KB
/
sequeltools.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
#!/usr/bin/env nextflow
params.design = false
params.outDir = false
params.help = false
def helpMessage() {
log.info"""
Usage:
The typical command for running the pipeline is as follows:
sequeltools --design ~/path/to/design.txt
or
sequeltools --design ~/path/to/design.txt --outDir ~/path/to/where/to/save/files
Mandatory arguments:
--design [path] Path to a file with the location of bam files to process, either local or S3.
Facultative arguments
--outDir [path] Path to a diectory to save the bigwig coveage files (can be local or valid S3 location.
""".stripIndent()
}
if (!params.design) {
exit 1, "--design is a required arguments. Use --help to get the full usage."
}
if(!params.outDir){
outDir = "${PWD}/SequelToolQC/"
} else {
outDir = params.outDir
}
if (params.help){
helpMessage()
exit 0
}
process qc {
echo true
label 'sequelQC'
tag '_${id}'
cpus 48
memory '100 GB'
container 'mblanche/sequeltools'
publishDir "${outDir}",
mode: "copy"
input:
path(bam) from Channel
.fromPath(params.design)
.splitText()
output:
tuple id, path("${id}_QC") into out_ch
script:
id = bam.name.toString().take(bam.name.toString().lastIndexOf('.'))
"""
SequelTools.sh -t Q -k -n ${task.cpus} -o ${id}_QC -u <( echo ${bam})
"""
}