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

[ERROR] Invalid Counts data #55

Closed nadiacneto closed 2 years ago

nadiacneto commented 2 years ago

Hi cellphonedb team,

I have generated all the input files for cellphonedb using your tutorial https://github.com/ventolab/CellphoneDB/blob/master/notebooks/0_prepare_your_data_from_Seurat.ipynb I have mouse data that I successfully converted to their human orthologs. My original input was seurat.

However I am getting the following error, after checking all my files I am unsure what the issue could be: cellphonedb method degs_analysis cellphonedb_meta.txt cellphonedb_count.txt DEGs.txt --counts-data hgnc_symbol [ ][CORE][04/08/22-19:19:57][INFO] Initializing SqlAlchemy CellPhoneDB Core [ ][CORE][04/08/22-19:19:57][INFO] Using custom database at /home/ubuntu/.cpdb/releases/v4.0.0/cellphone.db [ ][APP][04/08/22-19:19:57][INFO] Launching Method cpdb_degs_analysis_local_method_launcher [ ][APP][04/08/22-19:19:57][INFO] Launching Method _set_paths [ ][APP][04/08/22-19:19:57][INFO] Launching Method _load_meta_counts [ ][APP][04/08/22-19:49:36][INFO] Launching Method _check_counts_data [ ][APP][04/08/22-19:49:36][INFO] Launching Method _load_degs [ ][CORE][04/08/22-19:49:36][INFO] Launching Method cpdb_degs_analysis_launcher [ ][CORE][04/08/22-19:49:36][INFO] Launching Method _counts_validations [ ][APP][04/08/22-19:49:38][ERROR] Invalid Counts data: Some cells in meta did not exist in counts. Maybe incorrect file format.[ ][APP][04/08/22-16:49:33][ERROR] Invalid Counts data: Some cells in meta did not exist in counts. Maybe incorrect file format.

This is a head of my meta.tsv file image

This is a head of my DEG file image

This is a head of counts file image

Thank you kindly

prete commented 2 years ago

Hi @nadiacneto, you should check if all the Cells (elements on the first column) in your cellphonedb_meta.txt file have a matching cell in the headers of cellphonedb_count.txt. If that's not the issue then you can share your files here and we can have a look.

nadiacneto commented 2 years ago

That's not the issue, all the cells match the counts and the meta. Do you have a support email to which I could share the files privately? Thank you

prete commented 2 years ago

You can use the contact form on cellphonedb.org or contact@cellphonedb.org and that will go to the team.

Alternatively, you can use the email on my GitHub profile to get the files directly to me.

nadiacneto commented 2 years ago

Hi @prete I did manage to figure out what's the issue. Seems like when extracting the counts from a seurat object you get a sparse matrix. That needs to be converted to a dense matrix, once that was done cellphonedb ran just fine. Thanks so much!!

prete commented 2 years ago

Glad to read you solved it. Thank you for letting us know.

jinlanzhan commented 1 year ago

Hi @prete I did manage to figure out what's the issue. Seems like when extracting the counts from a seurat object you get a sparse matrix. That needs to be converted to a dense matrix, once that was done cellphonedb ran just fine. Thanks so much!!

I have encountered the same problem. Could you describe in detail how you solved it?

nadiacneto commented 1 year ago

Hi @jinlanzhan, I was using R for my project and you can load your counts file and convert counts <- as.matrix(counts). Check that all your rownames and colnames are preserved.