This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How do I tell bwa to map only unmapped portion of the read for supplementary alignments?

I am using chimeric reads for my analyses, I am asking some questions in a row these days so I hope I'm not getting annoying :D

When bwa mem generates a sam output, it can include supplementary alignments (distinguished by the flag 2048). If I sum up the alignment length of the main alignment and of the supplementary alignment of each read that has one, sometimes I find that it goes beyond the read length.

I would like bwa mem to search for a supplementary alignment only with the unmapped portion of a read: is this possible?

bwa alignment supplementary sam chimeric

1 answer

I would like bwa mem to search for a supplementary alignment only with the unmapped portion of a read: is this possible?

unless I'm missing something, this information would be available in the "SA" tag of the read.

only with the unmapped portion

This is the interesting part :)

bu if bwa was able to map this small unmapped fragment, it would be in the SA tag. Why do you expect a new result from BWA ?

Let's say this is the read:

---------------------------------------------------------------

We have perhaps one alignment here:

xxxxxxxxxxxxxxxxxxxxxxxx---------------------------------------

And another here:

------------------------------------------xxxxxxxxxxxxxxxxxxxxx

Putting them together:

xxxxxxxxxxxxxxxxxxxxxxxx---------------------------------------
------------------------------------------xxxxxxxxxxxxxxxxxxxxx

They don't overlap on the read sequence. However, in my dataset I find sometimes situations like this one:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx----------------------------
--------------------xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Where you can see the overlap in the middle. This means that a region of the read is part of both the "first" alignment and the supplementary alignment. Obviously, I don't want this, because I want each position of the read to be mapped only once.

Log in to answer this question.