ventolab / CellphoneDB

CellPhoneDB can be used to search for a particular ligand/receptor, or interrogate your own HUMAN single-cell transcriptomics data.
https://www.cellphonedb.org/
MIT License
322 stars 51 forks source link

How to set up R environment for cellphonedb? #8

Closed mxiang1 closed 1 year ago

mxiang1 commented 2 years ago

I have the required packages installed in R but am seeing this error message:

$ cellphonedb plot dot_plot As there is no R environment set up, some functionalities will be disabled, e.g. plot You cannot perform this plot command unless there is a working R setup according to CellPhoneDB specs

ksaunders73 commented 2 years ago

For me I used the terminal in RStudio (bottom left panel next to "console"). Hope this helps!

EDIT: or I should say it helped me to install v3, but when running functions, I'm running into that issue as well :(

EDIT EDIT: try this:

conda create -n cpbd_R r-essentials r-base python=3.7

from: https://docs.anaconda.com/anaconda/user-guide/tasks/using-r-language/

monikaramos commented 2 years ago

@ksaunders73 I tried your suggestion to create an environment with R on it to plot cpdb results but now it is not recognizing the cellphonedb commands. Do I have to call on cellphonedb somehow within the R env or how do I get it to recognize the command. Does it need to be installed again?

mxiang1 commented 2 years ago

@ksaunders73 Thanks! @monikaramos I used the plot_dot_by_column_name.R script to directly make the plots in R before seeing @ksaunders73 's comment. You can try that too if nothing else works.

ksaunders73 commented 2 years ago

@monikaramos I think you have to reinstall it because what I said makes a new virtual environment (that just includes R and python instead of just python). @mxiang1 thanks for pointing out that script! I'll definitely check that out since it's easier to plot stuff in RStudio for me personally

prete commented 2 years ago

Quickest way is to get environment.yml from the repository and then

conda env create --file environment.yml

That will create a conda environment (called cpdb) with both CellPhoneDB python and R dependencies installed.