plot2 · 代码 2 · 图 14 · 笔记 0 · 代码库专题
celloracle虚拟敲除-过表达实战
代码库整理的专题,README 见原始目录。
boxplot degree centrality all in celltype 2000figures/boxplot_degree_centrality_all_in_celltype_2000.png
共 8 张:点缩略图切换主图,下载按钮跟随当前主图。
图源:boxplot_degree_centrality_all_in_celltype_2000.png
分析代码
1 个源码文件,按目录顺序;本机绝对路径已替换为 ~。 代码可复制,但需要按自己的数据改路径与参数。
step1_convert_seurat2_h5ad.r
setwd("/Volumes/Seagate Basic/精品代码/111_celloracle实战GRN网络构建")
library(Seurat)
library(scop)
library(scCustomize)
pbmc <- readRDS("pbmc3k.RDS")
dim(pbmc)
CellDimPlot(pbmc,group.by = 'celltype')
pbmc <- FindVariableFeatures(pbmc,nfeatures = 3000)
VariableFeatures(pbmc)[1:3000]
gene <- VariableFeatures(pbmc)[1:3000]
pbmc <- pbmc[gene,]
dim(pbmc)
DefaultAssay(pbmc) <- 'RNA'
dim(pbmc)
# 假设你的 Seurat 对象名为 seurat_obj
as.anndata(x = pbmc, file_path = "./",
file_name = "pbmc.h5ad", assay = "RNA", main_layer = "counts",
other_layers = c("data"), transfer_dimreduc = TRUE, verbose = TRUE)