Hello, 

I am trying to convert a batch of BAM files to FASTQs. I started out testing SAMTOOLS (collate/bam2fq) and PICARD (SAMTOFATQ). On the outset the numbers seemed OK but the statistics suggests that the SAMTOOLS out has twice the amount of duplicates as the Picard out.

Has anyone experienced this? I am not sure if it is a samtools problem or I am not comprehending the QC stats.

Any advice/recommendation/comments are welcome.

Thanks!

PS: In both cases I am outputting both first end of the pair and the second end of the pair as separate files.

**UPDATED:**
The commands used were:
##Samtools

    samtools collate -o name-collate.bam sample.bam
    samtools fastq -1 sample_1.fastq.gz -2 sample_2.fastq.gz -0 sample_0.fastq.gz name-collate.bam

##Picard

    java -Xmx2g -jar picard.jar SamToFastq I=sample.bam FASTQ=sample_1p.fastq.gz SECOND_END_FASTQ=sample_2p.fastq.gz UNPAIRED_FASTQ=sample_0p.fastq.gz

##Fasqc check 

    fastqc -o fastqc_out/ sample_1p.fastq.gz
###Picard QC
![Picard][1]
###Samtools QC
![Samtools][2]


  [1]: https://s15.postimg.cc/w6lv1rd8b/picard.png
  [2]: https://s15.postimg.cc/i0646jhsr/samtools.png
By default, picard don't output non-primary alignments, and samtools does. These secondary alignments which `samtools fastq` outputs should have two effects: an increase in duplication rate, as you noticed, and a larger number of reads - can you confirm this?

Probably Picard behavior is what you want. If you read the samtools manual carefully, you will see how to avoid outputting non-primary alignments.