-
Notifications
You must be signed in to change notification settings - Fork 0
/
mummer.nf
102 lines (77 loc) · 2.08 KB
/
mummer.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env nextflow
params.fasta = false
params.outDir = false
params.genome = 'hg38'
params.help = false
def helpMessage() {
log.info"""
Usage:
The typical command for running the pipeline is as follows:
mummer --fasta ./path/to/hap1,./path/to/hap2
Mandatory arguments:
--fasta [path] Comma delimited list of paths to bam files
--outDir [path] Path to a diectory to save the bigwig coveage files (can be local or valid S3 location). Default basedir of fasta file
Facultative arguments
--genome [path or def] Id of existing genome or path to a fasta file. Default: hg38
""".stripIndent()
}
if (params.help){
helpMessage()
exit 0
}
if ( !(params.fasta && params.outDir) ) {
exit 1, "--fasta and --outDir are required arguments. Use --help to get the full usage."
}
if (!params.genome =~ /hg19|hg38|mm10|dm3|hg38_hla|susScr11|rn6|GRCg6a/){
Channel
.fromPath("${params.genome}",checkIfExists: true)
.ifEmpty { exit 1, "Genome file ${params.genome} does not exist." }
.set { mm_ref }
} else {
Channel
.fromPath("${HOME}/ebs/genome/nextflow/${params.genome}/${params.genome}.fa/", checkIfExists: true)
.set { mm_ref }
}
process mummer {
label 'cpu'
tag "_${id}"
container 'mblanche/mummer4'
publishDir "${params.outDir}",
mode: 'copy'
input:
path(fasta) from Channel
.from(params.fasta)
.splitCsv()
.flatten()
path(ref) from mm_ref.first()
output:
tuple val(id), path("*.mums") into paf_ch
script:
id = (fasta.name.toString().split(/\./))[0]
"""
nucmer --maxmatch -l 80 -c 100 -t ${task.cpus} -p ${id} ${ref} ${fasta}
"""
}
/*
process plotly {
label 'median'
tag "_${id}"
container 'mblanche/minimap2'
publishDir "${params.outDir}/plots",
mode: 'copy'
input:
tuple id, path(paf) from paf_ch
output:
path "*"
script:
"""
pafCoordsDotPlotly.R \
-i ${paf} \
-o ${id}.plot \
-m 2000 \
-q 500000 \
-k 10 \
-s -t -l -p 12
"""
}
*/