昨天值班忙的不歇火。🫠
下周还要出门诊。😭
要找个周末出去骑骑车了。🚴
上次去余杭
发现有个地方很适合骑车,下次要带上车子去玩一下。😜
大家最近忙不忙啊,其实我最近还好,终于有点时间做点自己的事情了。🙊
明明是认真的完成了自己的工作,不过总有人觉得你过的太舒服,非要让你过上牛马一样的生活,他才觉得是正常的,真是不能理解。🙃
工作是为了更好的生活,而生活绝对不是为了更好的工作。💼
rm(list = ls())
library(Seurat)
library(tidyverse)
library(cowplot)
library(patchwork)
library(WGCNA)
library(hdWGCNA)
记得设置一下哦。😘
theme_set(theme_cowplot())
set.seed(123)
enableWGCNAThreads(nThreads = 8)
我们把上次保存的文件load
进来。😘
大家不清楚的可以去看上一期的教程。😏
load("./hdWGCNA_object.Rdata")
基因评分分析是单细胞转录组学中一种流行的方法,用于计算一组基因的整体特征的评分。💪
这里可以使用UCell
或Seurat
算法计算每个模块指定数量基因的打分。😘
这里用前25
个gene
哦。😯
library(UCell)
seurat_obj <- ModuleExprScore(
seurat_obj,
n_genes = 25,
method='UCell'
)
plot_list <- ModuleFeaturePlot(
seurat_obj,
features='hMEs',
order=TRUE
)
wrap_plots(plot_list, ncol=7)
绘制hub gene
特征分数。😏
plot_list <- ModuleFeaturePlot(
seurat_obj,
features='scores', # plot the hub gene scores
order='shuffle',
ucell = TRUE # depending on Seurat vs UCell for gene scoring
)
wrap_plots(plot_list, ncol=7)
hdWGCNA
可以根据每个模块的hME
、ME
或hub gene
分数可视化每个模块之间的相关性。🦀
# plot module correlagram
ModuleCorrelogram(seurat_obj)
# get hMEs from seurat object
MEs <- GetMEs(seurat_obj, harmonized=TRUE)
modules <- GetModules(seurat_obj)
mods <- levels(modules$module); mods <- mods[mods != 'grey']
# add hMEs to Seurat meta-data:
seurat_obj@meta.data <- cbind(seurat_obj@meta.data, MEs)
p <- DotPlot(seurat_obj, features=mods, group.by = 'cell_type')
p <- p +
RotatedAxis() +
scale_color_gradient2(high='red', mid='grey95', low='blue')
p
最后祝大家早日不卷!~