Skip to content

Commit 8cd4b4e

Browse files
author
Jieun Kim
committed
edit for BioC resubmission
1 parent 1ef90bd commit 8cd4b4e

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Cepo
22
Title: Cepo for the identification of differentially stable genes
3-
Version: 0.99.3
3+
Version: 0.99.4
44
Authors@R:
55
c(
66
person(given = "Hani Jieun",

R/Cepo.R

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Cepo <- function(exprsMat, cellTypes, minCells = 20, minCelltype = 3, exprsPct =
8686

8787
## Select only batches with more than `minCelltype` number of
8888
## cell types
89-
batches = names(which(rowSums(table(block, cellTypes) > minCells) >=
89+
batches <- names(which(rowSums(table(block, cellTypes) > minCells) >=
9090
minCelltype))
9191

9292
## Run Cepo by batch
@@ -103,22 +103,22 @@ Cepo <- function(exprsMat, cellTypes, minCells = 20, minCelltype = 3, exprsPct =
103103
return(singleBatch)
104104

105105
})
106-
names(batch_result) = batches
106+
names(batch_result) <- batches
107107

108-
types = unique(unlist(lapply(batch_result, function(x) {
109-
names(x$stats@listData)
108+
types <- unique(unlist(lapply(batch_result, function(x) {
109+
colnames(x$stats)
110110
})))
111-
idx = Reduce(intersect, lapply(batch_result, function(x) {
112-
x$stats@rownames
111+
idx <- Reduce(intersect, lapply(batch_result, function(x) {
112+
rownames(x$stats)
113113
}))
114114

115115
averageCepo <- lapply(types, function(celltype) {
116116
mat <- do.call(cbind, lapply(batch_result, function(x) {
117-
x$stats@listData[[celltype]][idx]
117+
x$stats[idx ,celltype]
118118
}))
119119
return(rowMeans(mat))
120120
})
121-
names(averageCepo) = types
121+
names(averageCepo) <- types
122122
averageStatsResult <- S4Vectors::DataFrame(sortList(averageCepo))
123123

124124

@@ -130,11 +130,11 @@ Cepo <- function(exprsMat, cellTypes, minCells = 20, minCelltype = 3, exprsPct =
130130

131131
averageCepoPvals <- lapply(types, function(celltype) {
132132
mat <- do.call(cbind, lapply(batch_result, function(x) {
133-
x$pvalues@listData[[celltype]][idx]
133+
x$pvalues[idx, celltype]
134134
}))
135135
return(mat)
136136
})
137-
names(averageCepoPvals) = types
137+
names(averageCepoPvals) <- types
138138
averagePvalResult <- S4Vectors::DataFrame(sortList(averageCepoPvals))
139139
averageResult <- list(stats = averageStatsResult, pvalues = averagePvalResult)
140140
}
@@ -417,7 +417,7 @@ geneStats <- function(Tstat, method = "OSP") {
417417
#' # BPPARAM = setCepoBPPARAM(workers = 1)))
418418
#' # system.time(BiocParallel::bplapply(1:3, FUN = function(i){Sys.sleep(i)},
419419
#' # BPPARAM = setCepoBPPARAM(workers = 3)))
420-
setCepoBPPARAM = function(workers = 1L, ...) {
420+
setCepoBPPARAM <- function(workers = 1L, ...) {
421421
if (workers == 1) {
422422
return(BiocParallel::SerialParam())
423423
} else if (.Platform$OS.type == "windows") {

0 commit comments

Comments
 (0)