question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to fix MemoryError (f" bam file #{k} could not be sorted by cells. \n\ in run10x and run?

See original GitHub issue

Hi there,

I encountered issue with “Out of memory” when I run10x in velocyto. Looking at the .err file returned from the server cluster, i had issues shown below.

MemoryError (f" bam file #{k} could not be sorted by cells. \n\ in run10x

It further says the error is probably related to an old version of samtools, please install samtools >= 1.6 but I checked and samtools version 1.10 was used.

It says to set the --samtools_memory option to a value compatible with my system. Otherwise sort mannually by samtools

sort -l [compression] -m [mb_to_use]M -t [tagname] -O BAM -@ [threads_to_use] -o cellsorted_[bamfile] [bamfile]

Anyone has any suggestion how to fix this error?

Thank you so much!

Screen Shot 2021-11-15 at 5 32 59 PM

Commands I had in my sh script to run on our server cluster:

Screen Shot 2021-11-15 at 7 13 46 PM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
AAA-3commented, Nov 18, 2021

I can’t help with the GTF file - I don’T even know how you managed to edit it 😮

0reactions
denvercal1234GitHubcommented, Nov 20, 2021

Thank you all.

I finally got it to generate loom file. I think there were two main issues with the run10x:

  • For my cluster which might be different for your cluster, do not create virtual environment. Just use the packages installed by the server administrators
  • Ensure you have the directory of the count output as directiory that contains the outs folder.
  • Ensure you have barcodes file as zip version and not unzipped!
  • Ensure you have the right gtf (it should be one located in /genes/genes.gtf) and masked files downloaded correctly (do md5 checksum if needed).
  • Ensure you do the manual sorting first of your bam file and that the cellsorted_possorted bam and the original bam.bai files are in the same directory

I wish everyone the best of luck! I managed to get it to generate a loom file, but when I examined the error log, it said “Could not retrieve index file for the cellsorted_possorted_genome_bam.bam.” – See issue #321

Any thoughts @cdiaz45 @AAA-3?

Screen Shot 2021-11-20 at 1 19 24 PM
Read more comments on GitHub >

github_iconTop Results From Across the Web

Learning the BAM format
A BAM file is just a SAM file but stored in binary format; you should always convert your SAM files into BAM format...
Read more >
CLI Usage Guide — velocyto 0.17.16 documentation
The bam file outputted by dropEst does not contain error-corrected but raw cell barcodes so we will have to make a new corrected...
Read more >
Introduction to SAM and BAM files - EPI2ME Labs
This tutorial aims to elucidate the information stored with a SAM and BAM files, and how such files can be read, or parsed,...
Read more >
使用velocyto进行bam转loom吐血踩坑记录 - 腾讯云
The sorting step will be skipped and the existing file will be used. ... run Runs the velocity analysis outputting a loom file...
Read more >
the BAM input file, 'sample.bam', doesn't have a valid EOF block.
I 've been trying to use RSubread to count alignments for a RNA-seq course. To get the .bam aligned and mapped file I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found