Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining TCR and BCR #331

Closed
msaezpalma opened this issue Mar 7, 2024 · 3 comments
Closed

Combining TCR and BCR #331

msaezpalma opened this issue Mar 7, 2024 · 3 comments

Comments

@msaezpalma
Copy link

Hi!
I'm currently working on TCR and BCR data and when I combine the Expression with the combineExpression function, both datsets are integrated in the Seurat Object metadata with the same name. That makes me not able to differentiate BCR and TCR in columns. I don't know if maybe I just need to add some line to the sunction or if I should continue doing all the analysis separately anthough I'll like to have all the data on one same Seurat Object.
Thanks a lot in advanced.
Maria

PD: The script I'm using now is this one:
bcr <- combineBCR(bcr_P7, samples = "L",
ID = "AV11081", threshold = 0.85)

tcr <- combineTCR(
tcr_P7,
samples = "L",
ID = "AV11081",
cells = "T-AB",
removeNA = FALSE,
removeMulti = FALSE,
filterMulti = FALSE
)

list.receptors <- c(tcr, bcr)

prova <- combineExpression(list.receptors,
P7_FNA,
cloneCall="gene",
chain = "both",
filterNA = FALSE,
cloneTypes = c(Rare = 1e-04, Small = 0.001, Medium = 0.01, Large = 0.1, Hyperexpanded = 1),
proportion = TRUE)

@ncborcherding
Copy link
Member

Hey @msaezpalma,

Thanks for reaching out.

Could you use clusters to differentiate between TCR and BCR?

Alternatively, you could add a column to your meta.data using something like:

prova$receptor <- substring(prova$CTaa, 1,2)

This would extract the first 2 characters in the CTaa column to use to differentiate. Although that might not work for clones that have NA_XXXX. You might need to play around with it more to get all the info you need.

Thanks,
Nick

@msaezpalma
Copy link
Author

Hi Nick,
Thanks for your fast answer. I did as suggested but my problem is that I do diferentiate the clusters of B cells and T cells but when I did the combineExpression with the tcr and bcr they end at the same columns.
Picture1
So for example when doing the occupiedscRepertoire it does it with all the BCR and TCR data and I don't know how to ask only for the BCR or only for the TCR. With the line you gave me I still can not differenciate it.
Picture2
Picture3
I was trying now to rename the columns and combining the tcr first and then the bcr so that I get two different columns like CTaa_bcr/CTaa_tcr and then for doing the graphs changing again the name of the columns for bcr or tcr as I need to analyse.
Picture4
looks now.
I hope I explained myself beacuse is a bit difficult.
Thanks a lot
Maria

@ncborcherding
Copy link
Member

Hey Maria,

Unfortuantely, changing the column names will likely break the functions you want to use.

In scRepertoire v2 - most visualizations have an parameter called chain, which you could use to isolate on TCR or BCRs using "TRB" or "IGH" respectively.

You can install it with:

devtools::install_github("ncborcherding/scRepertoire")

There is a change in a lot of function names - so heads up if you are upgrading. The other issue here is that the 2 graphs you show (now clonalOverlay() and clonalOccupy()) are utilizing the precalculated variables from combineExpression() and do not have chain argument - so if you wanted those in particular the best way would be to subset your Seurat object into B and T cells.

Nick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants