SCP 安装成功的单细胞转录组 docker镜像使用 single-cell-v5

SCP


# 使用 seuratV4 
.libPaths(c("/share/biosoft/R/Seurat4lib/", .libPaths()))
library(Seurat)
#library(velocyto.R)
#library(SeuratWrappers)
library(qs)
# 加载 SCP之前设置python 
Sys.setenv(RETICULATE_AUTOCONFIGURE = "FALSE")
library(reticulate)
use_python("/share/biosoft/python/Python-v3.10.10/bin/python", required = TRUE)
py_config()
#跳过警告
suppressPackageStartupMessages({
  #options(reticulate.conda_binary = "/path/to/conda", SCP_env_name = "SCP_env")
  library(SCP)
})


#测试


data("pancreas_sub")
print(pancreas_sub)

data("panc8_sub")
panc8_sub <- Integration_SCP(srtMerge = panc8_sub, batch = "tech", integration_method = "Seurat")
CellDimPlot(
  srt = panc8_sub, group.by = c("celltype", "tech"), reduction = "SeuratUMAP2D",
  title = "Seurat", theme_use = "theme_blank"
)


panc8_rename <- RenameFeatures(
  srt = panc8_sub,
  newnames = make.unique(capitalize(rownames(panc8_sub[["RNA"]]), force_tolower = TRUE)),
  assays = "RNA"
)
srt_query <- RunKNNMap(srt_query = pancreas_sub, srt_ref = panc8_rename, ref_umap = "SeuratUMAP2D")
ProjectionPlot( #这个会报错
  srt_query = srt_query, srt_ref = panc8_rename,
  query_group = "SubCellType", ref_group = "celltype"
)


pancreas_sub <- RunPAGA(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP"
)
PAGAPlot(srt = pancreas_sub, reduction = "UMAP", label = TRUE, label_insitu = TRUE, label_repel = TRUE)


pancreas_sub <- RunSCVELO(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP"
)
VelocityPlot(srt = pancreas_sub, reduction = "UMAP", group_by = "SubCellType")

  • 发表于 3小时前
  • 阅读 ( 14 )
  • 分类:转录组

0 条评论

请先 登录 后评论
omicsgene
omicsgene

生物信息

743 篇文章

作家榜 »

  1. omicsgene 743 文章
  2. 安生水 365 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 90 文章
  6. rzx 85 文章
  7. 红橙子 81 文章
  8. CORNERSTONE 72 文章