ncborcherding / scRepertoire

A toolkit for single-cell immune profiling
https://www.borch.dev/uploads/screpertoire/
MIT License
308 stars 52 forks source link

How to best summarise clonal sharing for a metadata column in Seurat object? #427

Closed denvercal1234GitHub closed 2 hours ago

denvercal1234GitHub commented 4 hours ago

Hi, Nick,

I hope all is well.

I am revisiting some old data with scRepertoire and unfortunately could not find a robust way to get a table of both the number of clones that shared between different cluster ID and the sequence of these clones in my Seurat object that has the clone info.

Previously, I had used clonalNetwork() exportTable, which gave me the cluster IDs that have any clone shared, but it does not give the number of the clones that are shared (only the weight, which only allows me to rank how much sharing but then I cannot tell how many of clones shared in that weight coming from unique clone versus duplicated).

When, I used clonalNetwork() exportClone together with filter.identity, it give me the sequence of the clones shared from that cluster identity, but then I have no way to know which sequence belong to which cluster ID that this identity shares with. lol.

Do you recommend just summarise manually from the Seurat meta.data?

Thank you for your help!

ncborcherding commented 2 hours ago

Hey Quang,

Thanks for reaching out - based on my understanding of your needs - you'll have to manually summarize the meta data. But I would use the exportTable() output to get the unique clones.

This could be a straight forward dplyr summarize() call with grouping by cluster and your clone call (CTaa for instance). You can then filter the results by any CTaa that appears more than once in the table.

Good luck and hope that helps, Nick