From 12afb6b0faf3cabf769c9a2a7dd477e3f066eac0 Mon Sep 17 00:00:00 2001 From: Lucpen Date: Fri, 22 Apr 2022 10:01:47 +0200 Subject: [PATCH] Update samtools view to add input path(index) (#1539) * feat added index as input, to allow module to be used for subsampling * fix test * feat added index to meta.yml * Update modules/samtools/view/meta.yml feat corrected description of idea pattern file in meta.yml Co-authored-by: James A. Fellows Yates Co-authored-by: James A. Fellows Yates --- modules/samtools/view/main.nf | 2 +- modules/samtools/view/meta.yml | 4 ++++ tests/modules/samtools/view/main.nf | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/samtools/view/main.nf b/modules/samtools/view/main.nf index 5f14fbbf..11cfb74b 100644 --- a/modules/samtools/view/main.nf +++ b/modules/samtools/view/main.nf @@ -8,7 +8,7 @@ process SAMTOOLS_VIEW { 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: - tuple val(meta), path(input) + tuple val(meta), path(input), path(index) path fasta output: diff --git a/modules/samtools/view/meta.yml b/modules/samtools/view/meta.yml index 5604bfa7..a8b43ecc 100644 --- a/modules/samtools/view/meta.yml +++ b/modules/samtools/view/meta.yml @@ -25,6 +25,10 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" + - index: + type: optional file + description: BAM.BAI/CRAM.CRAI file + pattern: "*.{.bai,.crai}" - fasta: type: optional file description: Reference file the CRAM was created with diff --git a/tests/modules/samtools/view/main.nf b/tests/modules/samtools/view/main.nf index 8ee27ef8..9c239066 100644 --- a/tests/modules/samtools/view/main.nf +++ b/tests/modules/samtools/view/main.nf @@ -6,7 +6,8 @@ include { SAMTOOLS_VIEW } from '../../../../modules/samtools/view/main.nf' workflow test_samtools_view { input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + [] ] SAMTOOLS_VIEW ( input, [] ) @@ -14,8 +15,8 @@ workflow test_samtools_view { workflow test_samtools_view_cram { input = [ [ id: 'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true) ] fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)