maickrau / GraphAligner

MIT License
256 stars 30 forks source link

Error when mapping reads to graph. #56

Open champ1994 opened 2 years ago

champ1994 commented 2 years ago

I tried to map reads to a graph, but following types of error was generated:

A) src/GraphAlignerBitvectorBanded.h:537: Assertion 'currentSlice.node(i).minScore <= currentSlice.node(i).startSlice.scoreEnd' failed. Read: b2c 3662f-0c55-44f9-a112-6a2442ada525. Seed: 0+,0,0,0

B) src/GraphAlignerBitvectorCommon.h:1118: Assertion 'previous.node(neighbor).endSlice.scoreEnd >= scoreHere-(eq?0:1)' failed. Read: 50ccb189-b12 9-4637-89c4-ed837b4c8376. Seed: 0+,0,0,0

There were 4 more reads for which error A was produced and 2 more reads for which error B was produced. What do these error mean ? How to avoid them ?

Also, for some reads large number of multiple alignment is generated, even when --multimap-score-fraction is set to 1. How can I get only the single best alignment for each read ?

maickrau commented 2 years ago

The errors look like GraphAligner bugs. Those reads will not have alignments in the output but other reads will not be affected. Could you please upload the graph and the reads which had an error?

A read can have multiple alignments with --multimap-score-fraction 1 if those alignments are in different parts of the read, or if there are multiple exactly equally good alignments. There's no way in GraphAligner to pick only the single best alignment. You will have to filter the lines in the output gaf by picking the ones with highest alignment score (tag AS:f:, column 14)