Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 3, 2022
1 parent e29f338 commit 9a8e35a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions R/simulator.R
Original file line number Diff line number Diff line change
Expand Up @@ -440,22 +440,24 @@ simulate_bulk <- function(data,
return(samples)
}, BPPARAM = BPPARAM)

bulk_counts <- Matrix::Matrix(vapply(
X = all_samples,
FUN = "[[",
... = 1,
FUN.VALUE = double(dim(SummarizedExperiment::assays(data)[["counts"]])[1])
),
sparse = TRUE
)
if ("tpm" %in% names(SummarizedExperiment::assays(data))) {
bulk_tpm <- Matrix::Matrix(vapply(
bulk_counts <- Matrix::Matrix(
vapply(
X = all_samples,
FUN = "[[",
... = 2,
FUN.VALUE = double(dim(SummarizedExperiment::assays(data)[["tpm"]])[1])
... = 1,
FUN.VALUE = double(dim(SummarizedExperiment::assays(data)[["counts"]])[1])
),
sparse = TRUE
)
if ("tpm" %in% names(SummarizedExperiment::assays(data))) {
bulk_tpm <- Matrix::Matrix(
vapply(
X = all_samples,
FUN = "[[",
... = 2,
FUN.VALUE = double(dim(SummarizedExperiment::assays(data)[["tpm"]])[1])
),
sparse = TRUE
)
assays <- list(bulk_counts = bulk_counts, bulk_tpm = bulk_tpm)
} else {
Expand Down

0 comments on commit 9a8e35a

Please sign in to comment.