3ca文件读取及注释信息添加

2023-01-11  本文已影响0人  皮尔洛_dys
setwd("G:\\3CA\\Breast") 
library(Seurat)
# https://hbctraining.github.io/scRNA-seq/lessons/readMM_loadData.html
library(Matrix)
library(R.utils)
matrix <- readMM("Exp_data_UMIcounts.mtx")
barcode <- read.table("Cells.csv",sep = ",",header = TRUE,row.names = 1)
genes <- read.table("Genes.txt")
row.names(matrix) <- genes$V1
colnames(matrix) <- row.names(barcode)
scar.atlas <- CreateSeuratObject(matrix,project = "SCAR_Atlas_0020")
scar.atlas@meta.data$cell_type <- barcode[row.names(scar.atlas@meta.data),"cell_type"]
上一篇下一篇

猜你喜欢

热点阅读