愿武艺晴小朋友一定得每天都开心
前期工作是拿到了跟作者大差不差的UMAP坐标。然后可视化经典Marker基因后,将大致分类定下来以后。将要去跟作者scRNA-seq 数据的(.rds)联合,去做注释。
步骤上分为:1)第一轮的无约束整合;2)第二轮的约束整合;3)确定好了细胞类型后,addToArrow=TRUE,拿到“GeneIntegrationMatrix”矩阵;
1)无约束整合(探索性质的无约束整合);Unconstrained Integration;
所用函数是:addGeneIntegrationMatrix()函数
其中该函数:seRNA参数接受Seurat
或RangedSummarizedExperiment
对象作为输入。
因为第一轮是探索性质的无约束整合,因此不要将结果保存在Arrow中(addToArrow=FALSE);
projHeme2 <- addGeneIntegrationMatrix(
ArchRProj = projHeme2,
useMatrix = "GeneScoreMatrix",
matrixName = "GeneIntegrationMatrix", #用来命名整合后的矩阵
reducedDims = "PeakMatrix-IterativeLSI",#或者是IterativeLSI-TileMatrix
seRNA = seRNA, #接受Seurat或RangedSummarizedExperiment对象作为输入
addToArrow = FALSE, #很确认细胞核类型时再用:addToArrow=TRUE
groupRNA = "BioClassification",
nameCell = "predictedCell_Un", #存放scRNA-seq中匹配的细胞ID
nameGroup = "predictedGroup_Un", #存放scRNA-seq 细胞中的分组ID
nameScore = "predictedScore_Un") #存放跨平台整合得分
unique(projHeme2@cellColData$predictedGroup_Un)
2)约束整合(进一步优化整合结果);
我们创建一个confusionMatrix,并关注cluster和predictedGroup_Un
> #创建一个confusionMatrix, > cM <- as.matrix(confusionMatrix(projHeme2$`PeakMatrix-Clusters`, projHeme2$predictedGroup_Un)) > preClust <- colnames(cM)[apply(cM, 1 , which.max)] > cbind(preClust, rownames(cM)) #Assignments preClust [1,] "15_CLP.2" "C23&