This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What's the correct way to map to hg38 with alternative contigs?

I'm trying to do mapping to hg38. And I'm a bit confused how to handle alternative (random, fix, ...) contigs. From documents of bwa seemingly there is a proposed way (https://github.com/lh3/bwa/blob/master/README-alt.md), but there are some obstructions.

1.If you use hg38 directly (I download from https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/latest/hg38.fa.gz). The log from bwa shows

[M::bwa_idx_load_from_disk] read 0 ALT contigs

which indicates that bwa do not identify alternative contigs.

2.follow instructions from bwakit(https://github.com/lh3/bwa/tree/master/bwakit), those hadn't been updated since 2014, and some links becames invalid. I'm not sure if simply change links would work correctly.

So are there a proposed way to perform alt-aware mapping? Thanks a lot

ngs bwa

Sorry I can't add apply or comment, I have to answer myself. Here's a method to open the ALT-aware mode for bwa, and the result looks good for me.

In the same path of your reference, say hg38.fa do:

grep 'alt' hg38.fa | sed 's/>//g' > hg38.fa.alt

the log shows

[M::bwa_idx_load_from_disk] read 333 ALT contigs

You may want to verify that alt aware mapping is working. You seem to be simply removing the fasta headers with word alt in them. What is likely messing up the sequence.

1 answer

As far as I know, bwa mem is the only alt-aware aligner. Details are here:

https://github.com/lh3/bwa/blob/master/README-alt.md

Your approach is only messing up the headers of the alt contigs. Don't do that. If you want to pick another human genome version to align to consider this doc carefully:

https://lh3.github.io/2017/11/13/which-human-reference-genome-to-use

Log in to answer this question.