This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GSNAP insufficient memory error

I faced with strange error using GSNAP version 2023-03-24.

First, I normally created index for genome from fasta file containing 3 relatively short sequences (fragments of genes)

gmap_build -D ref_genomic_sequences/gmap_index -d index_name ref_genomic_sequences/genome.fasta

Then I tried to map reads on this reference using following command

gsnap -D ref_genomic_sequences/gmap_index -d index_name -n 1 -Q F_reads.fastq R_reads.fastq > gmap_res.sam

But gsnap crushed with the error

Allocating memory for localdb...insufficient memory

This is strange because 1) I works on a server with plenty of RAM and disk space 2) Reference sequence is short 3) Reads for mapping in fastq-files are not so much (~ 3M). Also I tried to map only 100 reads and recived the same error.

I tried different batch types (-B argument), tried to build suffix array during indexing (--sarray=1 argument for gmap_build).

The same reads and reference behave normally both in bwa and bowtie2, but not in gsnap. Anybody met with the same problem and know how to solve it?

mapping gsnap

1 answer

Problem solved. I contacted with the developer of GSNAP (Thomas Wu) and here is the answer

It turns out that the insufficient memory error was due to the genome being so small that the sarray8 file (part of the localdb) was not needed. GSNAP then incorrectly interpreted the file being 0 bytes as a failure of memory allocation. I should be posting a fix later today.

Log in to answer this question.