你的位置:性吧, > 步非烟 足交 > 丝袜美腿 亚洲色图 5种形态好意思化你的单细胞umap散点图
丝袜美腿 亚洲色图 5种形态好意思化你的单细胞umap散点图
发布日期:2025-07-03 15:33    点击次数:163

丝袜美腿 亚洲色图 5种形态好意思化你的单细胞umap散点图

咱们生信手段树的单细胞月更群内部世俗看到小伙伴提议的图片好意思化需求丝袜美腿 亚洲色图,这就来望望单细胞umap好意思化器具吧!

第一种:SCP 包(这个包相配的出色)

对于SCP,咱们前边也有一个故意的专辑对其进行了大篇幅的先容,不知说念大家用起来了没呢?

端到端的单细胞管说念SCP-整合经过端到端的单细胞管说念SCP-细胞质控端到端的单细胞管说念SCP-尺度经过端到端的单细胞管说念SCP-快速运转SCP—为单细胞分析联想的端到端处分有盘算端到端的单细胞管说念SCP-安设

其学习的官网地址为:https://zhanghao-njmu.github.io/SCP/index.html

莫得安设的,此次就不要再错过啦:

# 安设devtools::install_github("zhanghao-njmu/SCP")

本次,咱们使用的数据为来自 GSE128531 数据预防后的seurat对象,你我方用的技巧不错使用任何一个经过了预防后的seurat对象。

rm(list=ls())library(COSG)library(harmony)library(ggsci)library(dplyr) library(future)library(Seurat)library(clustree)library(cowplot)library(data.table)library(dplyr)library(ggplot2)library(patchwork)library(stringr)library(qs)# 导入数据sce.all.int <- readRDS('2-harmony/sce.all_int.rds')sp <- 'human'head(sce.all.int@meta.data)load("phe.Rdata")head(phe)sce.all.int <- AddMetaData(sce.all.int, metadata = phe)Idents(sce.all.int) <- "celltype"table(Idents(sce.all.int))

图片

看一下它对UMAP可视化的历害之处!

1、先看默许主题一键出图:
################## umap1library(SCP)head(sce.all.int@meta.data)CellDimPlot(sce.all.int, group.by = "celltype", reduction = "UMAP")

这个配色相配CNS,且图中展示了总细胞数,每个亚群的细胞数这些信息:

图片

2、坐标改成 左下小箭头,亦然大家非常常见的需求!
# 左下小箭头CellDimPlot(sce.all.int, group.by = "celltype", reduction = "UMAP", theme_use = "theme_blank")

图片

3、只露出X、Y轴

还不错一键退换全体字体大小:

CellDimPlot(sce.all.int, group.by = "celltype", reduction = "UMAP",             theme_use = ggplot2::theme_classic, theme_args = list(base_size = 16))

图片

上头三个是我最可爱的ump作风,还有许多其他,总有你的一款:

图片

第二种:Nebulosa(r包)

Nebulosa 是一个基于核密度推断可视化单细胞数据的 R 包,主要通过招引细胞之间的通常性来规复丢失特征中的信号,从而罢了细胞特征的“卷积”。

学习官网:https://bioconductor.org/packages/devel/bioc/vignettes/Nebulosa/inst/doc/nebulosa_seurat.html

Nebulosa 的主邀功能是 plot_density丝袜美腿 亚洲色图,让咱们按照以下形态绘制 一些marker基因 的核密度推断图,展示的marker基因抒发水平上下:

在线看三级片
# 安设一下options(BioC_mirror="https://mirrors.westlake.edu.cn/bioconductor")options("repos"=c(CRAN="https://mirrors.westlake.edu.cn/CRAN/"))BiocManager::install("Nebulosa")library(Nebulosa)
1、 绘制一个基因PTPRC

这种图亦然在许多CNS级别的著作中出现的:

# 绘制一个基因PTPRCp1 <- plot_density(sce.all.int,性感尤物 c("PTPRC"),size = 0.3)p1

图片

2、绘制多个基因
# 同期绘制多个基因p3 <- plot_density(sce.all.int, c("CD3D","CD4","CD8A","CD68"),size = 0.3)p3

效果如下:

图片

3、绘制基因共抒发

这里不错同期展示两个基因都抒发的地点:

# combine = FALSE 只保留两个基因都抒发的区域p4 <- plot_density(sce.all.int, c("CD8A", "CCR7"), joint = TRUE,combine = FALSE) p4

图片

第三种:scCustomize(r包)

学习官网:https://samuel-marsh.github.io/scCustomize/index.html

# 安设# Base Rinstall.packages("scCustomize")

绘制:不错绘制一个marker,也不错展示多个marker:

################## umap4:scCustomizelibrary(viridis)library(Seurat)library(scCustomize)FeaturePlot_scCustom(seurat_object = sce.all.int, features = c("VWF","CD3E"), order = F)

这种作风很像早期的椒盐绘制作风:你看这个着色点是不是很像洒在鸡腿上头的椒盐!(椒盐作风这个词我在一篇单细胞文件中遭遇过,刻下找不见了,那时还故意在群里问了来着哈哈哈哈)

图片

还不错松驰地修改配色:

# 修改热诚# Set color palettepal <- viridis(n = 10, option = "D")FeaturePlot_scCustom(seurat_object = sce.all.int, features = c("VWF","CD3E"),                      colors_use = pal, order = T,pt.size = 0.3)

图片

第四种:ggplot2绘制细胞密度umap图

在seurat包中有东说念主提议一个绘制需求:https://github.com/satijalab/seurat/issues/6962

图片

这种图主要用来处理数据点重迭问题时相配有效,使用 MASS::kde2d() 进行二维核密度推断,并通过等高线露出效果,geom_density_2d() 绘制等高线,而 geom_density_2d_filled() 绘制填充的等高线带。

商酌:https://ggplot2.tidyverse.org/reference/geom_density_2d.html

library(cetcolor)library(Seurat)library(ggplot2)# 建造热诚scale.col <- cet_pal(16, name = "fire")# generate UMAP plotpl1 <- UMAPPlot(sce.all.int, combine = FALSE) # returns full ggplot objectpl1# make plotpl1[[1]] &   stat_density_2d(aes_string(x = "umap_1", y = "umap_2", fill = "after_stat(level)"),                   linewidth = 0.2, geom = "density_2d_filled",                   colour = "ivory", alpha = 0.4, n = 150, h = c(1.2, 1.2)) &   scale_fill_gradientn(colours = scale.col) &   DarkTheme()

这种作风很特有:

图片

第五种:ggpointdensity(r包)

在二维坐标系中可视化数据点有几种法式:若是你有大都的数据点重迭在一王人,geom_point() 无法为你提供重迭点的数目推断。

刚刚上头先容的geom_density2d() 和 geom_bin2d() 不错处分这个问题,但它们使得无法探听个别极度点,而这些极度点可能具有接头价值。

geom_pointdensity() 旨在通过招引两者的优点来处分这个问题:各个点证明驾御点的数目进行着色。这使得你既能看到全体散布,也能看到个别点。

学习官网:https://github.com/LKremer/ggpointdensity

细胞密度图:

# 安设install.packages("ggpointdensity")library(ggpointdensity)# 索要umap坐标数据dat <- Embeddings(sce.all.int, reduction = "umap")head(dat)# umap_1    umap_2# SC67mf2_AAACCTGAGAGTAATC -3.541568  5.127461# SC67mf2_AAACCTGAGCGCTTAT -6.623588 -3.025122# SC67mf2_AAACCTGAGGACACCA -4.586405  1.513219ggplot(data = dat, mapping = aes(x = umap_1, y = umap_2)) +  geom_pointdensity() +  scale_color_viridis()

图片

诚然,它还不错展示marker特征基因抒发:

# 索要umap坐标以及特征基因抒发df <- FetchData(object =sce.all.int, vars = c("umap_1", "umap_2", "CD3D"), layer = "data")head(df)# umap_1    umap_2     CD3D# SC67mf2_AAACCTGAGAGTAATC -3.541568  5.127461 0.000000# SC67mf2_AAACCTGAGCGCTTAT -6.623588 -3.025122 1.430228# SC67mf2_AAACCTGAGGACACCA -4.586405  1.513219 0.000000p <- ggplot(df, aes(x= umap_1, y= umap_2 )) +  geom_point(data = df %>% filter(CD3D == 0), color = "#440154FF", size = 0.6) +  ggpointdensity::geom_pointdensity(data = df %>% filter(CD3D > 0), size = 0.6) +  viridis::scale_color_viridis() +  theme_classic(base_size = 14) +  labs(color= "CD3D")p

效果如下:

图片

上头哪一款是你的菜?不错在挑剔区高声说出来(爱就要勇敢说出来!)。

友情宣传:

生信初学&数据挖掘线上直播课2025年1月班

时隔5年,咱们的生信手段树VIP学徒络续招生啦

旺盛你生信分析运筹帷幄需求的廉价处分有盘算丝袜美腿 亚洲色图

本站仅提供存储工作,悉数践诺均由用户发布,如发现存害或侵权践诺,请点击举报。