maickrau / GraphAligner

MIT License
256 stars 30 forks source link

Assertion failed on building alignment graph #17

Closed rlorigro closed 4 years ago

rlorigro commented 4 years ago

Hi,

I am attempting to run GraphAligner on a fairly small (34Mbp) GFA, which is very linear (at most 2 deg in/out for every node) and I am getting this un-descriptive error during the Build alignment graph step.

GraphAligner bioconda 1.0.10-
GraphAligner bioconda 1.0.10-
Load graph from /home/ubuntu/data/human/hg002/shasta/hg002_sv_500/Assembly.gfa
Build alignment graph
src/AlignmentGraph.cpp:58: Assertion 'breakpoints.back() == sequence.size()' failed. Read: Preprocessing. Seed: No seed
terminate called after throwing an instance of 'ThreadReadAssertion::AssertionFailure'

Is this a problem with the GFA? I can share it if needed.

rlorigro commented 4 years ago

After adding some more info to the error output: https://github.com/rlorigro/GraphAligner/commit/6f0600b16d689d4a69bc3537bd902579fb965041

I am getting this result:

Build alignment graph
src/AlignmentGraph.cpp:58: Assertion 'breakpoints.back() == sequence.size()' failed. Read: Preprocessing. Seed: No seed

First node
nodeId: 9172
original nodeId:        4586
name:   
breakpointsFw.back:     23
sequence.size:  18

Second node
nodeId: 9173
original nodeId:        4586
name:   
breakpointsBw.back:     18
sequence.size:  18
terminate called after throwing an instance of 'std::runtime_error'
  what():  Adding FIRST node failed

The relevant data from the GFA looks like this:

S    4586    ACTCTTACCATATAATCC    RC:i:14
S    4584    TTACCATATAATCCAGCAACTGCATTATTGGATATATGTTCAAAGGAAATAGTATTAGTATGTTGAAGAGATATTTGCACTCCATGTTTATTACAAAACTATTCACAATTGCCAAGATATAGAATCAACCTCGGTGTCTATTAATGGATAAAGAAAATATGGGTATCTATATACAATGGAGTGCTATTCTGCCATAAAAAGAATGAAATCTTGGAATTTGTGGTGACATGGATGTACTTGAAGGACATTATGTTAAGTGAAATAAGCCAGAACAGAAAGACAAATACTACATAATCTTACTCATATGTGGAATCTAAGCAAGGTGATCTCAGAAGTGCAGAGTAGAATAGTAGTTACCAGAGTTAGGGGAGTAGAGAATGATTGGCCAATGGAGACAAGTTGCAGTTAGAGGAGAGGAATAATTTCTGGAACAAAGTTACAGTTAGACAGGAGAAATAAGTTCTCATGTTTTATATTGCATAATAGGGTGGCTATGGTTAACAATATTATATATTTCAGAATAACTTGTTCTCACCACAAAGAAATGATAAATGTATGAGTTGATAAATATGCTAAATACCCTGATTTGGTTATTATACAATGTAAACATGTTTTGAAACATCACACTCTACCCCATAAA   RC:i:11280
L    4586    +    4584    +    14M
L    4584    +    4586    +    23M
rlorigro commented 4 years ago

And this is how Bandage displays it image

rlorigro commented 4 years ago

It looks like there was a bug in the cigar string, so I will close the issue. It would be nice if there was better error reporting for the GFA parsing and graph building step though.