velocyto-team / velocyto.py

RNA velocity estimation in Python
http://velocyto.org/velocyto.py/
BSD 2-Clause "Simplified" License
160 stars 83 forks source link

Error when running velocyto on 10X samples #293

Open maddemaddi opened 3 years ago

maddemaddi commented 3 years ago

Hi! I have been able to succesfully generate loom files using mouse sc-data but now, 1 week later, I have faced issues running velocyto run on human samples. I am getting the following error:

... 2021-02-26 16:23:06,207 - DEBUG - Counting done! 2021-02-26 16:23:08,849 - DEBUG - Generating output file /projappl/project_2003803/INVD/sample03/velocyto/sample03.loom 2021-02-26 16:23:08,849 - DEBUG - Collecting row attributes 2021-02-26 16:23:08,956 - DEBUG - Generating data table Traceback (most recent call last): File "/projappl/project_2003803/bioconda3_env/my_biotools/bin/velocyto", line 8, in sys.exit(cli()) File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/velocyto/commands/run10x.py", line 112, in run10x return _run(bamfile=(bamfile, ), gtffile=gtffile, bcfile=bcfile, outputfolder=outputfolder, File "/projappl/project_2003803/bioconda3_env/my_biotools/lib/python3.8/site-packages/velocyto/commands/_run.py", line 274, in _run layers[layer_name] = np.concatenate(dict_list_arrays[layer_name], axis=1) File "<__array_function__ internals>", line 5, in concatenate numpy.core._exceptions.MemoryError: Unable to allocate 515. GiB for an array with shape (36601, 7558255) and data type uint16

I don't understand how this could be a memory error, as this specific sample only has around 1600 cells whereas the mouse samples I have used previously had about 9000 cells each and I didn't face a similar error.

For sorting, I used the following code:

samtools sort -T CB -O BAM -o cellsorted_possorted_genome_bam.bam possorted_genome_bam.bam

And for running, I used the following code:

velocyto run10x -m repeat_msk.gtf /projappl/project_2003803/INVD/sample03 genes.gtf

I have also tried running this with the general velocyto run function, but I am getting the same error.

I am using version 1.11 of samtools and version 0.17.17 of velocyto in a conda environment.

Thanks for the help!

nasiegel88 commented 3 years ago

The best way to troubleshoot would be to increase your memory allocation. How much RAM is your system currently using?

Abigail575 commented 9 months ago

Hi @maddemaddi, I was wondering if you managed to solve this? Am experiencing the same error with a dataset of a couple of thousand cells. Thanks!