velocyto-team / velocyto.py

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

Package dependency problem on NumPy #397

Open jasonleongbio opened 2 weeks ago

jasonleongbio commented 2 weeks ago

Dear velocyto developers,

I installed velocyto fresh and encountered a package version conflict with NumPy. I followed the instructions on the installation page, but when I ran the software with my own sample (10x genomics), I got an error suggesting that NumPy should be downgraded (Please see the error message below).

To solve this, I suggest that the required package versions need to be specified on the installation page (now I'm trying to downgrade NumPy to 1.26 to see if it works or not; my program stopped after 12 hours of computation...). An additional thing that may help is to provide a sample outs folder of small size to let the users test if the tool works on their own computers/clusters or not.

Traceback (most recent call last):
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/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 "/data/Jason/tools/miniconda3/envs/velocyto/bin/velocyto", line 8, in <module>
    sys.exit(cli())
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/velocyto/commands/run10x.py", line 112, in run10x
    return _run(bamfile=(bamfile, ), gtffile=gtffile, bcfile=bcfile, outputfolder=outputfolder,
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/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 "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/loompy/loompy.py", line 1065, in create
    with new(filename, file_attrs=file_attrs) as ds:
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/loompy/loompy.py", line 1006, in new
    ds.attrs[vals] = file_attrs[vals]
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/loompy/global_attribute_manager.py", line 66, in __setitem__
    return self.__setattr__(name, val)
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/loompy/global_attribute_manager.py", line 94, in __setattr__
    normalized = loompy.materialize_attr_values(val)
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/loompy/normalize.py", line 91, in materialize_attr_values
    if np.issubdtype(a.dtype, np.string_) or np.issubdtype(a.dtype, np.object_):
  File "/data/Jason/tools/miniconda3/envs/velocyto/lib/python3.9/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.

Thank you so much! Hope this information can help you improve the tool for the community.

Best, Jason Leong.

pdemko commented 2 weeks ago

I received the same error. The program created a loom file that, when read into scvelo, was empty.