refactor: Move MINIMAP2 module to separate file

This commit is contained in:
Thomas A. Christensen II 2023-09-23 16:05:02 -05:00
parent d12a8b77d8
commit a9aa590f00
Signed by: millironx
GPG key ID: 09335146883990B9
2 changed files with 33 additions and 33 deletions

34
main.nf
View file

@ -2,6 +2,7 @@
include { EFETCH } from './modules/efetch'
include { HAPLINK_VARIANTS } from './modules/haplink/variants'
include { MINIMAP2 } from './modules/minimap2'
include { NANOFILT } form './modules/nanofilt'
include { VIQUAS } from './modules/viquas'
@ -70,39 +71,6 @@ workflow {
)
}
process MINIMAP2 {
cpus 4
memory '8.GB'
container 'quay.io/biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0'
input:
tuple val(prefix), path(reads)
path reference
publishDir "results", mode: 'copy'
output:
tuple val(prefix), path("*.bam"), path("*.bam.bai")
script:
"""
minimap2 \\
-x map-ont \\
--MD \\
--eqx \\
-t ${task.cpus} \\
-a \\
"${reference}" \\
"${reads}" \\
| samtools sort \\
| samtools view \\
-@ ${task.cpus} \\
-b \\
-h \\
-o "${prefix}.bam"
samtools index "${prefix}.bam"
"""
}
process SHORAH_AMPLICON {
label 'process_high'
container 'quay.io/biocontainers/shorah:1.99.2--py38h73782ee_8'

32
modules/minimap2/main.nf Normal file
View file

@ -0,0 +1,32 @@
process MINIMAP2 {
cpus 4
memory '8.GB'
container 'quay.io/biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0'
input:
tuple val(prefix), path(reads)
path reference
publishDir "results", mode: 'copy'
output:
tuple val(prefix), path("*.bam"), path("*.bam.bai")
script:
"""
minimap2 \\
-x map-ont \\
--MD \\
--eqx \\
-t ${task.cpus} \\
-a \\
"${reference}" \\
"${reads}" \\
| samtools sort \\
| samtools view \\
-@ ${task.cpus} \\
-b \\
-h \\
-o "${prefix}.bam"
samtools index "${prefix}.bam"
"""
}