ncborcherding / scRepertoire

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

Clonal overlap #352

Closed Sogand65 closed 7 months ago

Sogand65 commented 7 months ago

Hi,

First, thanks again for the nice package you have provided for repertoire analysis. I want to analyze shared clones between patients and have come across an inconsistency in the visual representation of clonal overlap. Specifically, I'm observing a stark contrast between the results displayed in a heatmap generated by clonalOverlap() and a chord diagram created with getCirclize() followed by chordDiagram().

The heatmap (using the Morisita index) indicates almost no shared clones between different patients, while the chord diagram suggests notable sharing across patients. I used cloneCall = "strict" and method = "morisita" for the heatmap, and the standard parameters for getCirclize() and chordDiagram() for the circos plot.

Here are the respective codes I used for the plots

Heatmap

p6 <- clonalOverlap(scRep_BCR, cloneCall = "strict", method = "morisita", group.by = "sample", palette = "Blue-Red 2")

Circos Plot

circles <- getCirclize(scRep_BCR, group.by = "sample") chordDiagram(circles, self.link = 1, grid.col = col_T20_s)

Given the same dataset, I would expect both visualizations to reflect similar patterns of clonal overlap which was the case in my TCR analysis. Is this discrepancy expected due to different underlying metrics or visualization techniques between these two functions? Or could there be another factor at play, such as data preprocessing or thresholding, that I might need to adjust for consistency?

Any insights or suggestions to resolve this discrepancy would be greatly appreciated.

Thank you for your time and the valuable work on this package.

Best regards, Sogand Sajedi

ncborcherding commented 7 months ago

Hey Sogand,

Thanks for reaching out.

The likely underlying causes are 1) getCirclize() does not retain the clonal info after the tabulation, so there are several underlying assumptions there. You can read more with these several issues #94 #342. 2) getCirclize() is only showing individual clones along the outer circle.

However, there shouldn't be a "stark" contrast between the visualizations. If that is the case - would you mind making a reproducible example so I can troubleshoot if there is an issue? I'd really appreciate that.

Nick

Sogand65 commented 7 months ago

Hey Nick,

I'm currently discussing with my supervisor about the data sharing agreement to see how I can provide a reproducible example without violating any data privacy rules.

Regarding the discrepancy I mentioned, it indeed appears stark: in the heatmap, there are absolutely no shared clones between different patients, whereas the circos plot shows strong shared clonal presence. I will work on something that mirrors the issue without compromising any sensitive information. I hope to get back to you soon. Thanks again for your support and looking forward to resolving this.

Best, Sogand

ncborcherding commented 7 months ago

I am going to close this issue due to lack of progress - if you are willing to share a reproducible example with your data or the data built into scRepertoire, I'm happy to revisit things.

Sogand65 commented 7 months ago

Hey Nick!

I will return to this probably, I just don't know how to build a reproducible example while not violating the data agreement stuff ... However, thanks for following up... If I get back to it I will continue the discussion here ...

Best, Sogand