This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sequencing index information from BAM

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="">

bam fastq index

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

2 answers

you cannot find it from the BAM unless someone put this information in the BAM header.

That information is generally not kept in a bam file. Your bet bet would be if it were part of the read name, but in your case, it's not. You would have to ask to see the sample sheet used to demultiplex the run

Log in to answer this question.