This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unmapping Alternative reads

Hi, I want to do some HLA typing, most of the tools require the bam file is aligned to primary genome without alternative read handling. From the International Genome Sample Resource project, I can get the high coverage file, but they are all aligned to primary genome with hla, decoy and alternative reads.

I want to unmap those alternative reads, I tried this script https://github.com/humanlongevity/HLA/blob/master/bin/get-reads-alt-unmap.sh, but there are some technical problems, so I want to know is there any other way or tools to do this task?

Thank you very much.

alignment dna

there are some technical problems

What kind of problems. It may be easy to solve them.

Have you created an index for the BAM files you downloaded (samtools index, you would likely need to samtools sort before that)? If you use latest samtools then sort --write-index to do this in one step.

yes, I made the index *.bam.bai for the bam file beforehand

Looks like you did not name sort (samtools sort -n) your files before indexing them.

The bam file is already sorted:

samtools view -H HG02082.final.bam |grep "@HD"
@HD     VN:1.5  GO:none SO:coordinate

but you mean that I need to sort it by name, not coordinate, am I right?

Based on the errors you posted in GitHub issue, yes.

I tried sorting it by queryname and index it, but the script still does not work

0 answers

No answers yet.

Log in to answer this question.