使用DoubletDecon的Main_Doublet_Decon时报错
运行代码
library("DoubletDecon")
location="F:/....../"
expressionFile=paste0(location, "cntl_counts.txt")
genesFile=paste0(location, "cntl_Top50Genes.txt")
clustersFile=paste0(location, "cntl_Cluster.txt")
newFiles=Seurat_Pre_Process(expressionFile, genesFile, clustersFile)
results=Main_Doublet_Decon(rawDataFile=newFiles$newExpressionFile,
groupsFile=newFiles$newGroupsFile,
filename="cntl",
location=location,
fullDataFile=NULL,
removeCC=FALSE,
species="mmu",
rhop=1.1,
write=TRUE,
PMF=TRUE,
useFull=FALSE,
heatmap=FALSE,
centroids=TRUE,
num_doubs=100,
only50=TRUE,
min_uniq=4)
报错信息
WARNING: if using ICGS2 file input, please import 'rawDataFile' and 'groupsFile' as path/location instead of an R object.
错误于if (class(groupsFile) == "character") {:
the condition has length > 1
初步思路
思考是否是因为groupsFile的格式不对,故查看格式
> head(newFiles$newGroupsFile)
[,1] [,2]
AAACCTGAGGCCCTCA.1cntl 1 1
AAACCTGAGTTTGCGT.1cntl 1 1
AAACCTGTCGTAGGTT.1cntl 1 1
AAACGGGCAGCTCGCA.1cntl 1 1
AAACGGGTCGCTGATA.1cntl 1 1
AAAGATGAGACCGGAT.1cntl 1 1
不知道为什么会多“.1cntl”这个后缀,再查看剩余两个File,发现是一致的
> newFiles$newExpressionFile[1:4,1:4]
row_clusters-flat AAACCTGAGGCCCTCA.1cntl
column_clusters-flat NA 1
Slc6a11 1 1
Slc4a4 1 5
Sparcl1 1 0
AAACCTGAGTTTGCGT.1cntl AAACCTGTCGTAGGTT.1cntl
column_clusters-flat 1 1
Slc6a11 2 3
Slc4a4 0 2
Sparcl1 1 3
> newFiles$newFullExpressionFile[1:4,1:4]
row_clusters-flat AAACCTGAGGCCCTCA.1cntl
column_clusters-flat NA 1
Xkr4 NA 0
Sox17 NA 0
Mrpl15 NA 0
AAACCTGAGTTTGCGT.1cntl AAACCTGTCGTAGGTT.1cntl
column_clusters-flat 1 1
Xkr4 0 0
Sox17 0 0
Mrpl15 0 0
难道需要把“.cntl”这个后缀删掉吗?还是因为其它原因所以报错?
此外还用另一个方式创建newFiles,结果还是一样的后缀以及报错结果。
> newFiles=Improved_Seurat_Pre_Process(cntl, num_genes=50, write_files=FALSE)