RNA STAR memory error

I got this while using RNA STAR:

EXITING because of fatal ERROR: not enough memory for BAM sorting: 
SOLUTION: re-run STAR with at least --limitBAMsortRAM 6318500801
Jan 13 01:41:07 ...... FATAL ERROR, exiting

Is there any way around this or is it that the file is too large?

Dear @biostaring,
You can try to sort the file beforehand with “Samtools sort order of storing aligned sequences”. MAybe that helps. How big is your file?

Kind regards,

Please also let us know which Galaxy server you are using :slight_smile:

The paired end seqs are 14 and 11 GB each.

I am using the eu server

Hi @biostaring,
did you try to sort the BAM files before using STAR as @Flow suggested?


Hi @biostaring

Did you get help for this already and solve the problem?

If not, this is one thing to check if I am understanding the problem correctly: An RNA STAR job is failing during the last step in the processing (sorting the output BAM result).

That can happen when there are a large number of target sequences (chromosomes, scaffolds, transcripts). Up to a hundred or so is fine, around a thousand can sometimes be Ok, but several hundred thousand or more (millions) won’t work. Why? The Samtools sorting job will run out of memory.

If that is your use-case, the solution is to reduce the number of target sequences in the “custom genome” fasta dataset or to use a different tool:

  • If the fasta is some transcript assembly that you created, check that you are removing very short sequences, especially those that would not be able to capture a hit anyway. The minimum length of the target sequences should be at around twice the length of the query sequences – and maybe a bit longer (~ 200 bases) – but you can generate the read lengths, filter the fasta a few different ways, and test to see what works.
  • If you are using a sequencing read dataset as a custom genome (ran fastq > fasta or something similar), that will never work with RNA-Star as far as I know and for a few different reasons both technical and scientific. Instead, use a tool like BLAST, output a tabular type of result (not a BAM), and consider making the parameters very strict or the output can grow very very large for no practical purpose and potentially fail the job.

Just a guess :slight_smile: and hopefully you’ve already resolved the error!