From fc5c1340250c542491a7d9bb7e5a0198c886cf56 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Tue, 17 Sep 2024 15:32:51 +0300 Subject: [PATCH] update vignettes and dependencies --- DESCRIPTION | 1 + vignettes/pseudobulk_transcriptomics.Rmd | 8 ++++---- vignettes/solutions_transcriptomics.Rmd | 4 ++-- vignettes/spatial_bioconductor_transcriptomics.Rmd | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8ebff0e..b72c421 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -58,6 +58,7 @@ Imports: tidybulk, glue, scater, + scran, batchelor Suggests: knitr, diff --git a/vignettes/pseudobulk_transcriptomics.Rmd b/vignettes/pseudobulk_transcriptomics.Rmd index 9173bc0..aa39f43 100644 --- a/vignettes/pseudobulk_transcriptomics.Rmd +++ b/vignettes/pseudobulk_transcriptomics.Rmd @@ -184,19 +184,19 @@ pseudo_bulk_nested = pseudo_bulk_nested |> # Identify top significant genes - mutate(top_genes = map_chr( + mutate(top_genes = map( grouped_summarized_experiment, ~ .x |> pivot_transcript() |> arrange(pvalue) |> - head(1) |> - pull(.feature) + dplyr::slice(1:10) |> + pull(.feature) )) |> # Filter top gene mutate(grouped_summarized_experiment = map2( grouped_summarized_experiment, top_genes, - ~ filter(.x, .feature == .y) + ~ .x |> filter(.feature %in% .y) )) pseudo_bulk_nested diff --git a/vignettes/solutions_transcriptomics.Rmd b/vignettes/solutions_transcriptomics.Rmd index 0dbcc2c..ed43297 100644 --- a/vignettes/solutions_transcriptomics.Rmd +++ b/vignettes/solutions_transcriptomics.Rmd @@ -38,8 +38,8 @@ seurat_obj |> mutate(gamma_delta = signature_score > 0.7) |> - dplyr::count(gamma_delta) |> - summarise(proportion = n/sum(n)) + count(gamma_delta) |> + metate(proportion = n/sum(n)) ``` ## Question 2 diff --git a/vignettes/spatial_bioconductor_transcriptomics.Rmd b/vignettes/spatial_bioconductor_transcriptomics.Rmd index 002106b..3bbaa6a 100644 --- a/vignettes/spatial_bioconductor_transcriptomics.Rmd +++ b/vignettes/spatial_bioconductor_transcriptomics.Rmd @@ -341,7 +341,7 @@ The gated cells can then be divided into pseudobulks within a SummarizedExperime ```{r , eval=FALSE} spe_regions_aggregated <- spatial_data |> - aggregate_cells(c(.gated)) + aggregate_cells(.gated) spe_regions_aggregated ```