velocyto.py
velocyto.py copied to clipboard
ValueError: Main matrix cannot be empty
I always have the same error 'ValueError: Main matrix cannot be empty' Traceback (most recent call last): File "/home/user/.virtualenvs/singleCellAnalysis/lib/python3.6/site-packages/velocyto/commands/_run.py", line 286, in _run ds = loompy.create(filename=outfile, matrix=total, row_attrs=ra, col_attrs=ca, dtype="float32") TypeError: create() got an unexpected keyword argument 'matrix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.virtualenvs/singleCellAnalysis/bin/velocyto", line 11, in
What is the command you are running?
Hey, I had the same error using the Velocyto run command. Which was thrown at the very end when it tried to write the loom file. And appears to be related to another error of an unexpected keyword argument for 'matrix'.
This does seem related, though slightly different from the problem in issues #110 which seems to indicated an issue with the barcode file, though I did not use one, and in the past I was able to use 'velocyto run' without a -b
argument. So I'm not sure if there is a different issue here or not.
Relevant code:
velocyto run -m /PATH/hg19_rmsk.gtf /PATH/cellsorted_HM_final.bam /PATH/GRCh37.74.gtf
2019-12-17 12:44:48,916 - DEBUG - Writing loom file
Traceback (most recent call last):
File "/usr/local/lib64/python3.6/site-packages/velocyto/commands/_run.py", line 286, in _run
ds = loompy.create(filename=outfile, matrix=total, row_attrs=ra, col_attrs=ca, dtype="float32")
TypeError: create() got an unexpected keyword argument 'matrix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/velocyto", line 11, in <module>
load_entry_point('velocyto==0.17.17', 'console_scripts', 'velocyto')()
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib64/python3.6/site-packages/velocyto/commands/run.py", line 116, in run
samtools_memory=samtools_memory, dump=dump, loom_numeric_dtype=dtype, verbose=verbose, additional_ca=additional_ca)
File "/usr/local/lib64/python3.6/site-packages/velocyto/commands/_run.py", line 297, in _run
loompy.create(filename=outfile, layers=tmp_layers, row_attrs=ra, col_attrs=ca, file_attrs={"velocyto.__version__": vcy.__version__, "velocyto.logic": logic})
File "/usr/local/lib/python3.6/site-packages/loompy/loompy.py", line 980, in create
raise ValueError("Main matrix cannot be empty")
ValueError: Main matrix cannot be empty
Hi, I get the exact same error running "velocyto run-smartseq2" on smartseq2 samples aligned with kallisto (from which I got pseudobam files). Was this "empty matrix" issue solved? Cause I went through issue #110 but couldn't find a suitable solution...
Thanks for the help! BW Sabrina
@SabrinaITNL, have you fond the solution to this issue ? Pease let me know.
Thanks.
Hi @akhst7, No I still haven't find a solution to the issue. I keep getting the "empry matrix" error.
BW Sabrina
Hi @SabrinaITNL, my issue was solved by providing the right matrix file.
Hi @SabrinaITNL, my issue was solved by providing the right matrix file.
hi, can you briefly talk about how you solve it by providing matrix file??
@yyc4217,
A following is the line I used to run Velocyte;
velocyto run -b filtered_feature_bc_matrix/barcodes.tsv -o /temp/home -m GRCh38_rmsk.gtf cellsorted_PBMC.bam.bam refdata-gex-GRCh38-2020-A/genes/genes.gtf
My issue was not using the right barcodes.tsv.
I hope this helps and let me know if you need a further help.
You might want to check if any of the cell barcodes ("CB" tag in the .bam file) contain dashes ("-"), since velocyto.py uses dashes to determine barcodes. Reference: https://github.com/velocyto-team/velocyto.py/blob/0963dd2df0ac802c36404e0f434ba97f07edfe4b/velocyto/counter.py#L211-L212