How to show their orig.ident after Merging Seurat objects TWICE ?
0
0
Entering edit mode
2.5 years ago
br0104 • 0

Please some smart brain help me!

I have three experimental groups and each group contains 3, 5, 3 PBMC sc RNA sequencing samples.

I want to draw a UMAP plot with those results.

My first trial was merging by each group for example

Group1 <- merge(1_1, y = c(1_2, 1_3), add.cell.ids = c("1_1", "1_2", "1_3"), project = "Group_1")
Group2 <- merge(2_1, y = c(2_2, 2_3, 2_4, 2_5), add.cell.ids = c("2_1", "2_2", "2_3", "2_4", "2_5"), project = "Group_2")
Group3 <- merge(3_1, y = c(3_2, 3_3), add.cell.ids = c("3_1", "3_2", "3_3"), project = "Group_3")

then merged again those three groups

Combined <- merge(Group_1, y = c(Group_2, Group_3), add.cell.ids = c("group1", "group2", "group3"), project = "group_all")

And I generated UMAP plot of 'Combined', but I could not label them or separate them by the original origin such as 1_1, 1_2, 1_3, 2_1, 2_2 ,etc. It just showed by Group1, Group2, Group3.

How can I plot combined UMAP with labeling by group and also by original sample?

schematic view

seurat R merge scRNA • 3.5k views
ADD COMMENT
0
Entering edit mode

The metadata will still contain a column orig.ident after merging that will contain the original sample identities. To make a UMAP plot using this the code would look something like this DimPlot(seu, group.by="orig.ident").

ADD REPLY
0
Entering edit mode

Thank you for your comment.

But that is what I already tried and "orig.ident" after merging twice shows only the second merged groups, 'group1, group2, group3' not '1_1', '1_2', '1_3', '2_1', '2_2' ~~ '3_3'.

ADD REPLY
0
Entering edit mode

R variables can't start with numbers, so let's assume your 1_1 variable is original_group_1. Just add a metadata column to each sample with this identity, so like original_group_1$identity <- "1_1".

ADD REPLY

Login before adding your answer.

Traffic: 2909 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