How to convert BAM file from hg19 to hg38
2
0
Entering edit mode
7.1 years ago
kumbarov ▴ 10

Hello, I have a library of several hundred BAM files containing Y-sequences aligned to hg19. Now, since all major Y-players, like FTDNA, FGC, ISOGG, YBrowse... upgraded to hg38, my BAM files are pretty much useless since the SNP coordinates are according to hg38. Is there any way to convert these BAM files to hg38?

alignment sequence • 9.1k views
ADD COMMENT
0
Entering edit mode

I will give liftOver a try. Thank you!

ADD REPLY
1
Entering edit mode

BTW, nothing is going to be as good as realigning...

ADD REPLY
0
Entering edit mode

I don't think liftOver works for BAM files. As I said, use `CrossMap? (I only mentioned liftOver since most people are familiar with it).

ADD REPLY
3
Entering edit mode
7.1 years ago

You could convert BAM to FASTQ with Picard, say, and then realign the FASTQ to hg38 with your aligner of choice.

ADD COMMENT
0
Entering edit mode

I thought of that option but I have terabytes of data. It will take me ages with my Ryzen 1600X. If I leave the BAM files at hg19, maybe I can convert the SNP database from hg38 back to hg19. Can this be done in some automated way? My database has this format:

NAME, POSITION, ANC, DER. Is there any way to locally convert hg38 position to hg19 position? If there is, then I can write a script or a program to periodically do this for me.

ADD REPLY
0
Entering edit mode

Perhaps investigate LiftOver to map SNPs between builds: https://genome.sph.umich.edu/wiki/LiftOver

ADD REPLY
0
Entering edit mode

Many aligners will take .bam as input, so you don't have to convert to fastq prior to realigning. But yes, converting the SNP lists would probably be easiest.

ADD REPLY
0
Entering edit mode

I have been using BWA and samtools for aligning FASTQ to BAM. Can you recommend some better/faster aligner?

ADD REPLY
0
Entering edit mode

Given that you have TBs of data, a cloud service might help you speed things up by parallelizing the work. You might look into Rainbow, Crossbow, CloudBurst or other cloud-based approaches.

ADD REPLY
2
Entering edit mode
7.1 years ago

Have you tried CrossMap? It's basically liftOver for things other than BED files (they use the same .chain files).

ADD COMMENT

Login before adding your answer.

Traffic: 2600 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6