Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegFault in Banded_SW when band_width is large #49

Closed
bnbowman opened this issue May 16, 2017 · 4 comments
Closed

SegFault in Banded_SW when band_width is large #49

bnbowman opened this issue May 16, 2017 · 4 comments

Comments

@bnbowman
Copy link

When aligning sequences of dissimilar size, I'm occasionally getting a SegFault deep within "banded_sw". What appears to be happening is that the initial boundary setting is finding a partially garbage (long indel-containing) alignment in the larger sequence, creating a large size discrepancy between sequences and large value for band_width going into banded_sw, which breaks something deep in the aligner:
RefEnd,RefStart+1,RefLen,ReadEnd,ReadStart+1,ReadLen,BandWidth
759,1,760,5332,1483,3851,3092

Sample sequences are attached below. The alignment params used are:
Match=2; Mismatch=5; GapInit=3; GapExtend=3

problem_seqs.zip

@mengyao
Copy link
Owner

mengyao commented Jun 28, 2017 via email

@corwinjoy
Copy link

Hi,
I had the same problem. Looking into it, the loop for banded_sw sometimes cannot achieve the maximum score so it just keeps doubling the bandwidth size indefinitely until the program crashes. I'm not sure what the best fix is here but I simply bounded the loop as follows:
The original loop in banded_sw looks like
do {
..
} while (LIKELY(max < score);

I changed this to
do {
} while (LIKELY(max < score) && LIKELY(band_width <= readLen));

As I understand it, band_width > readLen doesn't make sense anyway so I think this is a reasonable fix.

Corwin

@sammysheep
Copy link

@corwinjoy Your suggestion also fixed my issue for when I assigned too small a (0) gap open penalty for long read / long reference.

Is there a scenario where the band_width might possibly need to be larger, perhaps with some sort of indel in the read?

@corwinjoy
Copy link

I guess that is a good point. Your read might have dropped a number of bases so potentially the maximum band width might be bigger than your read. I would still apply this same fix and set the max to your readLen + some tolerance depending on the source of your reads.

@mengyao mengyao closed this as completed May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants