diff --git a/tools/umi_tools/environment.yml b/tools/umi_tools/environment.yml index 43a7be1d..da7adab9 100644 --- a/tools/umi_tools/environment.yml +++ b/tools/umi_tools/environment.yml @@ -7,3 +7,4 @@ channels: - defaults dependencies: - umi_tools=1.0.1 + - samtools=1.1.0 diff --git a/tools/umi_tools/main.nf b/tools/umi_tools/main.nf index 69234d9b..ba7f21a0 100644 --- a/tools/umi_tools/main.nf +++ b/tools/umi_tools/main.nf @@ -17,7 +17,8 @@ process umitools_dedup { tuple val(sample_id), path(bam) output: - tuple val(sample_id), path("*.dedup.bam"), emit: dedupBam + tuple val(sample_id), path("${sample_id}.dedup.bam"), emit: dedupBam + tuple val(sample_id), path("${sample_id}.dedup.bam.bai"), emit: dedupBai path "*.dedup.log", emit: report script: @@ -32,15 +33,16 @@ process umitools_dedup { } // Contruct CL line - command = "umi_tools dedup ${args} -I ${bam[0]} -S ${sample_id}.dedup.bam --output-stats=${sample_id}" + dedup_command = "umi_tools dedup ${args} -I ${bam[0]} -S ${sample_id}.dedup.bam --output-stats=${sample_id}" // Log if (params.verbose){ - println ("[MODULE] umi_tools/dedup exec: " + command) + println ("[MODULE] umi_tools/dedup command: " + dedup_command) } //SHELL """ - ${command} + ${dedup_command} + samtools index ${sample_id}.dedup.bam """ } diff --git a/tools/umi_tools/umi_tools.yml b/tools/umi_tools/umi_tools.yml index 796b700a..71432292 100644 --- a/tools/umi_tools/umi_tools.yml +++ b/tools/umi_tools/umi_tools.yml @@ -24,12 +24,9 @@ processes: - sample_id: type: string description: Sample identifier - - bai: - type: file - description: BAM file index - bam: - type: file - description: BAM sequence file + type: file array + description: BAM sequence file and associated BAI index file output: - dedupBam: type: tuple