@@ -56,12 +56,12 @@ geomx_import_fun <- function(countFile, sampleAnnoFile, featureAnnoFile,
5656 stop(" colnames.as.rownames[1] is not in the column names of your count file." )
5757 }
5858 # make sure the name of negprobe is in the gene column of count data.
59- if (! NegProbeName %in% as.matrix(countdata [, colnames.as.rownames [1 ]])) {
59+ if (! all( NegProbeName %in% as.matrix(countdata [, colnames.as.rownames [1 ]]) )) {
6060 stop(" NegProbeName is not found in your count file." )
6161 }
6262
6363 # filter the count data, remove the negprobe.
64- countdata_filtered0 <- countdata [countdata [, colnames.as.rownames [1 ]] != NegProbeName , ]
64+ countdata_filtered0 <- countdata [! countdata [, colnames.as.rownames [1 ]] %in% NegProbeName , ]
6565 countdata_filtered <- countdata_filtered0 [, ! colnames(countdata_filtered0 ) %in%
6666 colnames.as.rownames [1 ]]
6767 rownames(countdata_filtered ) <- as.vector(as.matrix(countdata_filtered0 [, colnames.as.rownames [1 ]]))
@@ -102,9 +102,8 @@ geomx_import_fun <- function(countFile, sampleAnnoFile, featureAnnoFile,
102102 rownames(samplemeta_filtered ) <- samplemeta [, colnames.as.rownames [2 ]]
103103 samplemeta_filtered <- samplemeta_filtered [colnames(countdata_filtered ), ]
104104 # arrange according to count table.
105-
106105 # negprobe raw count
107- negprobecount <- countdata [countdata [, colnames.as.rownames [1 ]] ==
106+ negprobecount <- countdata [countdata [, colnames.as.rownames [1 ]] %in%
108107 NegProbeName , ]
109108 nprobename <- as.vector(as.matrix(negprobecount [,colnames.as.rownames [1 ]]))
110109 if (length(nprobename ) != length(unique(nprobename ))){
0 commit comments