From a9aa590f007574090208bc3b946276c88c94acc8 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 23 Sep 2023 16:05:02 -0500 Subject: [PATCH] refactor: Move MINIMAP2 module to separate file --- main.nf | 34 +--------------------------------- modules/minimap2/main.nf | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 modules/minimap2/main.nf diff --git a/main.nf b/main.nf index 3d938fa..b80f998 100755 --- a/main.nf +++ b/main.nf @@ -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' diff --git a/modules/minimap2/main.nf b/modules/minimap2/main.nf new file mode 100644 index 0000000..610028b --- /dev/null +++ b/modules/minimap2/main.nf @@ -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" + """ +}