From 2959b4ba070d138d1577acc48d35cc669fbef972 Mon Sep 17 00:00:00 2001 From: Chris Cheshire Date: Fri, 29 Oct 2021 13:22:17 +0100 Subject: [PATCH] Bedtools sort add extension choice input (#984) * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * Added extension input for bedtools sort * whitespace * Updated docs Co-authored-by: Sviatoslav Sidorov Co-authored-by: Svyatoslav Sidorov --- modules/bedtools/sort/main.nf | 11 ++++++----- modules/bedtools/sort/meta.yml | 19 +++++++++++++------ tests/modules/bedtools/sort/main.nf | 2 +- tests/modules/bedtools/sort/test.yml | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/modules/bedtools/sort/main.nf b/modules/bedtools/sort/main.nf index bdba3376..4a51c4b2 100644 --- a/modules/bedtools/sort/main.nf +++ b/modules/bedtools/sort/main.nf @@ -19,20 +19,21 @@ process BEDTOOLS_SORT { } input: - tuple val(meta), path(bed) + tuple val(meta), path(intervals) + val extension output: - tuple val(meta), path('*.bed'), emit: bed - path "versions.yml" , emit: versions + tuple val(meta), path("*.${extension}"), emit: sorted + path "versions.yml" , emit: versions script: def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ sort \\ - -i $bed \\ + -i $intervals \\ $options.args \\ - > ${prefix}.bed + > ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: diff --git a/modules/bedtools/sort/meta.yml b/modules/bedtools/sort/meta.yml index 5b8b41d7..c7b1b098 100644 --- a/modules/bedtools/sort/meta.yml +++ b/modules/bedtools/sort/meta.yml @@ -15,20 +15,26 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bed: + - intervals: type: file - description: Input BED file - pattern: "*.{bed}" + description: BED/BEDGRAPH + pattern: "*.{bed|bedGraph}" + + - extension: + type: string + description: Extension of the output file (e. g., ".bg", ".bedgraph", ".txt", ".tab", etc.) It is set arbitrarily by the user and corresponds to the file format which depends on arguments. output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bed: + + - sorted: type: file - description: Sorted BED file - pattern: "*.{bed}" + description: Sorted output file + pattern: "*.${extension}" + - versions: type: file description: File containing software versions @@ -37,3 +43,4 @@ authors: - "@Emiller88" - "@sruthipsuresh" - "@drpatelh" + - "@chris-cheshire" diff --git a/tests/modules/bedtools/sort/main.nf b/tests/modules/bedtools/sort/main.nf index ad1a3df4..b5d34e2f 100644 --- a/tests/modules/bedtools/sort/main.nf +++ b/tests/modules/bedtools/sort/main.nf @@ -9,5 +9,5 @@ workflow test_bedtools_sort { file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] - BEDTOOLS_SORT ( input ) + BEDTOOLS_SORT ( input, "testext" ) } diff --git a/tests/modules/bedtools/sort/test.yml b/tests/modules/bedtools/sort/test.yml index ceb25f7d..1dd04507 100644 --- a/tests/modules/bedtools/sort/test.yml +++ b/tests/modules/bedtools/sort/test.yml @@ -4,5 +4,5 @@ - bedtools - bedtools/sort files: - - path: ./output/bedtools/test_out.bed + - path: ./output/bedtools/test_out.testext md5sum: fe4053cf4de3aebbdfc3be2efb125a74