Entering edit mode
                    11 months ago
        mk
        
    
        ▴
    
    310
    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:
- Run STARsolo with
 - run 
samtools sortwith 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:
- the original alignment (which produced the unsorted BAM subsequently aligned with samtools above) and the subsequently sorted BAM
 - the sorted BAM from samtools (command shown above)
 
If you can't make
starsolowork with hardware you have then perhaps look intoalevin-fryinstead: https://combine-lab.github.io/alevin-fry-tutorials/2023/simpleaf-piscem/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.