Skip to content

Commit

Permalink
update sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed May 22, 2024
1 parent 131e30b commit 188b03e
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 141 deletions.
Binary file added inst/images/physalia-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions vignettes/Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ knitr::opts_chunk$set(echo = TRUE, cache = FALSE)

- TWITTER/X: https://x.com/LGMartelotto

## Workshop partner: PHYSALIA

```{r, echo=FALSE, out.width="700px"}
knitr::include_graphics(here("inst/images/physalia-min.png"))
```

## Workshop goals and objectives

### What you will learn
Expand Down
8 changes: 6 additions & 2 deletions vignettes/Session_1_sequencing_assays.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,6 @@ brain_reference_list <- lapply(unique(brain_reference$dataset_id), function(x) b
dec = scran::modelGeneVar(brain_reference, subset.row = genes, block = brain_reference$sample_id)
hvg_CAQ = scran::getTopHVGs(dec, n = 1000)
hvg_CAQ = unique( unlist(hvg_CAQ))
head(hvg_CAQ)
Expand All @@ -854,6 +852,12 @@ spatial_data_gene_name = logNormCounts(spatial_data_gene_name)

We then identify and score relevant marker genes based on their expression and significance across different cell types. The result is a curated list of high-potential marker genes, organised and ready for deeper analysis and interpretation in the context of spatial gene expression patterns.

::: {.note}
This function provides a convenience wrapper for marker gene identification between groups of cells, based on running `pairwiseTTests.`

This function represents a simpler and more intuitive summary of the differences between the groups. We do this by realizing that the p-values for these types of comparisons are largely meaningless; individual cells are not meaningful units of experimental replication, while the groups themselves are defined from the data. Thus, by discarding the p-values, we can simplify our marker selection by focusing only on the effect sizes between groups.
:::

```{r}
mgs <- scran::scoreMarkers(
brain_reference,
Expand Down
35 changes: 26 additions & 9 deletions vignettes/Session_2_Tidy_spatial_analyses.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ rownames(spatialCoords(spatial_data)) = colnames(spatial_data) # Bug?
# Display the object
spatial_data
```
::: {.note}
If `ExperimentHub` should not work. The `spatial_data` object from the previous code block can be downloaded from [Zenodo - 10.5281/zenodo.11233385](https://zenodo.org/records/11233385/files/tidySpatialWorkshop2024_spatial_data.rds?download=1)
:::

### 1. tidySpatialExperiment package

Expand Down Expand Up @@ -332,7 +335,6 @@ This capability is powered by `tidygate`. We show how you can visualise your dat
Let's draw an arbitrary gate interactively

```{r, eval=FALSE}
spatial_data_gated =
spatial_data |>
Expand Down Expand Up @@ -724,6 +726,7 @@ spatial_data |>
ggplot(aes(array_row, array_col)) +
geom_point(aes(color = spatialLIBD)) +
facet_wrap(~sample_id) +
coord_fixed() +
theme(legend.position = "none") +
labs(title = "spatialLIBD regions")
```
Expand Down Expand Up @@ -754,7 +757,8 @@ spatial_data_filtered |>
ggplot(aes(subsets_mito_percent, sum_gene)) +
geom_point(aes(color = spatialLIBD), size=0.2) +
stat_ellipse(aes(group = spatialLIBD), alpha = 0.3) +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
scale_color_manual(values = libd_layer_colors |>
str_remove("ayer")) +
scale_y_log10() +
theme_bw()
Expand All @@ -768,7 +772,7 @@ Interestingly, if we plot the correlation between these two quantities we observ
spatial_data_filtered |>
ggplot(aes(subsets_mito_percent, sum_gene)) +
geom_point(aes(color = spatialLIBD), size=0.2) +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
geom_smooth(method="lm") +
facet_wrap(~spatialLIBD) +
scale_y_log10() +
Expand All @@ -794,13 +798,25 @@ spatial_data_filtered |>
As you can appreciate, the relationship between the number of genes, probed Purcell and their mitochondrial prescription abundance it's quite consistent.

::: {.note}
**Excercise 2.3**
**Excercise 2.3 (assisted)**

To to practice the use of `tidyomics` on spatial data, we propose a few exercises that connect manipulation, calculations and visualisation. These exercises are just meant to be simple use cases that exploit tidy R streamlined language.

We assume that the cells we filtered as non-alive or damaged, characterised by being reached uniquely for mitochondrial, genes, and genes, linked to up ptosis. it is good practice to check these assumption. This exercise aims to estimate what genes are differentially expressed between filtered and unfiltered cells. Then visualise the results
We assume that the cells we filtered as non-alive or damaged, characterised by being enriched uniquely for mitochondrial, genes, and genes, linked to up apoptosis. It is good practice to check these assumption. This exercise aims to estimate what genes are differentially expressed between filtered and unfiltered cells. Then visualise the results.

Use `tidyomic`/`tidyverse` tools to label dead cells and perform differential expression within each region. Some of the comments you can use are: `mutate`, `nest`, `map`, `aggregate_cells`, `tidybulk:::test_differential_abundance`,

A hist:

- spatial_data |>
mutate(
dead = ...

- Aggregate by sample, dead status, ad annotated region

- `nest` by annotated region

Use `tidyomic`s/`tidyverse` tools to label dead cells and perform differential expression within each region. Some of the comments you can use are: `mutate`, `nest`, `aggregate_cells`.
- use `map` to test DE
:::

::: {.note}
Expand All @@ -811,7 +827,6 @@ Inspired by our audience, let's try to use `tidyomics` to identify potential Amy
Amyloid plaques are extracellular deposits primarily composed of aggregated amyloid-beta (Aβ) peptides. They are a hallmark of Alzheimer's disease (AD) and are also found in certain other neurodegenerative conditions.

Amyloid plaques can be found in the brains of mice, particularly in transgenic mouse models that are engineered to develop Alzheimer's disease-like pathology.

Although amyloid plaques themselves are extracellular, the presence and formation of these plaques are associated with specific gene expression changes in the surrounding and involved cells. These gene markers are indicative of the processes that contribute to amyloid plaque formation, as well as the cellular response to these plaques ([Ranman et al., 2021](https://molecularneurodegeneration.biomedcentral.com/articles/10.1186/s13024-021-00465-0).)

```{r}
Expand All @@ -822,12 +837,14 @@ rownames(spatial_data) = rowData(spatial_data)$gene_name
```

The excercise includes

- Join the features

- Rescaling

- Summarising signature (sum), `mutate()`
- Plotting colousing by the signature

# Plotting
- Plotting colousing by the signature
:::


Expand Down
Loading

0 comments on commit 188b03e

Please sign in to comment.