oubounyt / SCANet

SCANet is a python package that incorporates the inference of gene co-expression networks from single-cell gene expression data
https://pypi.org/project/scanet/
MIT License
4 stars 0 forks source link

Error when importing the package #2

Closed davidrm-bio closed 9 months ago

davidrm-bio commented 10 months ago

Hello,

Thank you for developing this package. I wanted to test it on my data, however I am running in an issue when importing it. I am using python 3.9.18 on a Mac. I get the following error when importing it:

AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Is there a preferred python version I should use?

oubounyt commented 10 months ago

Hey,

Thank you for reaching out, and I appreciate your interest in our package. The issue you're encountering is related to deprecation in numpy version > 1.20.0, where the np.object alias was removed.

please use numpy version <= 1.20.0

davidrm-bio commented 10 months ago

Thank you for your answer, I manage to install it correctly. However, after following the tutorial when running the co-expression analysis there is another problem. The anndata object looks the same as in the tutorial:

adata_r
AnnData object with n_obs × n_vars = 450 × 29252
    obs: '__SCANclusters__'
    var: 'Genes'
    uns: 'pca', 'neighbors', 'umap'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'

This is the error:


R[write to console]: Error in `map()`:
ℹ In index: 6.
ℹ With name: ylab.
Caused by error in `lifecycle::deprecate_soft()`:
! argument "user_env" is missing, with no default
Run `rlang::last_trace()` to see where the error occurred.
Traceback (most recent call last):
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3508, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-11-dc720f102e26>", line 1, in <module>
    SFTpower = sn.co.plot_powers(adata_r, network_type='unsigned', cor_method='pearson')
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/scanet/coexpression.py", line 87, in plot_powers
    optimal_power_ = plot_power_r(final_exp_, path=cls.path_outs,network_type=network_type,
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 208, in __call__
    return (super(SignatureTranslatedFunction, self)
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 131, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py", line 45, in _
    cdata = function(*args, **kwargs)
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/rinterface.py", line 873, in __call__
    raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in map(.l, vctrs_vec_compat) : 
ℹ With name: ylab.
Caused by error in `lifecycle::deprecate_soft()`:
! argument "user_env" is missing, with no default
oubounyt commented 10 months ago

Hey,

The error message you provided is related to an issue in the R. It seems that the error occurred while using the map() function. This function is often associated with the purrr package in R.

the error message indicates a problem with the lifecycle::deprecate_soft() function, and it mentions an issue related to the "user_env" argument, which is missing and has no default value.

can need to check the version of the purrr package and its dependencies in your R environment?

davidrm-bio commented 9 months ago

Thank you I checked and re-installed all the R libraries required and it worked