Skip to content

Commit

Permalink
use matrix multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed Jul 20, 2024
1 parent 1674609 commit 513cce4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions R/methods_SE.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,18 @@ setMethod("tidybulk", "RangedSummarizedExperiment", .tidybulk_se)

my_counts_scaled =
list(
assays(.data) %>%
as.list() %>%
.[[1]] %>%
multiply_by(
rep(multiplier, rep(nrow(.),length(multiplier)))
)
assay(.data) %*%
diag(multiplier)

) %>%
setNames(value_scaled)
colnames(my_counts_scaled[[1]]) = assay(.data) |> colnames()

as.list() %>%
.[[1]]colnames()

# Add the assay
assays(.data) = assays(.data) %>% c(my_counts_scaled)
assays(.data, withDimnames=FALSE) = assays(.data) %>% c(my_counts_scaled)

.data %>%

Expand Down Expand Up @@ -313,7 +314,7 @@ setMethod("scale_abundance",
as.matrix()

if(is.null(target_distribution)) target_distribution = preprocessCore::normalize.quantiles.determine.target(.data_norm)

.data_norm =
.data_norm |>
preprocessCore::normalize.quantiles.use.target(
Expand Down

0 comments on commit 513cce4

Please sign in to comment.