Teichlab / cellphonedb

MIT License
338 stars 105 forks source link

"Error Invalid Counts Data" #292

Closed aliciahillturner closed 3 years ago

aliciahillturner commented 3 years ago

Hi there! I can successfully run CellphoneDB with the sample data provided on my Linux OS. However, when I run my own code I get an error with my counts file! I have specified --counts-data=gene_name as I am not using ensemble IDS but I still seem to get an error!

Here is a screenshot of my counts file for reference if it helps!

image

Any help is appreciated as I am very new to this!

prete commented 3 years ago

Hi @aliciahillturner what's the extension on your count file? could you provide the full command you used? Also, the use of normalised counts is recommended.

aliciahillturner commented 3 years ago

Hi Prete! The extension of my count file is .txt, full filename is patient21counts.txt , and I believe the data was already normalized through the Seurat Package using SCTransform in R? Below is my command: "cellphonedb method statistical_analysis patient21meta.txt patient21counts.txt –-counts-data=gene_name"

Hope this helps to make things more clear!

prete commented 3 years ago

I wanted to check that the file is .txt and has \t as separator. I can suggest you try using a subset of your patient21counts.txt data to rule out any mislabeled gene names.

Does the error mention something else beside "Error Invalid Counts Data" ? Could you provide a sample of your input count file so I can test this and try to reproduce the error?

aliciahillturner commented 3 years ago

Okay I will try that and see if subsetting helps!

And here is a link to download the counts file if that helps as a sample of my input counts file. You should be able to download it! Let me know if that is what you meant by a sample of the input file? Thanks again!

prete commented 3 years ago

Hi @aliciahillturner looks like the count matrix got pasted two times in the file. The header is duplicated at line 16118 and all the data after that. That's probably what's causing your issue.

aliciahillturner commented 3 years ago

Hi @prete, I updated my counts file to correct for that error. The new counts file is linked here

However, I still seem to get this error: [ERROR] Invalid Counts data: Some cells in meta didnt exist in counts columns. Maybe incorrect file format. Is that just because I don't have all the cells in the meta clusters (i.e. Macrophage2 cluster) present in my counts file?

My meta file is also linked here for reference.

prete commented 3 years ago

Hi @prete, I updated my counts file to correct for that error. The new counts file is linked here

The shared file is still wrong, but I guess you're working with a fixed one.

[ERROR] Invalid Counts data: Some cells in meta didnt exist in counts columns. Maybe incorrect file format.

I think your issue is that some (~60%) of the barcodes in your meta are present as columns in your count file.

aliciahillturner commented 3 years ago

Thanks @prete it works now and I am able to generate my plots and complete the analysis! Thanks for all your help :)

xiaoxiaofuyou commented 2 years ago

hello, dear authors, i met the same problem, but i don't know how to solve this, could you please to help me to solve this problem, apprecita it!

image