Amazing. Thank you very much!!
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
1 answer
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.
Is there a way to use this command for a partial match? Ex if you wanted a dimplot with cells expressing TRA:CAVAQAGTALIF?
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)
Log in to answer this question.
Looks like you're working with the
Seuratpackage. 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.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))?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.
$ FeaturePlot(tcr_testing,feature = c("TRAV13D-1") , pt.size = 0.5)
$ Error: None of the requested features were found: TRAV13D-1 in slot data