diff --git a/modules/bbmap/pileup/main.nf b/modules/bbmap/pileup/main.nf new file mode 100644 index 00000000..9b96aa33 --- /dev/null +++ b/modules/bbmap/pileup/main.nf @@ -0,0 +1,36 @@ +process BBMAP_PILEUP { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bbmap=38.92 bioconda::samtools=1.13 pigz=2.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' : + 'quay.io/biocontainers/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.stats.txt"), emit: stats + tuple val(meta), path("*.hist.txt") , emit: hist + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + pileup.sh \\ + -Xmx${task.memory.toGiga()}g \\ + in=${bam} \\ + out=${prefix}.coverage.stats.txt \\ + hist=${prefix}.coverage.hist.txt \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ +} diff --git a/modules/bbmap/pileup/meta.yml b/modules/bbmap/pileup/meta.yml new file mode 100644 index 00000000..c5a872f9 --- /dev/null +++ b/modules/bbmap/pileup/meta.yml @@ -0,0 +1,47 @@ +name: bbmap_pileup +## TODO nf-core: Add a description of the module and list keywords +description: write your description here +keywords: + - sort +tools: + - bbmap: + ## TODO nf-core: Add a description and other details for the software below + description: BBMap is a short read aligner, as well as various other bioinformatic tools. + homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ + documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ + tool_dev_url: None + doi: "" + licence: ['UC-LBL license (see package)'] + +## TODO nf-core: Add a description of all of the variables used as input +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + ## TODO nf-core: Delete / customise this example input + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + +## TODO nf-core: Add a description of all of the variables used as output +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + ## TODO nf-core: Delete / customise this example output + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + +authors: + - "@Emiller88" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 95822741..20b81c67 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -82,6 +82,10 @@ bbmap/index: - modules/bbmap/index/** - tests/modules/bbmap/index/** +bbmap/pileup: + - modules/bbmap/pileup/** + - tests/modules/bbmap/pileup/** + bcftools/concat: - modules/bcftools/concat/** - tests/modules/bcftools/concat/** diff --git a/tests/modules/bbmap/pileup/main.nf b/tests/modules/bbmap/pileup/main.nf new file mode 100644 index 00000000..3ebfc8c5 --- /dev/null +++ b/tests/modules/bbmap/pileup/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BBMAP_PILEUP } from '../../../../modules/bbmap/pileup/main.nf' + +workflow test_bbmap_pileup { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + BBMAP_PILEUP ( input ) +} diff --git a/tests/modules/bbmap/pileup/nextflow.config b/tests/modules/bbmap/pileup/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bbmap/pileup/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bbmap/pileup/test.yml b/tests/modules/bbmap/pileup/test.yml new file mode 100644 index 00000000..2fb2d2d1 --- /dev/null +++ b/tests/modules/bbmap/pileup/test.yml @@ -0,0 +1,10 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml bbmap/pileup +- name: bbmap pileup + command: nextflow run ./tests/modules/bbmap/pileup -entry test_bbmap_pileup -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/pileup/nextflow.config + tags: + - bbmap + - bbmap/pileup + files: + - path: output/bbmap/test.bam + md5sum: e667c7caad0bc4b7ac383fd023c654fc