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

Exception: Some clusters/cell_types in DEGs are not present in meta, for no obvious reason #53

Closed polinaderev closed 1 year ago

polinaderev commented 1 year ago

Dear CellPhoneDB developers,

I have a cellphonedb version 3.1.0 installed on a CentOS7-based slurm-ruled cluster in a conda environment.

I am trying to use it on my scRNAseq dataset in the degs_analysis mode. Here's the code I execute:

cellphonedb method degs_analysis \
./3_output_1_R/metadata.tsv \
./3_output_1_R/mtx \
./3_output_1_R/deg.tsv \
--output-path ./3_output_2_cpdb \
--counts-data gene_name \

It throws the following output:

[ ][CORE][27/07/22-21:48:41][INFO] Initializing SqlAlchemy CellPhoneDB Core
[ ][CORE][27/07/22-21:48:41][INFO] Using custom database at /home/pmc_research/pderevianko/.cpdb/releases/v4.0.0/cellphone.db
[ ][APP][27/07/22-21:48:41][INFO] Launching Method cpdb_degs_analysis_local_method_launcher
[ ][APP][27/07/22-21:48:41][INFO] Launching Method _set_paths
[ ][APP][27/07/22-21:48:41][INFO] Launching Method _load_meta_counts
[ ][APP][27/07/22-21:49:43][INFO] Launching Method _check_counts_data
[ ][APP][27/07/22-21:49:43][INFO] Launching Method _load_degs
[ ][APP][27/07/22-21:49:43][ERROR] Unexpected error
Traceback (most recent call last):
  File "/hpc/local/CentOS7/pmc_heidenreich/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/api_endpoints/terminal_api/method_terminal_api_endpoints/method_terminal_commands.py", line 300, in degs_analysis
    debug
  File "/hpc/local/CentOS7/pmc_heidenreich/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/local_launchers/local_method_launcher.py", line 156, in cpdb_degs_analysis_local_method_launcher
    degs = self._load_degs(degs_filename, meta)
  File "/hpc/local/CentOS7/pmc_heidenreich/software/anaconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/local_launchers/local_method_launcher.py", line 306, in _load_degs
    raise Exception("Some clusters/cell_types in DEGs are not present in meta")
Exception: Some clusters/cell_types in DEGs are not present in meta

I double-check and triple-check the cell types in the deg.tsv and metadata.tsv files but I do not find any cell type from DEGs that is not present in meta.

Here are my metadata.tsv and deg.tsv (on Google Drive because Github doesn't accept .tsv as attachments).

I would appreciate any leads to why it is giving me this error, thanks.

prete commented 1 year ago

Hi @polinaderev,

Thank you for attaching your metadata and deg files.

Effectively, the cell types: 'Macrophages-like', 'Mast Cells-like', 'Pre-Mast cells-like' present in DEGs are not part of your metadata.

polinaderev commented 1 year ago

Oh, I've found where a part of cell types slipped out in my code. Thanks a million.