scRNA-seq reduction plot for individual group
1
0
Entering edit mode
4.9 years ago
Morris_Chair ▴ 370

Hello everyone and happy new year !

I am analyzing scRNA-seq for three replicates of 2 conditions in total 6 libraries using SURAT pipeline. They are from 3 PDX and I want to see if regardless of the treatment all them three overlap in a dimension reduction plot such as a UMAP.

In the metadata I have the column "library" containing each library number from 1 to 6. Considering that 1-2, 3-4 and 5-6 belong to the same PDX, can you please guys help me out to visualize with just three different colour this three PDX in a UMAP plot?

Thank you

RNA-Seq R • 1.6k views
ADD COMMENT
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Thanks for the link, do you know if there is a code that can be used with Seurat script?

ADD REPLY
0
Entering edit mode

Hi Arup, Thanks for the answer, I do have a subset in the metadata object called library, which contains all my libraries from 1 to 6. here is a screenshot

https://ibb.co/fSQyK0f

and here is my code for visualizing the colour clusters

seurat_object <- RunPCA(seurat_object, verbose = FALSE)
seurat_object <- RunUMAP(seurat_object, dims = 1:30, verbose = FALSE)

seurat_object <- FindNeighbors(seurat_object, dims = 1:30, verbose = FALSE)
seurat_object <- FindClusters(seurat_object, resolution = 0.09)
DimPlot(seurat_object, label = TRUE) + NoLegend()

it's not clear to me how can I use the SetIdent function, the idea is to show on a UMAP the three replicates with three different colours

can you please tell me more?

thank you

ADD REPLY
1
Entering edit mode

Can you provide some information about how you are handling the 6 libraries, like are you creating separate Seurat objects then merging them for UMAP or merging them prior to loading in R.

ADD REPLY
0
Entering edit mode

I'm using three files received from 10X already processed with cellranger so the libraries are merged together in a unique data.frame prior loading in R. I'm following the Seurat pipeline and to distinguish cells of each libraries I'm first taking the last number after the UMI

library <- substr(Cells(seurat_object), 18,18)

adding the column library in metadata which now contains the libraries codes (from 1 to 6)

seuratobj <- AddMetaData( seurat_object, library, "library")

Thanks Arup

ADD REPLY
1
Entering edit mode

Check the metadata has been applied to all the cells by length(seuratobj$library) if it returns the number of cells you are expecting, use seuratobj <- SetIdent(seuratobj, value = 'library') to change the active.ident . Now create the UMAP plot with DimPlot function. If possible move the comments to my answer as suggested by @genomax.

ADD REPLY
0
Entering edit mode

thank you Arup it worked :)

ADD REPLY
0
Entering edit mode

Please use ADD COMMENT/ADD REPLY when responding to existing posts to keep threads logically organized. This comment belongs under @Arup's answer.

SUBMIT ANSWER is for new answers to original question.

ADD REPLY
4
Entering edit mode
4.9 years ago

Seurat sets the color of the UMAP plot based on the active.ident factor, if you have the metadata for each group/cells somewhere in Seurat object set it as the active.ident using SetIdent function and the plot color will change accordingly.

ADD COMMENT

Login before adding your answer.

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