This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to perform corrected Cell Barcode/UMI calling with an externally sorted BAM?

I require Cell Barcode / UMI calling but am unable to sort BAMs within STARsolo due to a limited system RAM. When I set limitBAMsortRAM==<ammount of RAM on my system>, STAR throws the following error:

EXITING because of fatal ERROR: not enough memory for BAM sorting: 
SOLUTION: re-run STAR with at least --limitBAMsortRAM 273246110398

Proposed solution:

  1. Run STARsolo with
  2. run samtools sort with my hard memory limits as follows:
    samtools sort -m ${BAMSORTRAM} -@ ${BAMSORTNTHREADS} -o "${base}_STARsolo/${base}_Aligned.sortedByCoord.out.bam" "${base}_STARsolo/${base}_Aligned.out.bam"
    

So how do I re-run STARsolo just to call Barcodes/UMIS on:

  1. the original alignment (which produced the unsorted BAM subsequently aligned with samtools above) and the subsequently sorted BAM
  2. the sorted BAM from samtools (command shown above)
bam alignment starsolo star

Try setting a high number for outBAMsortingBinsN.

Also, use the latest version of STAR.

Finally, your FASTQ files might have already been pre-sorted, so you can try shuffling the reads in your FASTQ files.

STARsolo shouldn’t take almost 300 gb of memory to sort a BAM file… I’m fairly certain that doing some or all of the above will fix it.

0 answers

No answers yet.

Log in to answer this question.