Entering edit mode
11 months ago
dolevrahat
▴
40
I have an indexed bam file. I wish to update the sample ID (SM) field in the read groups (RG) entries in the bam header, which I do using samtools reheader
. I was wondering if it is recommended to re-generate the bam index (.bai) file after editing the header. The bam index specifications do not mention read groups so I do not know if read groups metadata is included in the index.
Any insights will be appreciated
Thank you! Does this also apply to cram files? I reckon the answer is yes for the same reason but I note that unlike bams, with crams it is possible to change the header in-place, so I wanted to be sure.