maickrau / GraphAligner

MIT License
261 stars 32 forks source link

Incorrect alignments, assertion errors with --seedless-DP when read has a mismatch in the first base #93

Open shenker opened 1 year ago

shenker commented 1 year ago

Occurs in v1.0.17b and master.

Here is a MRE I generated with synthetic data. The ground truth segments have only ATs. I generate reads in random orientations spanning the graph (so should, in the absence of mismatches on the read ends, yield end-to-end alignments) with a Q10 error rate (except for the first and last base of the read!). The last base of the read, regardless of orientation, I make a G (guaranteed mismatch). The bad reads are identical except the first base of every read is a G (guaranteed mismatch).

GraphAligner -b 100000 -C 500000 --seedless-DP -g ref.gfa -f good.fasta -a good.gaf:

GraphAligner Branch master commit 124553fce2922c1b96f9d5dade3b4c5bcee95eb9 2023-09-26 13:50:12 +0300
GraphAligner Branch master commit 124553fce2922c1b96f9d5dade3b4c5bcee95eb9 2023-09-26 13:50:12 +0300
Load graph from ref.gfa
Build alignment graph
No seeds, calculate the entire first row. VERY SLOW!
Alignment bandwidth 100000, tangle effort 500000
Clip alignment ends with identity < 66%
X-drop DP score cutoff 14705
Backtrace from 10 highest scoring local maxima per cluster
write alignments to good.gaf
Align
Alignment finished
Input reads: 10 (1200bp)
Seeds found: 0
Seeds extended: 0
Reads with a seed: 0 (0bp)
Reads with an alignment: 10 (1187bp)
Alignments: 10 (1187bp)
End-to-end alignments: 0 (0bp)

GraphAligner -b 100000 -C 500000 --seedless-DP -g ref.gfa -f bad.fasta -a bad.gaf:

GraphAligner Branch master commit 124553fce2922c1b96f9d5dade3b4c5bcee95eb9 2023-09-26 13:50:12 +0300
GraphAligner Branch master commit 124553fce2922c1b96f9d5dade3b4c5bcee95eb9 2023-09-26 13:50:12 +0300
Load graph from ref.gfa
Build alignment graph
No seeds, calculate the entire first row. VERY SLOW!
Alignment bandwidth 100000, tangle effort 500000
Backtrace from 10 highest scoring local maxima per cluster
write alignments to bad.gaf
Align
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r0. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r1. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r2. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r3. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r4. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r5. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r6. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r7. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r8. Seed: 0+,0,0,0
src/GraphAligner.h:589: Assertion 'diagonalIndices[0]' failed. Read: r9. Seed: 0+,0,0,0
Alignment finished
Input reads: 10 (1200bp)
Seeds found: 0
Seeds extended: 0
Reads with a seed: 0 (0bp)
Reads with an alignment: 0 (0bp)
Alignments: 0 (0bp)
End-to-end alignments: 0 (0bp)
Alignment broke with some reads. Look at stderr output.

Thoughts?