From cdac7b867ef28fa95f853e2f5e00d550d83513b2 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Mon, 27 Mar 2023 12:51:15 +0000 Subject: [PATCH 1/6] Initial commit --- .../nf-core/bam_trim_primers_ivar/main.nf | 36 ++++++++++++++ .../nf-core/bam_trim_primers_ivar/meta.yml | 48 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ .../nf-core/bam_trim_primers_ivar/main.nf | 12 +++++ .../bam_trim_primers_ivar/nextflow.config | 5 ++ .../nf-core/bam_trim_primers_ivar/test.yml | 12 +++++ 6 files changed, 117 insertions(+) create mode 100644 subworkflows/nf-core/bam_trim_primers_ivar/main.nf create mode 100644 subworkflows/nf-core/bam_trim_primers_ivar/meta.yml create mode 100644 tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf create mode 100644 tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config create mode 100644 tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf new file mode 100644 index 00000000000..dc13fab4c00 --- /dev/null +++ b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf @@ -0,0 +1,36 @@ +// TODO nf-core: If in doubt look at other nf-core/subworkflows to see how we are doing things! :) +// https://github.com/nf-core/modules/tree/master/subworkflows +// You can also ask for help via your pull request or on the #subworkflows channel on the nf-core Slack workspace: +// https://nf-co.re/join +// TODO nf-core: A subworkflow SHOULD import at least two modules + +include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' +include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' + +workflow BAM_TRIM_PRIMERS_IVAR { + + take: + // TODO nf-core: edit input (take) channels + ch_bam // channel: [ val(meta), [ bam ] ] + + main: + + ch_versions = Channel.empty() + + // TODO nf-core: substitute modules here for the modules of your subworkflow + + SAMTOOLS_SORT ( ch_bam ) + ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) + + SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) + ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) + + emit: + // TODO nf-core: edit emitted channels + bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] + bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] + csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] + + versions = ch_versions // channel: [ versions.yml ] +} + diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml b/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml new file mode 100644 index 00000000000..ba959dbff3f --- /dev/null +++ b/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml @@ -0,0 +1,48 @@ +name: "bam_trim_primers_ivar" +## TODO nf-core: Add a description of the subworkflow and list keywords +description: Sort SAM/BAM/CRAM file +keywords: + - sort + - bam + - sam + - cram +## TODO nf-core: Add a list of the modules used in the subworkflow +modules: + - samtools/sort + - samtools/index +## TODO nf-core: List all of the variables used as input, including their types and descriptions +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" +## TODO nf-core: List all of the variables used as output, including their types and descriptions +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: BAM/CRAM/SAM samtools index + pattern: "*.{bai,crai,sai}" + - csi: + type: file + description: CSI samtools index + pattern: "*.csi" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@Joon-Klaps" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index d466196afc9..ccb41d96ae4 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -3060,6 +3060,10 @@ subworkflows/bam_stats_samtools: - subworkflows/nf-core/bam_stats_samtools/** - tests/subworkflows/nf-core/bam_stats_samtools/** +subworkflows/bam_trim_primers_ivar: + - subworkflows/nf-core/bam_trim_primers_ivar/** + - tests/subworkflows/nf-core/bam_trim_primers_ivar/** + subworkflows/bcl_demultiplex: - subworkflows/nf-core/bcl_demultiplex/** - tests/subworkflows/nf-core/bcl_demultiplex/** diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf b/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf new file mode 100644 index 00000000000..08742423e5e --- /dev/null +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAM_TRIM_PRIMERS_IVAR } from '../../../../subworkflows/nf-core/bam_trim_primers_ivar/main.nf' + +workflow test_bam_trim_primers_ivar { + + input = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + + BAM_TRIM_PRIMERS_IVAR ( input ) +} diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config b/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config new file mode 100644 index 00000000000..8730f1c4b93 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml b/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml new file mode 100644 index 00000000000..39821bcf693 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml @@ -0,0 +1,12 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core subworkflows create-test-yml +- name: "bam_trim_primers_ivar" + command: nextflow run ./tests/subworkflows/nf-core/bam_trim_primers_ivar -entry test_bam_trim_primers_ivar -c ./tests/config/nextflow.config + tags: + - "subworkflows" + - "subworkflows/bam_trim_primers_ivar" + files: + - path: "output/bam_trim_primers_ivar/test.bam" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/bam_trim_primers_ivar/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 2df6bbc775a5cb2e723a360b7b9bce2228171c23 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Mon, 27 Mar 2023 13:21:50 +0000 Subject: [PATCH 2/6] adding main.nf and completing meta --- .../nf-core/bam_trim_primers_ivar/main.nf | 56 +++++++++------- .../nf-core/bam_trim_primers_ivar/meta.yml | 66 ++++++++++++++++--- 2 files changed, 88 insertions(+), 34 deletions(-) diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf index dc13fab4c00..7e3edd1abe9 100644 --- a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf +++ b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf @@ -1,36 +1,44 @@ -// TODO nf-core: If in doubt look at other nf-core/subworkflows to see how we are doing things! :) -// https://github.com/nf-core/modules/tree/master/subworkflows -// You can also ask for help via your pull request or on the #subworkflows channel on the nf-core Slack workspace: -// https://nf-co.re/join -// TODO nf-core: A subworkflow SHOULD import at least two modules - -include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' -include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' +include { IVAR_TRIM } from '../../../modules/nf-core/ivar/trim/main' +include { BAM_SORT_STATS_SAMTOOLS } from '../bam_sort_stats_samtools/main' workflow BAM_TRIM_PRIMERS_IVAR { - take: - // TODO nf-core: edit input (take) channels - ch_bam // channel: [ val(meta), [ bam ] ] + bam // channel: [ val(meta), [ bam ], [bai] ] + bed // path : bed + fasta // channel: reference.fasta main: ch_versions = Channel.empty() - // TODO nf-core: substitute modules here for the modules of your subworkflow - - SAMTOOLS_SORT ( ch_bam ) - ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) - - SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) - ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) + // + // iVar trim primers + // + IVAR_TRIM ( + bam, + bed + ) + ch_versions = ch_versions.mix(IVAR_TRIM.out.versions.first()) + + // + // Sort, index BAM file and run samtools stats, flagstat and idxstats + // + BAM_SORT_STATS_SAMTOOLS ( + IVAR_TRIM.out.bam, + fasta + ) + ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) emit: - // TODO nf-core: edit emitted channels - bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] - bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] - csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] + bam_orig = IVAR_TRIM.out.bam // channel: [ val(meta), bam ] + log_out = IVAR_TRIM.out.log // channel: [ val(meta), log ] - versions = ch_versions // channel: [ versions.yml ] -} + bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] + bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] + csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ] + stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] + flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] + idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml b/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml index ba959dbff3f..f4f45e099ab 100644 --- a/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml +++ b/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml @@ -1,16 +1,31 @@ name: "bam_trim_primers_ivar" -## TODO nf-core: Add a description of the subworkflow and list keywords -description: Sort SAM/BAM/CRAM file +description: Trim primers using IVAR tools and perform summary statistics. keywords: + - amplicon sequencing + - trimming + - ivar + - fasta - sort - bam - sam - cram -## TODO nf-core: Add a list of the modules used in the subworkflow + modules: + - ivar/trim - samtools/sort - samtools/index -## TODO nf-core: List all of the variables used as input, including their types and descriptions + - samtools/stats + - samtools/idxstats + - samtools/flagstat + +tools: + - ivar: + description: | + iVar - a computational package that contains functions broadly useful for viral amplicon-based sequencing. + homepage: https://github.com/andersen-lab/ivar + documentation: https://andersen-lab.github.io/ivar/html/manualpage.html + licence: ["GPL-3.0-or-later"] + input: - meta: type: map @@ -21,25 +36,56 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" -## TODO nf-core: List all of the variables used as output, including their types and descriptions + - bai: + type: file + description: Index file for co-ordinate sorted BAM file + pattern: "*.bai" + - fasta: + type: file + description: Reference genome fasta file + pattern: "*.{fasta,fa}" + - bed: + type: file + description: BED file with primer labels and positions + pattern: "*.bed" output: - meta: type: map description: | Groovy Map containing sample information - e.g. [ id:'test' ] + e.g. [ id:'test', single_end:false ] + - bam_org: + type: file + description: iVar generated trimmed bam file (unsorted) + pattern: "*.bam" + - log_out: + type: file + description: Log file generated by iVar for use with MultiQC + pattern: "*.log" - bam: type: file description: Sorted BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - bai: type: file - description: BAM/CRAM/SAM samtools index + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - crai: + type: file + description: BAM/CRAM/SAM index file pattern: "*.{bai,crai,sai}" - - csi: + - stats: + type: file + description: File containing samtools stats output + pattern: "*.{stats}" + - flagstat: + type: file + description: File containing samtools flagstat output + pattern: "*.{flagstat}" + - idxstats: type: file - description: CSI samtools index - pattern: "*.csi" + description: File containing samtools idxstats output + pattern: "*.{idxstats}" - versions: type: file description: File containing software versions From f16dd8d99831ae8faea9c20af7f211481bcebaa0 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Mon, 27 Mar 2023 13:51:12 +0000 Subject: [PATCH 3/6] Finishing tests in docker --- .../nf-core/bam_trim_primers_ivar/main.nf | 13 +++++++--- .../bam_trim_primers_ivar/nextflow.config | 7 +++++ .../nf-core/bam_trim_primers_ivar/test.yml | 26 ++++++++++++------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf b/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf index 08742423e5e..1bd4dee38cb 100644 --- a/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/main.nf @@ -5,8 +5,15 @@ nextflow.enable.dsl = 2 include { BAM_TRIM_PRIMERS_IVAR } from '../../../../subworkflows/nf-core/bam_trim_primers_ivar/main.nf' workflow test_bam_trim_primers_ivar { - - input = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) - BAM_TRIM_PRIMERS_IVAR ( input ) + input = [ + [ id:'test'], + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed_file = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BAM_TRIM_PRIMERS_IVAR ( input, bed_file, fasta ) } diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config b/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config index 8730f1c4b93..832a35b1381 100644 --- a/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/nextflow.config @@ -2,4 +2,11 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + withName: '.*:SAMTOOLS_.*' { + ext.prefix = { "${meta.id}.paired_end.sorted" } + } + + withName: '.*:BAM_STATS_SAMTOOLS:.*' { + ext.prefix = { "${meta.id}.paired_end.sorted.bam" } + } } diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml b/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml index 39821bcf693..1bc0eb276d6 100644 --- a/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml @@ -1,12 +1,20 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core subworkflows create-test-yml -- name: "bam_trim_primers_ivar" +- name: bam_trim_primers_ivar test_bam_trim_primers_ivar command: nextflow run ./tests/subworkflows/nf-core/bam_trim_primers_ivar -entry test_bam_trim_primers_ivar -c ./tests/config/nextflow.config tags: - - "subworkflows" - - "subworkflows/bam_trim_primers_ivar" + - ivar + - ivar/trim + - subworkflows + - subworkflows/bam_sort_stats_samtools + - subworkflows/bam_trim_primers_ivar files: - - path: "output/bam_trim_primers_ivar/test.bam" - md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/bam_trim_primers_ivar/versions.yml - md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b + - path: output/ivar/test.bam + md5sum: 12cff17d43b1efdba8120a6bff5311e3 + - path: output/ivar/test.ivar.log + md5sum: e97b025016cfe0d1f723b8cfa1c7c66d + - path: output/samtools/test.paired_end.sorted.bam + - path: output/samtools/test.paired_end.sorted.bam.bai + - path: output/samtools/test.paired_end.sorted.bam.flagstat + md5sum: c6b56420e8a30bff3487dbd6ec13ba5f + - path: output/samtools/test.paired_end.sorted.bam.idxstats + md5sum: 6d48b63094316587ab5564d11d7e897f + - path: output/samtools/test.paired_end.sorted.bam.stats From 7ce81a59f892addf18ec11a1e9ea04c2f234cc92 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Mon, 27 Mar 2023 14:33:08 +0000 Subject: [PATCH 4/6] updating meta.yml with correct formatting --- .../nf-core/bam_trim_primers_ivar/main.nf | 20 +++--- .../nf-core/bam_trim_primers_ivar/meta.yml | 70 +++++++++++-------- 2 files changed, 49 insertions(+), 41 deletions(-) diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf index 7e3edd1abe9..f022f32a3e7 100644 --- a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf +++ b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf @@ -3,20 +3,19 @@ include { BAM_SORT_STATS_SAMTOOLS } from '../bam_sort_stats_samtools/main' workflow BAM_TRIM_PRIMERS_IVAR { take: - bam // channel: [ val(meta), [ bam ], [bai] ] - bed // path : bed - fasta // channel: reference.fasta + ch_bam // channel: [ val(meta), path(bam), path(bai) ] + ch_bed // channel: [ path(bed) ] + ch_fasta // channel: [ path(fasta) ] main: - ch_versions = Channel.empty() // // iVar trim primers // IVAR_TRIM ( - bam, - bed + ch_bam, + ch_bed ) ch_versions = ch_versions.mix(IVAR_TRIM.out.versions.first()) @@ -25,20 +24,21 @@ workflow BAM_TRIM_PRIMERS_IVAR { // BAM_SORT_STATS_SAMTOOLS ( IVAR_TRIM.out.bam, - fasta + ch_fasta ) - ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) + + ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions.first()) emit: bam_orig = IVAR_TRIM.out.bam // channel: [ val(meta), bam ] - log_out = IVAR_TRIM.out.log // channel: [ val(meta), log ] + log_out = IVAR_TRIM.out.log // channel: [ val(meta), log bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ] stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] - idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] + idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml b/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml index f4f45e099ab..224d155b01f 100644 --- a/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml +++ b/subworkflows/nf-core/bam_trim_primers_ivar/meta.yml @@ -27,27 +27,25 @@ tools: licence: ["GPL-3.0-or-later"] input: - - meta: - type: map + - ch_bam: + type: file description: | + Structure: [ val(meta), path(bam), path(bai) ] Groovy Map containing sample information - e.g. [ id:'test' ] - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - bai: + e.g. [ id:'test' ], BAM/CRAM/SAM file, index file for co-ordinate sorted BAM file + - ch_bed: type: file - description: Index file for co-ordinate sorted BAM file - pattern: "*.bai" - - fasta: + description: | + Structure: path(bed) + BED file with primer labels and positions + pattern: "*.bed" + - ch_fasta: type: file - description: Reference genome fasta file + description: | + Structure: path(fasta) + Reference genome fasta file pattern: "*.{fasta,fa}" - - bed: - type: file - description: BED file with primer labels and positions - pattern: "*.bed" + output: - meta: type: map @@ -56,36 +54,46 @@ output: e.g. [ id:'test', single_end:false ] - bam_org: type: file - description: iVar generated trimmed bam file (unsorted) - pattern: "*.bam" + description: | + Structure: [ val(meta), path(bam) ] + iVar generated trimmed bam file (unsorted) - log_out: type: file - description: Log file generated by iVar for use with MultiQC + description: | + Structure: [ val(meta), path(log) ] + Log file generated by iVar for use with MultiQC pattern: "*.log" + - bam: type: file - description: Sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" + description: | + Structure: [ val(meta), path(bam) ] + Sorted BAM/CRAM/SAM file - bai: type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" + description: | + Structure: [ val(meta), path(bai) ] + BAM/CRAM/SAM index file - crai: type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" + description: | + Structure: [ val(meta), path(crai) ] + BAM/CRAM/SAM index file - stats: type: file - description: File containing samtools stats output - pattern: "*.{stats}" + description: | + Structure: [ val(meta), path(stats) ] + File containing samtools stats output - flagstat: type: file - description: File containing samtools flagstat output - pattern: "*.{flagstat}" + description: | + Structure: [ val(meta), path(flagstat) ] + File containing samtools flagstat output - idxstats: type: file - description: File containing samtools idxstats output - pattern: "*.{idxstats}" + description: | + Structure: [ val(meta), path(idxstats) ] + File containing samtools idxstats output - versions: type: file description: File containing software versions From 13a4076ad9912b5b3bff94ba9d5e1f1293546424 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Mon, 27 Mar 2023 17:35:17 +0000 Subject: [PATCH 5/6] md5sums removed not consistent across platforms --- tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml b/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml index 1bc0eb276d6..6be4aaedad9 100644 --- a/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml +++ b/tests/subworkflows/nf-core/bam_trim_primers_ivar/test.yml @@ -8,13 +8,9 @@ - subworkflows/bam_trim_primers_ivar files: - path: output/ivar/test.bam - md5sum: 12cff17d43b1efdba8120a6bff5311e3 - path: output/ivar/test.ivar.log - md5sum: e97b025016cfe0d1f723b8cfa1c7c66d - path: output/samtools/test.paired_end.sorted.bam - path: output/samtools/test.paired_end.sorted.bam.bai - path: output/samtools/test.paired_end.sorted.bam.flagstat - md5sum: c6b56420e8a30bff3487dbd6ec13ba5f - path: output/samtools/test.paired_end.sorted.bam.idxstats - md5sum: 6d48b63094316587ab5564d11d7e897f - path: output/samtools/test.paired_end.sorted.bam.stats From 82299bb0070719682678cde24f1396ce4d3dd59d Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Tue, 28 Mar 2023 09:38:35 +0000 Subject: [PATCH 6/6] adding path to emit comments --- .../nf-core/bam_trim_primers_ivar/main.nf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf index f022f32a3e7..cb9f6c1c8e1 100644 --- a/subworkflows/nf-core/bam_trim_primers_ivar/main.nf +++ b/subworkflows/nf-core/bam_trim_primers_ivar/main.nf @@ -30,15 +30,15 @@ workflow BAM_TRIM_PRIMERS_IVAR { ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions.first()) emit: - bam_orig = IVAR_TRIM.out.bam // channel: [ val(meta), bam ] - log_out = IVAR_TRIM.out.log // channel: [ val(meta), log + bam_orig = IVAR_TRIM.out.bam // channel: [ val(meta), path(bam) ] + log_out = IVAR_TRIM.out.log // channel: [ val(meta), path(log) ] - bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] - bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] - csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ] - stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] - flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] - idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] + bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), path(bam) ] + bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), path(bai) ] + csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), path(csi) ] + stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] + flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), path(flagstat) ] + idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] - versions = ch_versions // channel: [ versions.yml ] + versions = ch_versions // channel: [ path(versions.yml) ] }