Hi all,
I am interested in retrieving sequencing barcodes (demultiplexing barcode, not UMI) from sorted BAMs. I thought that I could first convert BAM > FASTQ and look in the header (bedtools bamToFastq), but I don't see an index sequence (below). I am hoping that I can extract this information directly from the BAM.
Any help would be appreciated!
@NS500602:778:HHH5KBGXB:4:11605:4703:18870 GGCGAGGATGTGGAGAAAGGGGAACACTCCTCCATTGTTGGTGGGATTGCAAGCTTGTACAACCACTCTGGAAAT + AAAAAEEEEEEAEEAEEEEAEEEEEEE/AEAEEEAEEEEA<e eeeaeaeeeeeeeeeeeee="" aeeeaa6eeeee<="" p="">
That is only possible if the read name contained the barcode originally or it has a BC value as an optional field. Also, you don't need to convert them to Fastq, you can read it with samtools, like:
samtools view FILE.bam | more
Great point, thanks!