From 1a4ab76618a2269ee653aefff8a5ee1f855e5f83 Mon Sep 17 00:00:00 2001 From: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> Date: Tue, 14 Jun 2022 16:02:18 +0200 Subject: [PATCH] new module rtgtools/pedfilter (#1777) * new module rtgtools/pedfilter * removed checksum due to the presence of a date in the file --- modules/rtgtools/pedfilter/main.nf | 37 +++++++++++++++ modules/rtgtools/pedfilter/meta.yml | 45 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/rtgtools/pedfilter/main.nf | 15 +++++++ .../rtgtools/pedfilter/nextflow.config | 5 +++ tests/modules/rtgtools/pedfilter/test.yml | 7 +++ 6 files changed, 113 insertions(+) create mode 100644 modules/rtgtools/pedfilter/main.nf create mode 100644 modules/rtgtools/pedfilter/meta.yml create mode 100644 tests/modules/rtgtools/pedfilter/main.nf create mode 100644 tests/modules/rtgtools/pedfilter/nextflow.config create mode 100644 tests/modules/rtgtools/pedfilter/test.yml diff --git a/modules/rtgtools/pedfilter/main.nf b/modules/rtgtools/pedfilter/main.nf new file mode 100644 index 00000000..9045b5b8 --- /dev/null +++ b/modules/rtgtools/pedfilter/main.nf @@ -0,0 +1,37 @@ +process RTGTOOLS_PEDFILTER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::rtg-tools=3.12.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rtg-tools:3.12.1--hdfd78af_0': + 'quay.io/biocontainers/rtg-tools:3.12.1--hdfd78af_0' }" + + input: + tuple val(meta), path(ped) + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + 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}" + + """ + rtg pedfilter \\ + $ped \\ + --vcf \\ + > ${prefix}.vcf + + gzip ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rtgtools: \$(echo \$(rtg version | head -n 1 | awk '{print \$4}')) + END_VERSIONS + """ +} diff --git a/modules/rtgtools/pedfilter/meta.yml b/modules/rtgtools/pedfilter/meta.yml new file mode 100644 index 00000000..826f8558 --- /dev/null +++ b/modules/rtgtools/pedfilter/meta.yml @@ -0,0 +1,45 @@ +name: "rtgtools_pedfilter" +description: Converts a PED file to VCF headers +keywords: + - rtgtools + - pedfilter + - vcf +tools: + - "rtgtools": + description: "RealTimeGenomics Tools -- Utilities for accurate VCF comparison and manipulation" + homepage: "https://www.realtimegenomics.com/products/rtg-tools" + documentation: "https://github.com/RealTimeGenomics/rtg-tools" + tool_dev_url: "https://github.com/RealTimeGenomics/rtg-tools" + doi: "" + licence: "['BSD']" + +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ped: + type: file + description: PED file + pattern: "*.ped" + +output: + #Only when we have meta + - 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" + - vcf: + type: file + description: VCF file containing only headers fetched from the PED file + pattern: "*.vcf.gz" + +authors: + - "@nvnieuwk" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index c136b58c..0e82d01a 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1739,6 +1739,10 @@ rseqc/tin: - modules/rseqc/tin/** - tests/modules/rseqc/tin/** +rtgtools/pedfilter: + - modules/rtgtools/pedfilter/** + - tests/modules/rtgtools/pedfilter/** + rtgtools/vcfeval: - modules/rtgtools/vcfeval/** - tests/modules/rtgtools/vcfeval/** diff --git a/tests/modules/rtgtools/pedfilter/main.nf b/tests/modules/rtgtools/pedfilter/main.nf new file mode 100644 index 00000000..a8361e6d --- /dev/null +++ b/tests/modules/rtgtools/pedfilter/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { RTGTOOLS_PEDFILTER } from '../../../../modules/rtgtools/pedfilter/main.nf' + +workflow test_rtgtools_pedfilter { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['justhusky_ped'], checkIfExists: true) + ] + + RTGTOOLS_PEDFILTER ( input ) +} diff --git a/tests/modules/rtgtools/pedfilter/nextflow.config b/tests/modules/rtgtools/pedfilter/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/rtgtools/pedfilter/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/rtgtools/pedfilter/test.yml b/tests/modules/rtgtools/pedfilter/test.yml new file mode 100644 index 00000000..cb0c29a3 --- /dev/null +++ b/tests/modules/rtgtools/pedfilter/test.yml @@ -0,0 +1,7 @@ +- name: rtgtools pedfilter test_rtgtools_pedfilter + command: nextflow run ./tests/modules/rtgtools/pedfilter -entry test_rtgtools_pedfilter -c ./tests/config/nextflow.config -c ./tests/modules/rtgtools/pedfilter/nextflow.config + tags: + - rtgtools/pedfilter + - rtgtools + files: + - path: output/rtgtools/test.vcf.gz