Skip to content

Commit b6473f6

Browse files
committed
update readGeoMx to fix a bug when reading multiple negprobe and remove
1 parent adacb74 commit b6473f6

File tree

5 files changed

+3
-4
lines changed

5 files changed

+3
-4
lines changed

.DS_Store

4 KB
Binary file not shown.

R/geomx_import_data.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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))){

inst/.DS_Store

6 KB
Binary file not shown.

man/.DS_Store

6 KB
Binary file not shown.

tests/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)