Thanks for sharing the solution!
Hello!
I was about to re-run the mapping step to create BAM files with hg19 coordinates, but realised that perhaps it's easier to convert the existing GRCh37 BAM files to hg19 coordinates, without having to re-run the aligner completely.
I looked around for ways to do this but only find methods for creating chain files e.g. hg19-h38.
I would greatly appreciate some help with this. :-]
Joel
1 answer
I ended up using samtools reheader, as the chromosomes seemed similar enough. I ended up wasting some hours thinking reheader ONLY changed the header section. I wish the samtools documentation was better... turns out reheader changes the chromosome names everywhere in the file.
Thanks for your help though, I found salvation much faster thanks to you :-]
My command in case someone is curious:
samtools reheader -c "sed -e 's/SN:\([0-9XY]\+\)/SN:chr\1/' -e 's/SN:MT/SN:chrM/'" h37.bam > hg19.bam
Correction: I changed the * to \+, elsewise lots of things went wrong... sorry!
Log in to answer this question.
see Bam File: Change Chromosome Notation
GRCh37 is hg19.
hg19is simply a synonym.Edit: I should add that the major genome build is identical. There are specific differences in some components noted in my comment below.
See: https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.13/
I was under the impression that chrM was actually different between the two?
While major genome builds are identical there are specific differences in non-chromosomal members: https://gatk.broadinstitute.org/hc/en-us/articles/360035890711-GRCh37-hg19-b37-humanG1Kv37-Human-Reference-Discrepancies
There is a comparison table.