diff --git a/DESCRIPTION b/DESCRIPTION index 8702705..cb937a6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: tidySingleCellExperiment Title: Brings SingleCellExperiment to the Tidyverse -Version: 1.15.4 +Version: 1.15.5 Authors@R: c(person("Stefano", "Mangiola", comment=c(ORCID="0000-0001-7474-836X"), email="mangiolastefano@gmail.com", diff --git a/R/methods.R b/R/methods.R index e884bcf..4fa2b1b 100755 --- a/R/methods.R +++ b/R/methods.R @@ -232,12 +232,12 @@ setMethod("aggregate_cells", "SingleCellExperiment", function(.data, subset(!!.sample) |> unite("my_id_to_split_by___", !!.sample, remove=FALSE, sep = "___") - new_col_data = new_col_data |> DataFrame(row.names = new_col_data$my_id_to_split_by___) |> _[,-1] + new_col_data = new_col_data |> DataFrame(row.names = new_col_data$my_id_to_split_by___) |> _[,-1,drop=FALSE] colData(aggregated_sce) = colData(aggregated_sce) |> cbind( - new_col_data[match(rownames(colData(aggregated_sce)), rownames(new_col_data)),] + new_col_data[match(rownames(colData(aggregated_sce)), rownames(new_col_data)),,drop=FALSE] ) rowData(aggregated_sce) = rowData(.data) diff --git a/R/tidybulk_utilities.R b/R/tidybulk_utilities.R index b708d4f..c1dd43a 100644 --- a/R/tidybulk_utilities.R +++ b/R/tidybulk_utilities.R @@ -132,7 +132,7 @@ as_SummarizedExperiment <- function(.data, tidyr::nest(`data`=-`assay`) %>% mutate(`data`=`data` %>% map( ~ .x %>% - spread(!!sample__$symbol, .a) %>% + pivot_wider(names_from = !!sample__$symbol, values_from = .a) %>% # arrange sample select(!!feature__$symbol, any_of(rownames(colData))) |>