Skip to content

Commit c5cf94f

Browse files
committed
rmv old code
1 parent c12a1e0 commit c5cf94f

1 file changed

Lines changed: 0 additions & 43 deletions

File tree

R/mask.R

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -144,48 +144,6 @@ setMethod("mask_i_by_j",
144144
}
145145
assayNames(se) <- as
146146
return(se)
147-
148-
149-
# check for non-standard dimensions
150-
tzi <- which(axes(i, "name") %in% c("t", "z"))
151-
tzj <- which(axes(j, "name") %in% c("t", "z"))
152-
if (length(tzi)) {
153-
# get unique tz combinations
154-
ai <- lapply(tzi, \(.) seq_len(dim(di)[.]))
155-
ix <- as.list(rep(TRUE, length(dim(di))))
156-
jx <- as.list(rep(TRUE, length(dim(dj))))
157-
xx <- expand.grid(ai)
158-
res <- apply(xx, 1, \(.) {
159-
# subset to single tz pair
160-
ix[tzi] <- .; jx[tzj] <- .
161-
.di <- do.call(`[`, c(list(di), ix))
162-
.dj <- do.call(`[`, c(list(dj), jx))
163-
agg(.di, .dj, how)
164-
}, simplify=FALSE)
165-
} else {
166-
res <- apply(di, 1, \(.di) agg(.di, dj, how))
167-
res <- list(res)
168-
}
169-
# construct SCE:
170-
# data = tz combinations
171-
# dim. = instances x channels
172-
# if (length(dim(res[[1]])) == 1) {
173-
# nms <- list(NULL, names(res[[1]]))
174-
# res <- lapply(res, matrix, nrow=1, dimn=nms)
175-
# }
176-
se <- SingleCellExperiment(lapply(res, t))
177-
rownames(se) <- channels(i)
178-
# construct assay names with pattern 'how_t0z0'
179-
t <- "t" %in% axes(i, "name")
180-
z <- "z" %in% axes(i, "name")
181-
nm <- if (t && z) {
182-
sprintf("t%sz%s", xx[,1], xx[,2])
183-
} else if (t || z) {
184-
paste0(c("t", "z")[which(c(t, z))], xx[,1])
185-
}
186-
nm <- if (is.null(nm)) how else paste0(how, "_", nm)
187-
assayNames(se) <- nm
188-
return(se)
189147
})
190148

191149
.mask_map <- \(i, j) {
@@ -195,7 +153,6 @@ setMethod("mask_i_by_j",
195153
"POINT"=mutate(data(j), geometry=ST_Buffer(geometry, radius)),
196154
data(j))
197155
ddbs_intersects(df_j, data(i), sparse=TRUE)
198-
199156
}
200157

201158
#' @noRd

0 commit comments

Comments
 (0)