Question: How to convert BAM file from hg19 to hg38
0
gravatar for kumbarov
24 months ago by
kumbarov10
Sweden
kumbarov10 wrote:

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?

sequence alignment • 2.4k views
ADD COMMENTlink modified 24 months ago • written 24 months ago by kumbarov10

I will give liftOver a try. Thank you!

ADD REPLYlink written 24 months ago by kumbarov10

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 REPLYlink written 24 months ago by Devon Ryan92k

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

ADD REPLYlink written 24 months ago by Devon Ryan92k
3
gravatar for Alex Reynolds
24 months ago by
Alex Reynolds29k
Seattle, WA USA
Alex Reynolds29k wrote:

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

ADD COMMENTlink written 24 months ago by Alex Reynolds29k

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 REPLYlink written 24 months ago by kumbarov10

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

ADD REPLYlink written 24 months ago by Alex Reynolds29k

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 REPLYlink written 24 months ago by swbarnes26.7k

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

ADD REPLYlink written 24 months ago by kumbarov10

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 REPLYlink written 24 months ago by Alex Reynolds29k
2
gravatar for Devon Ryan
24 months ago by
Devon Ryan92k
Freiburg, Germany
Devon Ryan92k wrote:

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

ADD COMMENTlink written 24 months ago by Devon Ryan92k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2399 users visited in the last hour