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
308 stars 51 forks source link

drawing dot plot with the results of DEG analysis #80

Closed hypaik closed 7 months ago

hypaik commented 1 year ago

Hi, In previous, I do appreciate your fast response about running DEG analysis. From the successful results of DEG_analysis, I tried to draw a dot plot of cellphoneDB.

As you know, there is no pvalues.txt from the DEG analysis. So, simply used p-values of statistical analysis... and a selected list of rows, and columns data from the DEG-analysis. But, there is a lot of error that I can't solve.

FYI, here I copied results from the shell.

In the folder named 'KYUPePTDEG', I used slected rows, columns. In the folder named 'KYUPePTSt', I used p-values and means data.

cellphonedb plot dot_plot --rows ./KYUPePTDEG/rowsTcellDEGcl0dM1cl10TCells_dNK3.txt --columns ./KYUPePTDEG/xx --means-path ./KYUPePTSt/means.txt --pvalues-path ./KYUPePTSt/pvalues.txt --output-path ./KYUPePTDEG --output-name PePTDEGDotplotTcellAllp0_001.pdf --verbose [ ][APP][01/12/22-18:47:40][ERROR] Unexpected error Traceback (most recent call last): File "/home/hyojung/.conda/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 "/home/hyojung/.conda/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/plotters/r_plotter.py", line 38, in wrapper return f(*args, **kwargs, robjects=robjects, r_runtime_error=RRuntimeError) File "/home/hyojung/.conda/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/plotters/r_plotter.py", line 115, in dot_plot means_df = pd.read_csv(means_path, sep=means_separator)

luzgaral commented 1 year ago

Dear @hypaik

Thank you for sharing.

In the DEG analysis we do not compute any statistics because these are already provided by the user in their DEG file. The DEG method will classify interactions as relevant (1) or not relevant (0) and p-values/significant mean files will go in agreement with this classification. A relevant interaction will have a --value of 0 and its mean will be in the significant mean files.

Long story short, you can still use the same plotting strategy with the output of only KYUPePTDEG.

Note that KYUPePTDEG and KYUPePTSt test different statistical questions and you should not expect a perfect agreement on what they define significant. Mixing outputs will give you errors.

Let us know if this works.

Best,

Luz