向Seurat对象添加降维对象

目前手上有一个Seurat对象文件,但是不知道具体的降维参数是什么,做不出好看的UMAP图。向Seurat对象添加降维对象_第1张图片

但是手上有分得开的umap坐标文件,尝试给seurat对象添加umap坐标信息。

#head umap.csv 二维坐标文件
,UMAP_1,UMAP_2
AAACCCACAAATCAAG-1-pre-A-Pre-A,-1.2567477,-1.842364
AAACCCAGTTAGTCGT-1-pre-A-Pre-A,0.8261862,-0.6721347
AAACCCATCTACGGTA-1-pre-A-Pre-A,-0.8856455,-3.1103482
AAACGAAAGAGTCGAC-1-pre-A-Pre-A,-3.3513086,-1.9546206
AAACGAAAGATGCTAA-1-pre-A-Pre-A,3.8983371,-4.2920694
AAACGAAGTGAAGCGT-1-pre-A-Pre-A,-0.78431445,-4.2997723
AAACGCTAGAGATCGC-1-pre-A-Pre-A,-2.8404791,-0.54733366
AAACGCTAGGGCGAAG-1-pre-A-Pre-A,-3.6928513,-2.0537117
AAACGCTCATAAGCAA-1-pre-A-Pre-A,-2.7601285,-1.3398402

 Seurat添加降维信息的命令是CreateDimReducObject

也可以自己定义名字"XXX"

loca <- read.csv("umap.csv",row.names=1)
loca <- as.matrix(loca)
tcell[["umap"]] <- CreateDimReducObject(embeddings=loca)

DimPlot(tcell,reduction="umap",label=T)+NoLegend()

向Seurat对象添加降维对象_第2张图片

 goooood!!!

#或者可以直接添加到embeddings位置也是可以的
Liver@[email protected] <- as.matrix(loca)

你可能感兴趣的:(生物信息学,r语言)