导包
library(Seurat)
library(SCINA)
library(preprocessCore)
#读取原始数据
exp=read.csv("/media/public1/wy/SCINA/pancreas/Baron_R_SCINA.csv",row.names=1,stringsAsFactors = F)
# 首先将其转换为矩阵
exp_raw = as.matrix(exp_raw)
#Log scale and quantile normalization
exp_raw=log(exp_raw+1)
exp[]=normalize.quantiles(exp_raw)
#读取标记基因
signatures=preprocess.signatures("/media/public1/wy/SCINA/pancreas/baron_marker.csv")
#运行结果
results = SCINA(exp, signatures, max_iter = 100, convergence_n = 10, convergence_rate = 0.999, sensitivity_cutoff = 0.9, rm_overlap=TRUE, allow_unknown=TRUE, log_file='SCINA.log')
#另存结果
cell_labels_data <- results$cell_labels
write.csv(cell_labels_data, file = "/media/public1/wy/SCINA/pancreas/baron_cell_labels.csv", row.names = FALSE)
报错1:Error in chol.default(theta[[i]]$sigma1) : 'a' must have dims > 0
解决方法:rm_overlap=FALSE
报错2:Error in if (any(keep)) { : missing value where TRUE/FALSE needed
解决方法1:rm_overlap=FALSE
解决方法2:调整signatures,使每列最好保持20-50