Skip to content

Commit

Permalink
add vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed Sep 16, 2024
1 parent 70f35bc commit e8e848d
Show file tree
Hide file tree
Showing 17 changed files with 771 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ TidyGenomicsTranscriptomicsWorkshop_bioc2023.Rproj
.DS_Store
/doc/
/Meta/
tidyomicsWorkshop.Rproj
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Imports:
tidyseurat,
SpatialExperiment,
tidySpatialExperiment,
plyranges,
stats,
utils,
tibble,
Expand Down Expand Up @@ -63,7 +64,8 @@ Suggests:
pkgdown
Remotes:
satijalab/seurat-wrappers,
william-hutchison/tidySpatialExperiment@ECCB2024
william-hutchison/tidySpatialExperiment@ECCB2024,
stemangiola/tidygate@ECCB2024
Biarch: true
URL: https://tidy-biology.github.io/TidyGenomicsTranscriptomicsWorkshop
BugReports: https://github.com/tidy-biology/TidyGenomicsTranscriptomicsWorkshop/issues/new/choose
Expand Down
Binary file modified data/gate_sce_obj.rda
Binary file not shown.
Binary file modified data/gate_seurat_obj.rda
Binary file not shown.
Binary file added data/pbmc_h3k4me3_hg38.rda
Binary file not shown.
Binary file added data/tidygate_env_gates.rda
Binary file not shown.
Binary file added inst/images/tidySPE_gate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added inst/images/tidyomics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions man/gate_seurat_obj.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions man/seurat_obj.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions man/seurat_obj_UMAP3.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vignettes/pseudobulk_transcriptomics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ To explore the grouping, we can use tidyverse `slice` to choose a row (cell_type

```{r pseudobulk3}
pseudo_bulk_nested |>
slice(1) |>
dplyr::slice(1) |>
pull(grouped_summarized_experiment)
```

Expand Down Expand Up @@ -172,7 +172,7 @@ If we pull out the SummarizedExperiment object for the first cell type, as befor

```{r pseudobulk6}
pseudo_bulk_nested |>
slice(1) |>
dplyr::slice(1) |>
pull(grouped_summarized_experiment)
```

Expand Down
13 changes: 6 additions & 7 deletions vignettes/single_cell_bioconductor_transcriptomics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ frameborder="0">
# Load packages
library(SingleCellExperiment)
library(ggplot2)
library(plotly)
library(dplyr)
library(colorspace)
library(dittoSeq)
Expand Down Expand Up @@ -333,6 +332,7 @@ single_cell_object |>
We'll demonstrate creating a 3D plot using some data that has 3 UMAP dimensions. This is a fantastic way to visualise both reduced dimensions and metadata in the same representation.

```{r umap plot 2, message = FALSE, warning = FALSE}
library(tidySingleCellExperiment)
pbmc <- tidyomicsWorkshop::sce_obj_UMAP3
pbmc |>
Expand All @@ -343,7 +343,7 @@ pbmc |>
color = ~cell_type,
colors = dittoSeq::dittoColors()
) %>%
add_markers(size = I(1))
plotly::add_markers(size = I(1))
```

## Exercises
Expand Down Expand Up @@ -372,7 +372,7 @@ First let's have a look to the cell types that constitute this dataset

```{r nest SingleCellExperiment count}
sce_obj |>
count(cell_type)
dplyr::count(cell_type)
```

Let's group the cells based on cell identity using `nest`
Expand All @@ -390,7 +390,7 @@ Let's see what the first element of the Surat column looks like

```{r nest sce 2}
sce_obj_nested |>
slice(1) |>
dplyr::slice(1) |>
pull(sce)
```

Expand Down Expand Up @@ -440,7 +440,7 @@ Let's have a look to the first heatmap

```{r nest sce heatmap 2, fig.width=8, fig.height=8}
sce_obj_nested |>
slice(1) |>
dplyr::slice(1) |>
pull(umap)
```

Expand All @@ -453,7 +453,7 @@ sce_obj |>
nest(sce = -cell_type) |>
# Filter for sample with more than 30 cells
mutate(sce = map(sce, ~ .x |> add_count(sample) |> filter(n > 50))) |>
mutate(sce = map(sce, ~ .x |> add_count(sample) |> dplyr::filter(n > 50))) |>
filter(map_int(sce, ncol) > 0) |>
# Select significant genes
Expand Down Expand Up @@ -487,7 +487,6 @@ sce_obj |>
- Answer this question avoiding to save temporary variables, and using the function add_count to count the cells (before nesting), and then filter
- Answer this question avoiding to save temporary variables, and using the function map_int to count the cells (after nesting), and the filter


**Session Information**

```{r}
Expand Down
6 changes: 3 additions & 3 deletions vignettes/single_cell_seurat_transcriptomics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ First let's have a look to the cell types that constitute this dataset

```{r nest seurat count}
seurat_obj |>
count(cell_type)
dplyr::count(cell_type)
```

Let's group the cells based on cell identity using `nest`
Expand All @@ -474,7 +474,7 @@ Let's see what the first element of the Surat column looks like

```{r nest seurat 2}
seurat_obj_nested |>
slice(1) |>
dplyr::slice(1) |>
pull(seurat)
```
Now, let's perform a differential gene-transcript abundance analysis between the two conditions for each cell type.
Expand Down Expand Up @@ -521,7 +521,7 @@ Let's have a look to the first heatmap

```{r nest seurat heatmap 2, fig.width=8, fig.height=8}
seurat_obj_nested |>
slice(1) |>
dplyr::slice(1) |>
pull(heatmap)
```

Expand Down
4 changes: 2 additions & 2 deletions vignettes/solutions_transcriptomics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ seurat_obj |>
mutate(gamma_delta = signature_score > 0.7) |>
count(gamma_delta) |>
dplyr::count(gamma_delta) |>
summarise(proportion = n/sum(n))
```

Expand All @@ -50,5 +50,5 @@ There is a cluster of cells characterised by a low RNA output (nCount_RNA < 100)
```{r}
seurat_obj |>
filter(nCount_RNA < 100) %>%
count(cell_type)
dplyr::count(cell_type)
```
Loading

0 comments on commit e8e848d

Please sign in to comment.