diff --git a/modules/deeptools/bamcoverage/main.nf b/modules/deeptools/bamcoverage/main.nf new file mode 100644 index 00000000..83e3ffeb --- /dev/null +++ b/modules/deeptools/bamcoverage/main.nf @@ -0,0 +1,37 @@ +process DEEPTOOLS_BAMCOVERAGE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::deeptools=3.5.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0': + 'quay.io/biocontainers/deeptools:3.5.1--py_0' }" + + input: + tuple val(meta), path(input), path(input_index) + + output: + tuple val(meta), path("*.bigWig") , emit: bigwig, optional: true + tuple val(meta), path("*.bedgraph") , emit: bedgraph, optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}.bigWig" + + """ + bamCoverage \ + --bam $input \ + $args \ + --numberOfProcessors ${task.cpus} \ + --outFileName ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(bamCoverage --version | sed -e "s/bamCoverage //g") + END_VERSIONS + """ +} diff --git a/modules/deeptools/bamcoverage/meta.yml b/modules/deeptools/bamcoverage/meta.yml new file mode 100644 index 00000000..d0590b2a --- /dev/null +++ b/modules/deeptools/bamcoverage/meta.yml @@ -0,0 +1,49 @@ +name: deeptools_bamcoverage +description: This tool takes an alignment of reads or fragments as input (BAM file) and generates a coverage track (bigWig or bedGraph) as output. +keywords: + - sort +tools: + - deeptools: + description: A set of user-friendly tools for normalization and visualzation of deep-sequencing data + homepage: https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html + documentation: https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html + tool_dev_url: https://github.com/deeptools/deepTools/ + doi: "https://doi.org/10.1093/nar/gkw257" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram}" + - input_index: + type: file + description: BAM/CRAM index file + pattern: "*.{bai,crai}" + +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" + - bigWig: + type: file + description: BigWig file + pattern: "*.bigWig" + - bedgraph: + type: file + description: Bedgraph file + pattern: "*.bedgraph" + +authors: + - "@FriederikeHanssen" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 95822741..d9fa981e 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -400,6 +400,10 @@ deeparg/predict: - modules/deeparg/predict/** - tests/modules/deeparg/predict/** +deeptools/bamcoverage: + - modules/deeptools/bamcoverage/** + - tests/modules/deeptools/bamcoverage/** + deeptools/computematrix: - modules/deeptools/computematrix/** - tests/modules/deeptools/computematrix/** diff --git a/tests/modules/deeptools/bamcoverage/main.nf b/tests/modules/deeptools/bamcoverage/main.nf new file mode 100644 index 00000000..fb5c1c2d --- /dev/null +++ b/tests/modules/deeptools/bamcoverage/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DEEPTOOLS_BAMCOVERAGE } from '../../../../modules/deeptools/bamcoverage/main.nf' + +workflow test_deeptools_bamcoverage_bam { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + + DEEPTOOLS_BAMCOVERAGE ( input ) +} + +workflow test_deeptools_bamcoverage_cram { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + + DEEPTOOLS_BAMCOVERAGE ( input ) +} diff --git a/tests/modules/deeptools/bamcoverage/nextflow.config b/tests/modules/deeptools/bamcoverage/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/deeptools/bamcoverage/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/deeptools/bamcoverage/test.yml b/tests/modules/deeptools/bamcoverage/test.yml new file mode 100644 index 00000000..736c2e61 --- /dev/null +++ b/tests/modules/deeptools/bamcoverage/test.yml @@ -0,0 +1,21 @@ +- name: deeptools bamcoverage test_deeptools_bamcoverage_bam + command: nextflow run tests/modules/deeptools/bamcoverage -entry test_deeptools_bamcoverage_bam -c tests/config/nextflow.config + tags: + - deeptools + - deeptools/bamcoverage + files: + - path: output/deeptools/test.bigWig + md5sum: 95fe9383a9e6c02aea6b785cf074274f + - path: output/deeptools/versions.yml + md5sum: 68c94e73b7a8c0935578bad61fea54c1 + +- name: deeptools bamcoverage test_deeptools_bamcoverage_cram + command: nextflow run tests/modules/deeptools/bamcoverage -entry test_deeptools_bamcoverage_cram -c tests/config/nextflow.config + tags: + - deeptools + - deeptools/bamcoverage + files: + - path: output/deeptools/test.bigWig + md5sum: 95fe9383a9e6c02aea6b785cf074274f + - path: output/deeptools/versions.yml + md5sum: 665bbd2979c49bf3974a24bd44a88e94