How to display TCR data in tsne space via seurat object
1
0
Entering edit mode
4.5 years ago

Hi Guys,

I am trying to work out how I can display by VDJ usage within my tsne plot for some 10x data. I added everything to the Seurat object and tried to do a feature plot to the gene of interest but it can not find them. Do I need to set something as the metadata column name?

Cheers,

J

R Seurat • 3.9k views
ADD COMMENT
0
Entering edit mode

Looks like you're working with the Seurat package. That should be a tag in your question. Please edit your question and add the tag, and in the future, be more thoughtful. Tags are how experts find questions that they can answer.

ADD REPLY
0
Entering edit mode

How did you add the VDJ data? Or are you just looking for expression of VDJ genes? Did you check to make sure your Seurat object has your gene of interest (e.g. "mygene" %in% rownames(seurat))?

ADD REPLY
0
Entering edit mode

I added the VDJ data via add metadata. I attempted a dim plot but can only plot all of them, not just one or two. A feature plot won't work at all.

ADD REPLY
0
Entering edit mode

$ FeaturePlot(tcr_testing,feature = c("TRAV13D-1") , pt.size = 0.5)

$ Error: None of the requested features were found: TRAV13D-1 in slot data

ADD REPLY
2
Entering edit mode
4.5 years ago

There isn't a great way to do this, but the best way I've found is something like:

tester <- subset(scrna, subset = cdr3s_aa == "TRA:CAVAQAGTALIF;TRB:CSALGESYEQYF")
cells <- Cells(tester)
DimPlot(scrna, cells.highlight = cells)

Or as a one-liner:

DimPlot(scrna, cells.highlight = Cells(subset(scrna, subset = cdr3s_aa
== "TRA:CAVAQAGTALIF;TRB:CSALGESYEQYF")))

Substitute your metadata column and TCR info of interest as needed.

ADD COMMENT
0
Entering edit mode

Amazing. Thank you very much!!

ADD REPLY
0
Entering edit mode

Is there a way to use this command for a partial match? Ex if you wanted a dimplot with cells expressing TRA:CAVAQAGTALIF?

ADD REPLY
0
Entering edit mode

Should be able to do it with grepl, though Seurat's subset tomfoolery makes it unclear how to do so. So I'm going to recommend dittoSeq's `dittoDimPlot command instead, which will work directly on your Seurat object just fine.

Something like:

dittoDimPlot(scrna, var = "cdr3s_aa", 
             cells.use = grepl("TRA:CAVAQAGTALIF", scrna$cdr3s_aa, fixed = TRUE), 
             show.others = TRUE)
ADD REPLY

Login before adding your answer.

Traffic: 1591 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6