diff --git a/modules/gatk4/intervallisttobed/main.nf b/modules/gatk4/intervallisttobed/main.nf new file mode 100644 index 00000000..24d20be1 --- /dev/null +++ b/modules/gatk4/intervallisttobed/main.nf @@ -0,0 +1,41 @@ +process GATK4_INTERVALLISTTOBED { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.5.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + + input: + tuple val(meta), path(interval) + + output: + tuple val(meta), path("*.bed"), emit: bed + 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}" + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK IntervalListToBed] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" IntervalListToBed \\ + --INPUT ${interval} \\ + --OUTPUT ${prefix}.bed \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/intervallisttobed/meta.yml b/modules/gatk4/intervallisttobed/meta.yml new file mode 100644 index 00000000..90b78c05 --- /dev/null +++ b/modules/gatk4/intervallisttobed/meta.yml @@ -0,0 +1,41 @@ +name: gatk4_intervallisttobed +keywords: + - interval + - bed +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ["BSD-3-clause"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - interval: + type: file + description: Interval list + pattern: "*.{interval,interval_list}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file + pattern: "*.bed" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@FriederikeHanssen" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 3825a873..95822741 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -604,6 +604,10 @@ gatk4/indexfeaturefile: - modules/gatk4/indexfeaturefile/** - tests/modules/gatk4/indexfeaturefile/** +gatk4/intervallisttobed: + - modules/gatk4/intervallisttobed/** + - tests/modules/gatk4/intervallisttobed/** + gatk4/intervallisttools: - modules/gatk4/intervallisttools/** - tests/modules/gatk4/intervallisttools/** diff --git a/tests/modules/gatk4/intervallisttobed/main.nf b/tests/modules/gatk4/intervallisttobed/main.nf new file mode 100644 index 00000000..2963979f --- /dev/null +++ b/tests/modules/gatk4/intervallisttobed/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_INTERVALLISTTOBED } from '../../../../modules/gatk4/intervallisttobed/main.nf' + +workflow test_gatk4_intervallisttobed { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_21_interval_list'], checkIfExists: true) + ] + + GATK4_INTERVALLISTTOBED ( input ) +} diff --git a/tests/modules/gatk4/intervallisttobed/nextflow.config b/tests/modules/gatk4/intervallisttobed/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/gatk4/intervallisttobed/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/gatk4/intervallisttobed/test.yml b/tests/modules/gatk4/intervallisttobed/test.yml new file mode 100644 index 00000000..9e6e38c5 --- /dev/null +++ b/tests/modules/gatk4/intervallisttobed/test.yml @@ -0,0 +1,8 @@ +- name: gatk4 intervallisttobed + command: nextflow run ./tests/modules/gatk4/intervallisttobed -entry test_gatk4_intervallisttobed -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/intervallisttobed/nextflow.config + tags: + - gatk4 + - gatk4/intervallisttobed + files: + - path: output/gatk4/test.bed + md5sum: 9046675d01199fbbee79f2bc1c5dce52