Skip to content

Commit

Permalink
Updated decontX messages
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-d-campbell committed Sep 30, 2021
1 parent 3396d5b commit 45bbb34
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions R/decon.R
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,17 @@ setMethod(
)
)
}

## Try to convert class of new matrix to class of original matrix

.logMessages(
date(),
".. Calculating final decontaminated matrix",
logfile = logfile,
append = TRUE,
verbose = verbose
)

estRmat.temp <- calculateNativeMatrix(
counts = countsBat,
theta = res$theta,
Expand All @@ -495,6 +506,8 @@ setMethod(
z = as.integer(res$z),
pseudocount = 1e-20
)

# This part needs to be optimized
estRmat[seq(nrow(counts)), which(batch == bat)] <- estRmat.temp
dimnames(estRmat) <- list(geneNames, allCellNames)

Expand Down Expand Up @@ -528,19 +541,17 @@ setMethod(
"z" = returnZ
)

## Try to convert class of new matrix to class of original matrix
if (inherits(counts, "dgCMatrix")) {

if (inherits(counts, c("DelayedMatrix", "DelayedArray"))) {

.logMessages(
date(),
".. Finalizing decontaminated matrix",
".. Converting decontaminated matrix to ", class(counts),
logfile = logfile,
append = TRUE,
verbose = verbose
)
}

if (inherits(counts, c("DelayedMatrix", "DelayedArray"))) {


## Determine class of seed in DelayedArray
seed.class <- unique(DelayedArray::seedApply(counts, class))[[1]]
if (seed.class == "HDF5ArraySeed") {
Expand Down

0 comments on commit 45bbb34

Please sign in to comment.