This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there a tool or efficient method of confirming that a FASTQ file and BAM file contain the same reads?

Is there an existing tool to verify that a FASTQ file and a BAM file possess the same reads?

genome alignment

Maybe you can convert from bam to fastq bedtools bamtofastq and compare the result with the fastq file using comm -12 you have that will gave you the reads that exists in both files. Count them and compare the number with each file that will gave you an idea If they are the same.

Are you trying to confirm that the fastq and bam are an exact match, or is spotchecking a few entries good enough? Would agreement in the # of reads be sufficient?

1 answer

Use BamHash designed for this exact operation.

Is the tool compares Bam to fasta/q ?

Thank you! Do you happen to know if this tool is meant to take in processed or un-processed bams as input? Also, the result of this tool produces two separate hashes - should both hashes match when comparing to another file? Or is it sufficient for only one of the hashes to match?

What do you mean by processed or un-processed bams? Do you BAM files contain unaligned reads as well or are they excluded?

By processed bams, I mean bams that have been sorted, deduped, and recalibrated. By unprocessed, I mean just a sorted bam file (produced by Picard SortSam). And no, my bam files contain only aligned reads.

If you have removed reads because they did not map, or because they were duplicates, you do not need software to tell you that your bam file does not contain all the reads of the original fastq.

Log in to answer this question.