ncborcherding / scRepertoire

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

Most prominent sequence #129

Closed s849 closed 2 years ago

s849 commented 2 years ago

Hi Nick,

Thank you for developing this great tool. I have used screpertoire successfully. However, I am wondering how I can identify the clonotypes with the most prominent sequence so I can visualize them on my embedding?

Thanks in advance.

ncborcherding commented 2 years ago

Hey s849,

There is a function highlightClonotypes() in scRepertoire, where you can select specific clones to highlight on your embedding. You would have to do your own identification of the "most prominent" clonotype though. But you can get a quick number breakdown using the table function.

x <- table(SeuratObj$CTaa)

I think this is the question, but let me know if I am off the mark.

Thanks, Nick

ncborcherding commented 2 years ago

I am going to close this due to lack of reply, but please feel free to follow up.

s849 commented 2 years ago

Thanks, Nick! This is exactly what I needed!

I am now wondering If there is a way to find clonotypes that are similar across conditions? For example, if I have condition A and condition B, is it possible to find clonotypes that are shared between A/B?

Also, is it possible to find clonotypes that are specific to a condition but shared with replicates? For example, is it possible to find clonotypes that are unique to A but shared across A replicates?

Not sure if this is possible or if the very nature of clonotypes would prevent for sequences to be similar across replicates.

Looking forward to your response.

Thank you!

ncborcherding commented 2 years ago

Hey S849,

Theoretically, it is possible for shared clonotypes across conditions or replicates, but it is unlikely (given it is a biological and not technical replicate). If it is a technical replicate, sequencing the same tumor for example- then clonotypes may have significant overlap. One quick way to check would be to use clonalOverlap(), just to see if that is happening.

In terms of identifying the sequences that are shared, my first step would be to expand on my first answer, which can apply to either condition or replicate.

x <- as.data.frame(table(SeuratObj$CTaa, SeuratObj$condition))
whcih(x[,1] & x[,2] != 0)

If you identify shared clones, you can then use something like compareClonotypes() across your replicates or conditions using the specific clones.

Nick