shenwei356 / LexicMap

LexicMap: efficient sequence alignment against millions of prokaryotic genomes
https://bioinf.shenwei.me/LexicMap
MIT License
105 stars 4 forks source link

Runtime error index out of range for Lexicmap search #9

Open andhamel opened 3 hours ago

andhamel commented 3 hours ago

Hi all,

I was running lexicmap search with the parameters recommended in the tutorial, and for one fasta I received this error message

Panic: runtime error index of out range [X] with length X

where X is the length of my aligned length with my query. I think this is due to the gap size as when I lowered - -align-min-gap the software ran successfully. Has this been encountered before? Also, this error only happens when I have the -a option, which leads me to think it has to do with writing the output potentially for the cigar string.

shenwei356 commented 2 hours ago

Hi, thanks for reporting this. Please paste the whole error information, which show the line number of the code which panic. Or please provide the query sequence and index information.

andhamel commented 33 minutes ago

Here is the full error message:

panic: runtime error: index out of range [237] with length 237

goroutine 10872 [running]:
github.com/shenwei356/wfa.(*AlignmentResult).AlignmentText(0xc0439c9e00, 0xc03399ee00, 0xc03399ede8)
    /home/shenwei/go/pkg/mod/github.com/shenwei356/wfa@v0.3.0/wfa_cigar.go:240 +0x3ff
github.com/shenwei356/LexicMap/lexicmap/cmd.(*Index).Search.func7(0xc00e2c1c20)
    /home/shenwei/go/src/github.com/shenwei356/LexicMap/lexicmap/cmd/lib-index-search.go:1731 +0x28dd
created by github.com/shenwei356/LexicMap/lexicmap/cmd.(*Index).Search in goroutine 9602
    /home/shenwei/go/src/github.com/shenwei356/LexicMap/lexicmap/cmd/lib-index-search.go:1182 +0xdec

I hope this helps! Thank you for the response.

shenwei356 commented 13 minutes ago

Emm, it's not sufficient for debug. It would help if you provide the query seq and a few target seqs/genomes (you said it works without -a). You can send them via email ( shenwei356@gmail.com ) if you want to keep them private. I'll try to fix them tomorrow.