Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

cellphonedb plot issue #363

Open
ParkMiSo opened this issue Feb 17, 2022 · 3 comments
Open

cellphonedb plot issue #363

ParkMiSo opened this issue Feb 17, 2022 · 3 comments

Comments

@ParkMiSo
Copy link

Hi!
I'm trying to plot the results of a cellphonedb and i have an error.

I'm using cellphonedb 2.1.7, R 4.0.5, and python 3.7.10.
ggplot2 and phatmap installed.

I think that error is caused by setting the wrong R path.
cpdb was in /data1/software/anaconda3/envs/cpdb/, but running R was in /opt/R/4.0.5/lib/R/.
How can i resolve this issue?

This error was also caused using test data (cellphonedb example running)

The full message that return is :

/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.cluster.k_means_ module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.cluster. Anything that cannot be imported from sklearn.cluster is now part of the private API.
warnings.warn(message, FutureWarning)
R[write to console]: Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.5/lib/R/library/methods/libs/methods.so':
/opt/R/4.0.5/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler

R[write to console]: Error: package or namespace load failed for ‘grDevices’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.5/lib/R/library/grDevices/libs/grDevices.so':
/opt/R/4.0.5/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_translateCharFP

R[write to console]: Error: package or namespace load failed for ‘graphics’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.5/lib/R/library/grDevices/libs/grDevices.so':
/opt/R/4.0.5/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_translateCharFP

R[write to console]: Error: package or namespace load failed for ‘stats’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.5/lib/R/library/grDevices/libs/grDevices.so':
/opt/R/4.0.5/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_translateCharFP

R[write to console]: Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.5/lib/R/library/methods/libs/methods.so':
/opt/R/4.0.5/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler

R[write to console]: During startup -
R[write to console]: Warning messages:

R[write to console]: 1: package "methods" in options("defaultPackages") was not found

R[write to console]: 2: package ‘grDevices’ in options("defaultPackages") was not found

R[write to console]: 3: package ‘graphics’ in options("defaultPackages") was not found

R[write to console]: 4: package ‘stats’ in options("defaultPackages") was not found

R[write to console]: 5: package ‘methods’ in options("defaultPackages") was not found

R[write to console]: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/R/4.0.5/lib/R/library/methods/libs/methods.so':
/opt/R/4.0.5/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler

[ ][APP][17/02/22-17:33:43][ERROR] Unexpected error
Traceback (most recent call last):
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/api_endpoints/terminal_api/plot_terminal_api_endpoints/plot_terminal_commands.py", line 38, in dot_plot
columns=columns)
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/plotters/r_plotter.py", line 36, in wrapper
from rpy2 import robjects
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/rpy2/robjects/init.py", line 17, in
from rpy2.robjects.robject import RObjectMixin, RObject
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/rpy2/robjects/robject.py", line 58, in
class RObjectMixin(object):
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/rpy2/robjects/robject.py", line 70, in RObjectMixin
__show = _get_exported_value('methods', 'show')
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/rpy2/rinterface_lib/conversion.py", line 28, in _
cdata = function(*args, **kwargs)
File "/data1/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/rpy2/rinterface.py", line 773, in call
raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/R/4.0.5/lib/R/library/methods/libs/methods.so':
/opt/R/4.0.5/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler

@fkcoolman
Copy link

I suggest you create a new conda environment with R env included when creating cpdb, something like this:
conda create -n cpdb python=3.7 r-base
and after you pip install cpdb, use conda to install ggplot2.

@Romaindonne
Copy link

Hello,

I am also trying to run cellphonedb plot dot_plot ... (from the tutorial files. I obtained the "out's files" with cellphonedb method statistical_analysis test_meta.txt test_counts.txt).

I am facing this error (very similar):

[ ][APP][25/04/22-22:12:55][ERROR] Unexpected error
Traceback (most recent call last):
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/cellphonedb/src/api_endpoints/terminal_api/plot_terminal_api_endpoints/plot_terminal_commands.py", line 33, in dot_plot
r_plotter.dot_plot(means_path=means_path,
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/cellphonedb/src/plotters/r_plotter.py", line 36, in wrapper
from rpy2 import robjects
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/rpy2/robjects/init.py", line 26, in
from . import vectors
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/rpy2/robjects/vectors.py", line 14, in
import jinja2 # type: ignore
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/jinja2/init.py", line 12, in
from .environment import Environment
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/jinja2/environment.py", line 25, in
from .defaults import BLOCK_END_STRING
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/jinja2/filters.py", line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/anaconda3/envs/cpdb/lib/python3.8/site-packages/markupsafe/init.py)

I have tried all the issues found there and always the same error.
Miniconda3, python3.7, environment.yml, + conda + pip install cellphonedb

Could you help me with that?

Thanks a lot!

@SinhaI
Copy link

SinhaI commented Jun 17, 2022

Hi,

I also got the same import error as above.
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/proj/cellphone_env2/lib/python3.7/site-packages/markupsafe/__init__.py)

I was using markupsafe2.1.1. Downgrading markupsafe module to 2.0.1 cellphonedb plot worked fine for me.
I have used pip install markupsafe==2.0.1
Hope this will help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants