BiomedicalMachineLearning / stLearn

A novel machine learning pipeline to analyse spatial transcriptomics data
Other
190 stars 25 forks source link

How to get clear cell-pairs and ligand-receptor? #266

Closed Knight1995 closed 6 months ago

Knight1995 commented 10 months ago

Thanks for your great jobs! When I perform the following analysis: st.tl.cci.run(data, lrs, min_spots = 20, #Filter out any LR pairs with no scores for less than min_spots distance=0, # None defaults to spot+immediate neighbours; distance=0 for within-spot mode n_pairs=10000, # Number of random pairs to generate; low as example, recommend ~10,000 ncpus=30, # Number of CPUs for parallel. If None, detects & use all available. ) How can I get clear cell pairs and ligand receptors? For example, image I am curious whether AAACAAGTATCTCCCA-1 is a sender or a receptor. For the LR 'FN1_ITGA3, what is the sender or receptor of AAACAAGTATCTCCCA-1? Meanwhile,what is the 'FN1_ITGA3' score for this cell pair (AAACAAGTATCTCCCA-1 and its sender or a receptor,such as AAACAGGGTCTATATT-1_)? Thanks.

BradBalderson commented 10 months ago

This is a great question and was raised by #182, could you take a look at my answer there? Unfortunately I have not had time to implement this yet because of wrapping up my PhD and moving overseas for postdoc, but there is some starter code I provide on there. I will try and get to it over the next month.

BiomedicalMachineLearning commented 10 months ago

To identify if a cell is a sender or receiver regarding cci for a specific pair,you can check if it expresses the ligand but not the receptor (i.e. a sender), or the other way around. If it expresses both and there are senders and/or receivers in the neighbourhood (that is defined when calculating cci scores), then that information can be used to define if this cell is a sender or receiver. A posthoc permutation test comparing downstream pathways signals by this L-R pair with similar cells will help to define sender/receiver too. The stLearn paper will soon be out in Nature Communication in the next couple of weeks so you can read more about the principles of the method and can answer this. We have also developed methods to compare cci between conditions and will report it in two upcoming papers.

Knight1995 commented 10 months ago

Thanks for your reply. The source code is complex, so I hope a package function can solve it. Anyway, @BradBalderson Good luck in your next career! And also thanks to @BiomedicalMachineLearning help~