單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(一)批量讀取數(shù)據(jù)
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(二)批量創(chuàng)建Seurat對象及質(zhì)控
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(三)降維蜓席、聚類和細(xì)胞注釋
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(四)細(xì)胞比例餅圖
復(fù)現(xiàn)Figure 2a左邊那張圖
一、加載R包
if(T){
if(!require(BiocManager))install.packages("BiocManager")
if(!require(Seurat))install.packages("Seurat")
if(!require(Matrix))install.packages("Matrix")
if(!require(ggplot2))install.packages("ggplot2")
if(!require(cowplot))install.packages("cowplot")
if(!require(magrittr))install.packages("magrittr")
if(!require(dplyr))install.packages("dplyr")
if(!require(purrr))install.packages("purrr")
if(!require(ggrepel))install.packages("ggrepel")
if(!require(ggpubr))install.packages("ggpubr")
}
二族阅、數(shù)據(jù)處理
#挑選MG, Mo/MΦ,BAM三個細(xì)胞簇
Idents(sex_condition_objects[[1]]) <- sex_condition_objects[[1]]@meta.data$cell_type_selection
table(Idents(sex_condition_objects[[1]]))
#Microglia BAM
# 9454 500
clusters_taken_1 <- subset(sex_condition_objects[[1]], idents = c("Microglia","BAM"))
Idents(sex_condition_objects[[2]]) <- sex_condition_objects[[2]]@meta.data$cell_type_selection
table(Idents(sex_condition_objects[[2]]))
#Macrophages Microglia BAM
# 2131 1658 6981 375
clusters_taken_2 <- subset(sex_condition_objects[[2]], idents = c("Microglia","Macrophages","BAM"))
Idents(sex_condition_objects[[3]]) <- sex_condition_objects[[3]]@meta.data$cell_type_selection
table(Idents(sex_condition_objects[[3]]))
#Microglia BAM
# 9078 619 362
clusters_taken_3 <- subset(sex_condition_objects[[3]], idents = c("Microglia","BAM"))
Idents(sex_condition_objects[[4]]) <- sex_condition_objects[[4]]@meta.data$cell_type_selection
table(Idents(sex_condition_objects[[4]]))
#Macrophages Microglia BAM
# 2301 6071 527 344
clusters_taken_4 <- subset(sex_condition_objects[[4]], idents = c("Microglia","Macrophages","BAM"))
clusters_taken_list <- c(clusters_taken_1,clusters_taken_2,clusters_taken_3,
clusters_taken_4)
names(clusters_taken_list) <- names(sex_condition_objects)
# Normalize
clusters_objects <- lapply(clusters_taken_list, function(cluster_sample_object) {
cluster_sample_object <- ScaleData(cluster_sample_object)
cluster_sample_object
})
三、畫圖
# f_ctrl
DimPlot(clusters_taken_list[[1]],cols = c("#0cd2ae","#52b0e6"), group.by = "cell_type_selection")
# f_tumor
DimPlot(clusters_taken_list[[2]], cols = c("#0cd2ae","#fcc000","#52b0e6"),group.by = "cell_type_selection")
# m_ctrl
DimPlot(clusters_taken_list[[3]], cols = c("#0cd2ae","#52b0e6"),group.by = "cell_type_selection")
# m_tumor
DimPlot(clusters_taken_list[[4]], cols = c("#0cd2ae","#fcc000","#52b0e6"),group.by = "cell_type_selection")
將四幅圖簡單合并一下并與文獻(xiàn)原圖比較
往期單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(一)批量讀取數(shù)據(jù)
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(二)批量創(chuàng)建Seurat對象及質(zhì)控
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(三)降維存皂、聚類和細(xì)胞注釋
單細(xì)胞數(shù)據(jù)挖掘?qū)崙?zhàn):文獻(xiàn)復(fù)現(xiàn)(四)細(xì)胞比例餅圖