There could be two issues with the current code in the samtools view module:
samtools view $args input.bam > output.bam
actually generates ‘sam’ format instead of bam file although file extension is bam;- The input and out file could both has extension ‘.bam’. So, the output directive may contain two bam files, which might be intended.
Read more here: Source link