10XGenomics / cellranger

10x Genomics Single Cell Analysis
https://www.10xgenomics.com/support/software/cell-ranger
Other
342 stars 91 forks source link

Cellranger count error:Your reference doesn't appear to be indexed. Please run the mkreference tool #139

Closed debbie28 closed 8 months ago

debbie28 commented 2 years ago

Hello, I am using Cellranger counts with the hg38 pre-packaged reference, which I modified to include a number of transgenes. I followed the steps of cellranger mkref and the genome folder was created without any issue. The output genome folder has all the expected files including the index file fasta.fa.fai. However, when I go to run cellranger counts on my scRNA-seq data, I get the error "Your reference doesn't appear to be indexed. Please run the mkreference tool". I tried re-making the reference quite a few times , but the problem persists. Can you suggest what is going wrong?

evolvedmicrobe commented 2 years ago

This suggests one of these files is missing (the index being referred to is the STAR index):

Can you check for the presence of each of these under [your-reference-genome-path]/star

    "chrLength.txt",
    "chrNameLength.txt",
    "chrName.txt",
    "chrStart.txt",
    "Genome",
    "genomeParameters.txt",
    "SA",
    "SAindex",
debbie28 commented 2 years ago

Hey, I just figured out that all of these files are not present in my Star folder. It seems that the star module is running out of memory and failing but in cellranger 6.1.1 it doesn't show up as an error and hence I was missing it. the specific warning that I am getting is "libc++abi: libc++abi: libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloclibc++abi: libc++abi: libc++abi: libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc terminating with uncaught exception of type std::bad_alloc: std::bad_alloc".

However, I am running the following command, which should take care of the memory issue:

cellranger mkref --genome=hg38_epic --fasta genome_epic.fa --genes genes_epic.gtf --nthreads 16 --memgb 32

But turns out increasing --memgb more than 32 isn't helping either. mekref keeps running out of memory.

evolvedmicrobe commented 2 years ago

Hmmm.... very interesting. It appears this error has been reported by other STAR users before on their pages:

https://github.com/alexdobin/STAR/issues?q=is%3Aissue+std%3A%3Abad_alloc

And can be caused by among other things:

1 - Way too many contigs in the genome FASTA 2 - The system not having enough free memory even though a given amount was requested (can diagnose with free -m)

Please reach out to support@10xgenomics.com for further help with this issue.

aimanbarki commented 2 years ago

@debbie28 Did you able to resolve your issue? I am seeing the same error. Can you please explain what you did to resolve this? Thanks

debbie28 commented 2 years ago

@aimanbarki as suggested above, for me the problem was I did not have enough free memory and hence the makeref was incomplete. I re-ran the whole thing on the server with about 200Gb of memory available and it ran fine.

NadineBestard commented 1 year ago

I had a very similar issue, building the reference genome had failed (also due to not giving enough memory ) and I had not realised, as at first glance it seemed to be there. When running cellranger the error I got was: Your reference does not contain the expected files, or they are not readable. Please check your reference folder on node1a I managed to pinpoint from where the error came from thanks to this thread, so I leave this comment here to make it easier to find for someone that might have the same error I've got.