jinworks / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics
GNU General Public License v3.0
245 stars 35 forks source link

Clarification Needed on Ligand-Receptor Pair Extraction in CellChat Tutorial #30

Open minitim222 opened 9 months ago

minitim222 commented 9 months ago

Hello CellChat Team,

I am currently working on a project using CellChat v2 and have encountered what seems to be a discrepancy in the tutorial regarding the extraction of ligand-receptor pairs. I would greatly appreciate your insight to ensure accurate interpretation.

In the tutorial, there are two R functions for extracting ligand-receptor pairs under different conditions. The first function is used to extract pairs with upregulated ligands in the LS dataset:

# extract the ligand-receptor pairs with upregulated ligands in LS
net.up <- subsetCommunication(cellchat, net = net, datasets = "LS", ligand.logFC = 0.1, receptor.logFC = NULL)

This function, with a positive ligand.logFC for LS, aligns with upregulated ligands in LS as described. However, the second function introduces some confusion:

# extract the ligand-receptor pairs with upregulated ligands and upregulated receptors in NL, i.e., downregulated in LS
net.down <- subsetCommunication(cellchat, net = net, datasets = "NL", ligand.logFC = -0.05, receptor.logFC = -0.05)

Here, both ligand.logFC and receptor.logFC are negative for the NL dataset, yet the comment suggests it represents upregulated ligands and receptors in NL, which implies downregulation in LS. This seems contradictory, as it would imply a double negative.

Could you please clarify if the tutorial's interpretation and code are correct, or if there might be an error in either the description or the code? Accurate understanding of this process is crucial for our analysis.

Thank you for your support.

Best regards,

Tim

PS: the 'receptor' is spelled wrong in your tutorial,

Screenshot 2023-12-07 at 9 19 16 AM
sqjin commented 9 months ago

Hi Tim @minitim222

The tutorial on this part is correct. When you merged your two cellchat objects, is the order as follows: "condA" and "condB"? If so, when identifying up-regulated interactions in condB compared to condA, you should run net.up <- subsetCommunication(cellchat, net = net, datasets = "condB",ligand.logFC = 0.2, receptor.logFC = 0.2). When identifying down-regulated interactions in condB compared to condA, you should run net.down <- subsetCommunication(cellchat, net = net, datasets = "condA",ligand.logFC = -0.1, receptor.logFC = -0.1).

When identifying down-regulated interactions in condB compared to condA, ligand.logFC = -0.1 and receptor.logFC = -0.1 will use the information from differential expression analysis to only retain the ligands and receptors that are down-regulated in condB compared to condA. datasets = "condA" indicates that we will retain the interactions in condA that are down-regulated in condB compared to condA. Assume that CellChat predicts WNT signaling in condA, but not in condB. Then we expect to identify WNT as down-regulated in condB compared to condA. Thus, we should set datasets = "condA".

Please let me know if you still feel confusing.

You can also check previous discussion for more explanations from me.