Skip to content

Commit

Permalink
assay name
Browse files Browse the repository at this point in the history
  • Loading branch information
myushen committed Jul 24, 2024
1 parent 923de59 commit 6a0ec5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/import_metadata_and_counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,16 @@ import_one_sce <- function(
cli_alert_info("Generating pseudobulk counts from {file_id}. ")
pseudobulk_counts <- sce_obj |> aggregate_cells(c(sample_, cell_type_harmonised))

normalised_counts_best_distribution <- assay(pseudobulk_counts, "counts") |> as.matrix() |>
assay_name <- pseudobulk_counts |> assays() |> names()
normalised_counts_best_distribution <- assay(pseudobulk_counts, assay_name) |> as.matrix() |>
preprocessCore::normalize.quantiles.determine.target()

normalised_counts <- pseudobulk_counts |> quantile_normalise_abundance(
method="preprocesscore_normalize_quantiles_use_target",
target_distribution = normalised_counts_best_distribution
)

assay(normalised_counts, "counts") <- NULL
assay(normalised_counts, assay_name) <- NULL
names(assays(normalised_counts)) <- "quantile_normalised"

if (!dir.exists(file.path(cache_dir, "pseudobulk/original"))) {
Expand Down

0 comments on commit 6a0ec5b

Please sign in to comment.