This is a test version of Biostars. For the public version, visit https://www.biostars.org.
fastq and bam files

How to? Using the following alignment entry from a BAM file reconstruct the equivalent FASTQ entry.

ILLUMINA-EAS45_6:1:1:3:2025:0:1:1 0 chr1 115679594 255 36M * 0 0 AAGCACAGGACTATTCTGTCTCATTTTCCAAATAGA ABCABBBCB@@CBCB?B@B?BA@A?A>=68999:59 XM:i:0 NM:i:0 MD:Z:36

sequence

yes, would be great to get some tips. I am familiar with the fastq and usually get my data in the form of vcfs but that is puzzling.

See entries for FASTQ format and SAM format. Should be easily apparent what fields to select from your bam to reconstruct the original read.

1 answer

Unless this is homework, where you have to write code yourself to do this, there are existing tools that will do the conversion, such as Picard tools SamToFastq, https://broadinstitute.github.io/picard/command-line-overview.html#SamToFastq.

Log in to answer this question.