Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Means for reciprocal cell type comparisons are different #194

Open
manf1984 opened this issue Jun 11, 2024 · 2 comments
Open

Means for reciprocal cell type comparisons are different #194

manf1984 opened this issue Jun 11, 2024 · 2 comments

Comments

@manf1984
Copy link

manf1984 commented Jun 11, 2024

Dear authors of cellphoneDB, first of all, thanks for this very very useful tool!
I am using it to evaluate ligand-receptor interactions among different annotated cell type a scRNAseq dataset.
I am using cellphonedb 5.0.0 in a python 3.10 dedicated conda environment.

Checking the output files generated I noticed one discrepancy. The means for an interaction (e.g. GENE A - GENE B) are not the same between reciprocal/mirror cell type pairs (e.g. "cell type A | cell type B" and "cell type B | cell type A"). How is this possible?

Code below

from cellphonedb.src.core.methods import cpdb_statistical_analysis_method

cpdb_results = cpdb_statistical_analysis_method.call(
         cpdb_file_path = "/path/to/cellphonedb.zip",
         meta_file_path = "/path/to/Metadata_for_cellphoneDB.csv",
         counts_file_path = "/path/to/AnnData_for_cellphoneDB.h5ad",
         counts_data = 'hgnc_symbol',
         output_path = "/path/to/output")

Then I check the txt output files with "means" and "significant means"

result_file_path = "/path/to/statistical_analysis_means_06_11_2024_124047.txt"
resultsDf = pd.read_csv(result_file_path, sep = "\t", header = 0)


print(resultsDf.loc[288, "Cell type A|Cell type B"]) #mean is 2.279
print(resultsDf.loc[288, "Cell type B|Cell type A"]) #mean is 0.006 

The values are different. But the cells are exactly the same, just the comparison is reciprocal. Why are the values different? Is that expected?
Thanks in advance for your help with this!

@ktroule
Copy link
Collaborator

ktroule commented Jun 12, 2024

Hi.

They are different because you are looking at the same pair of cells and interacting proteins but with the proteins swapped:

  • Cell type A (Gene A) | Cell type B (Gene B)
  • Cell type A (Gene B) | Cell type B (Gene A)

@manf1984
Copy link
Author

Ohh I see!
That explains it! Thanks very much for your quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants