gravatar for colin.kern

2 hours ago by

United States

No, that won't work. It's not enough to just reheader because each alignment in the BAM file refers to a chromosome name defined in the headers, so if you're going to change the names in the headers, you need to go through each alignment and change the chromosome name there too. You'll need to know which chromsome name in hg19 matches the one in b37 that refers to the same chromosome. If there's a different number of chromosomes, that means you're missing some (probably unplaced or unlocalized scaffolds). You'll need to drop any alignments that are on a chromosome you don't have a name for in hg19. And this is all assuming that the chromosome sequence is exactly the same between the two references. This page indicates that they're not the same because b37 masks certain low confidence nucleotides. If this doesn't change the size of each chromosome sequences, then your alignment positions will still be valid.

As @RamRS said, it's safer, and probably easier depending on your skills in writing custom scripts, to just realign to hg19.



Source link