在运行以下代码报错
integrated_seurat <- IntegrateData(anchorset = anchors, dims = 1:20)
#Error in idx[i, ] <- res[[i]][[1]] : number of items to replace is not a multiple of replace
原因:IntegrateData在整合对象时,如果有对象细胞数小于100就会报错。k.weight默认为100,需要调整k.weight为最小细胞数,假如为80,则:
integrated_seurat <- IntegrateData(anchorset = anchors, dims = 1:20,k.weight=80)