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

AssertionError on DEG pipeline #54

Open cap76 opened 1 year ago

cap76 commented 1 year ago

Hi I'm trying out the DEGs analysis pipeline and see to be hitting an error. I followed the notebook to process from Seurat and end up running:

cellphonedb method degs_analysis E74_example_meta.tsv E74 E74_example_DEGs.tsv --counts-data gene_name --database v4.0.0 --threshold 0.1

I'm using gene names as I have a nonhuman system and not everything maps. It starts to run then hits an AssertionError. Running using method statistical_analysis seems to be fine. Have you seen this before? Any idea what the issue could be?

[ ][CORE][29/07/22-15:48:46][INFO] Initializing SqlAlchemy CellPhoneDB Core [ ][CORE][29/07/22-15:48:46][INFO] Using custom database at /mnt/beegfs6/home3/surani/cap76/.cpdb/releases/v4.0.0/cellphone.db [ ][APP][29/07/22-15:48:46][INFO] Launching Method cpdb_degs_analysis_local_method_launcher [ ][APP][29/07/22-15:48:46][INFO] Launching Method _set_paths [ ][APP][29/07/22-15:48:46][INFO] Launching Method _load_meta_counts [ ][APP][29/07/22-15:49:23][INFO] Launching Method _check_counts_data [ ][APP][29/07/22-15:49:23][INFO] Launching Method _load_degs [ ][CORE][29/07/22-15:49:23][INFO] Launching Method cpdb_degs_analysis_launcher [ ][CORE][29/07/22-15:49:23][INFO] Launching Method _counts_validations [ ][CORE][29/07/22-15:49:27][INFO] Launching Method get_interactions_genes_complex [ ][CORE][29/07/22-15:49:27][INFO] [Cluster DEGs Analysis] Threshold:0.1 Iterations:1000 Debug-seed:-1 Threads:4 Precision:3 [ ][CORE][29/07/22-15:49:27][WARNING]


DEGs ANALYSIS IS AN EXPERIMENTAL METHOD STILL UNDER DEVELOPMENT!


[ ][CORE][29/07/22-15:49:29][INFO] Running Real Analysis [ ][CORE][29/07/22-15:49:29][INFO] Running DEGs-based Analysis [ ][APP][29/07/22-15:49:29][ERROR] Unexpected error Traceback (most recent call last): File "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/site-packages/cellphonedb/src/api_endpoints/terminal_api/method_terminal_api_endpoints/method_terminal_commands.py", line 300, in degs_analysis debug File "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/site-packages/cellphonedb/src/local_launchers/local_method_launcher.py", line 176, in cpdb_degs_analysis_local_method_launcher output_path File "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/site-packages/cellphonedb/src/core/methods/method_launcher.py", line 212, in cpdb_degs_analysis_launcher output_path) File "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/site-packages/cellphonedb/src/core/methods/cpdb_degs_analysis_method.py", line 153, in call counts_data) File "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/site-packages/cellphonedb/src/core/methods/cpdb_degs_analysis_method.py", line 362, in build_degs_matrix d = d.groupby(d.index).max() File "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/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 "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/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 "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/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 "/mnt/beegfs/scratch/CellPAnalysis/cpdb/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 1135, in _cython_agg_blocks assert len(locs) == result.shape[1] AssertionError

prete commented 1 year ago

Hi @cap76 thank you for using CellPhoneDB!

It's hard to tell whar may be failing without looking at the data. Would it be possible for you to share your input files with us? (E74_example_meta.tsv / E74 / E74_example_DEGs.tsv)

shikhanayar commented 1 year ago

Hi, also having this AssertionError issue. Attaching my files (without the matrix file as it was too large to attach) and this is the code I'm running: cellphonedb method degs_analysis yost_meta.tsv yost_matrix.csv yost_DEGs.tsv --subsampling --subsampling-log false --subsampling-num-cells 3000 --counts-data gene_name --output-path ~/Desktop/Data/Cell_communication/out/DEGs

I will say that the cellphonedb method statistical_analysis function worked using the above metadata and counts matrix files. Thanks in advance for your help! test_methodDEGs.zip