This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Adjust Bwa Mem To Allow For Longer Gaps In Contig Alignment

My first guess would be to adjust the gap extension parameter. But that one is already set to 1, the lowest integer. I now get multiple split alignment, that are relatively very close to each other and I would rather have more of a end to end alignment.

Algorithm options:

   -t INT     number of threads [1]
   -k INT     minimum seed length [19]
   -w INT     band width for banded alignment [100]
   -d INT     off-diagonal X-dropoff [100]
   -r FLOAT   look for internal seeds inside a seed longer than {-k} * FLOAT [1.5]
   -c INT     skip seeds with more than INT occurrences [10000]
   -S         skip mate rescue
   -P         skip pairing; mate rescue performed unless -S also in use
   -A INT     score for a sequence match [1]
   -B INT     penalty for a mismatch [4]
   -O INT     gap open penalty [6]
   -E INT     gap extension penalty; a gap of size k cost {-O} + {-E}*k [1]
   -L INT     penalty for clipping [5]
   -U INT     penalty for an unpaired read pair [17]
bwa-mem

2 answers

If you want to follow through on your idea about decreasing gap costs, you can do something like -A 2 -E 1. At least in recent versions of bwa -A (which scales options -TdBOELU unless overridden) scales all costs, while -E will overwrite the scaled value, essentially decreasing extension costs.

Try to set -O to 20 and -E to 0

Log in to answer this question.