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

degs_analysis Errors #94

Closed connerlambden closed 1 year ago

connerlambden commented 1 year ago

Hi, I'm trying to run degs_analysis and am getting the following error.

Input: cellphonedb method degs_analysis \ "cellphone_db_input_meta.tsv" \ "cellphone_db_input" \ "cellphone_db_input_DEGs.tsv" \ --counts-data gene_name \ --threshold 0.1 \ --project-name "CellphoneDB_DEGS" \ --threads 32

Error:

[ ][CORE][01/03/23-04:47:04][INFO] Initializing SqlAlchemy CellPhoneDB Core [ ][CORE][01/03/23-04:47:04][INFO] Using custom database at /home/ubuntu/.cpdb/releases/v4.0.0/cellphone.db [ ][APP][01/03/23-04:47:04][INFO] Launching Method cpdb_degs_analysis_local_method_launcher [ ][APP][01/03/23-04:47:04][INFO] Launching Method _set_paths [ ][APP][01/03/23-04:47:04][INFO] Launching Method _load_meta_counts [ ][APP][01/03/23-04:47:17][INFO] Launching Method _check_counts_data [ ][APP][01/03/23-04:47:17][INFO] Launching Method _load_degs [ ][CORE][01/03/23-04:47:17][INFO] Launching Method cpdb_degs_analysis_launcher [ ][CORE][01/03/23-04:47:17][INFO] Launching Method _counts_validations [ ][CORE][01/03/23-04:47:22][INFO] Launching Method get_interactions_genes_complex [ ][CORE][01/03/23-04:47:22][INFO] [Cluster DEGs Analysis] Threshold:0.1 Iterations:1000 Debug-seed:-1 Threads:32 Precision:3 [ ][CORE][01/03/23-04:47:22][WARNING]


DEGs ANALYSIS IS AN EXPERIMENTAL METHOD STILL UNDER DEVELOPMENT!


[ ][CORE][01/03/23-04:47:24][INFO] Running Real Analysis [ ][CORE][01/03/23-04:47:24][INFO] Running DEGs-based Analysis [ ][APP][01/03/23-04:47:24][ERROR] Unexpected error Traceback (most recent call last): File "/home/ubuntu/miniconda3/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 "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/local_launchers/local_method_launcher.py", line 176, in cpdb_degs_analysis_local_method_launcher output_path File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/core/methods/method_launcher.py", line 212, in cpdb_degs_analysis_launcher output_path) File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/core/methods/cpdb_degs_analysis_method.py", line 153, in call counts_data) File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/cellphonedb/src/core/methods/cpdb_degs_analysis_method.py", line 362, in build_degs_matrix d = d.groupby(d.index).max() File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/pandas/core/groupby/groupby.py", line 1560, in max numeric_only=numeric_only, min_count=min_count, alias="max", npfunc=np.max File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/pandas/core/groupby/groupby.py", line 1001, in _agg_general how=alias, alt=npfunc, numeric_only=numeric_only, min_count=min_count, File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 1022, in _cython_agg_general how, alt=alt, numeric_only=numeric_only, min_count=min_count File "/home/ubuntu/miniconda3/envs/cpdb/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 1135, in _cython_agg_blocks assert len(locs) == result.shape[1] AssertionError

Thanks for the help!

luzgaral commented 1 year ago

Hi @connerlambden

Could you please share the header of your cellphone_db_input_DEGs.tsv?

Best,

Luz

connerlambden commented 1 year ago

@luzgaral

Screenshot 2023-03-08 at 12 56 25 PM
luzgaral commented 1 year ago

Hi @connerlambden

It looks right to me (unless the original file contains row indexes). See here an example. I imagine you already verified that the cluster names are the same in your deg & meta files.

If all the above is correct, then I suggest you change --counts-data gene_name by --counts-data hgnc_symbol Users reported issues with gene_name in the past.

Best,

Luz

connerlambden commented 1 year ago

That worked. Thanks!!