maickrau / GraphAligner

MIT License
256 stars 30 forks source link

Assertion 'to != std::numeric_limits<size_t>::max()' failed #20

Closed pierrepeterlongo closed 2 years ago

pierrepeterlongo commented 4 years ago

Hi,

I'm trying to map Minion reads on a gfa. The gfa is special because it is very "sparse" (196155 nodes and 442 edges). I precisely want to map long reads for finding connections between distant sequences obtained with discoSnp from short reads. Note that those sequences contain upper case and lower case characters and also contain stretches of 'N'.

I'm facing the following error:

GraphAligner -g mygraph.gfa -f mylongreads.fastq -a out.gam --corrected-out corrected.fa --corrected-clipped-out clipped.fa -x dbg
GraphAligner Branch master commit 9a4cefc9addeac03d000bab165a6121e1f19bb3d 2020-06-09 10:15:52 +0200
GraphAligner Branch master commit 9a4cefc9addeac03d000bab165a6121e1f19bb3d 2020-06-09 10:15:52 +0200
Load graph from graph_final_1_overlaps_only.gfa
Build alignment graph
src/AlignmentGraph.cpp:244: Assertion 'to != std::numeric_limits<size_t>::max()' failed. Read: ssing. Seed: 0+,0,0,0

The biggest node id is 196232 and size_t is an long unsigned int on my machine (echo | gcc -E -xc -include 'stddef.h' - | grep size_t)

Regarding the code, it seems to me that this assertion is related to the presence of node ids in links but not in nodes. I validated this is not the case in my file using this python code:

import sys

nodes = set()
with open(sys.argv[1]) as gfafile:
    for line in gfafile.readlines():
        if line[0] != "S" : continue
        # S 1   tgccttgtgccaaaaatactgatgcttcttgtgtggCCAATTTATTTTTTAAGGAAGAAGTCCGTTCGCATGGC...

        nodes.add(int(line.split()[1]))

with open(sys.argv[1]) as gfafile:
    for line in gfafile.readlines():
        if line[0] != "L" : continue
        # L 58673   +   153458  +   127M    OFL:i:1
        assert int(line.split()[1]) in nodes, f"{line.split()[1]} not in nodes"
        assert int(line.split()[3]) in nodes, f"{line.split()[3]} not in nodes"

Which went fine.

Could you please precise the error message and/or tell me what could be wrong with my data or with GraphAligner?

Best, Pierre

maickrau commented 4 years ago

Hi, could you please upload the graph?

maickrau commented 2 years ago

Assuming this works with the most recent version. If the error happens again please open a new issue.