Skip to content

Commit

Permalink
Finalise tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
RiboRings committed Jun 28, 2024
1 parent e0a3f80 commit 161cd42
Show file tree
Hide file tree
Showing 17 changed files with 438 additions and 306 deletions.
2 changes: 1 addition & 1 deletion docs/data_manipulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ <h2>Example 2.2: Agglomeration</h2>
<p>We agglomerate by Phylum and store the new experiment in the <code>altExp</code> slot.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb32"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb32-1"><a href="#cb32-1"></a><span class="co"># Agglomerate by Phylum and store into altExp slot</span></span>
<span id="cb32-2"><a href="#cb32-2"></a><span class="fu">altExp</span>(tse, <span class="st">"phylum"</span>) <span class="ot">&lt;-</span> <span class="fu">mergeFeaturesByRank</span>(tse, <span class="at">rank =</span> <span class="st">"Phylum"</span>)</span>
<span id="cb32-2"><a href="#cb32-2"></a><span class="fu">altExp</span>(tse, <span class="st">"phylum"</span>) <span class="ot">&lt;-</span> <span class="fu">agglomerateByRank</span>(tse, <span class="at">rank =</span> <span class="st">"Phylum"</span>)</span>
<span id="cb32-3"><a href="#cb32-3"></a><span class="fu">altExp</span>(tse, <span class="st">"phylum"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>class: TreeSummarizedExperiment
Expand Down
303 changes: 144 additions & 159 deletions docs/pcoa.html

Large diffs are not rendered by default.

Binary file added docs/pcoa_files/figure-revealjs/compare-1.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 removed docs/pcoa_files/figure-revealjs/fig-bray-1.png
Binary file not shown.
Binary file removed docs/pcoa_files/figure-revealjs/fig-umap-1.png
Binary file not shown.
Binary file removed docs/pcoa_files/figure-revealjs/fig-unifrac-1.png
Binary file not shown.
Binary file added docs/pcoa_files/figure-revealjs/pca-load-1.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 docs/pcoa_files/figure-revealjs/pcoa-load2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
157 changes: 145 additions & 12 deletions docs/search.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/tengeler2020_presentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,13 @@ <h2>Correlation Analysis</h2>
<h2>Tutorials</h2>
<div>
<ul>
<li><a href="https://microbiome.github.io/outreach/tengeler_quarto.html">Reproducible Reporting with Quarto</a></li>
<li><a href="https://microbiome.github.io/outreach/tengeler_basic_exploration.html">Data Import and Basic Exploration</a></li>
<li><a href="https://microbiome.github.io/outreach/tengeler_alpha_diversity.html">Alpha Diversity</a></li>
<li><a href="https://microbiome.github.io/outreach/tengeler_pcoa.html">Beta Diversity with Principal Coordinate Analysis</a></li>
<li><a href="https://microbiome.github.io/outreach/tengeler_dbrda.html">Beta Diversity with Redundance Analysis</a></li>
<li><a href="https://microbiome.github.io/outreach/tengeler_differential_abundance.html">Differential Abundance Analysis</a></li>
<li><a href="https://microbiome.github.io/outreach/tengeler_community_composition.html">Community Composition</a></li>
<li><a href="https://microbiome.github.io/outreach/quarto.html" target="_blank">Introduction to Quarto</a></li>
<li><a href="https://microbiome.github.io/outreach/data_manipulation.html" target="_blank">Data Manipulation</a></li>
<li><a href="https://microbiome.github.io/outreach/alpha_diversity.html" target="_blank">Alpha Diversity</a></li>
<li><a href="https://microbiome.github.io/outreach/pcoa.html" target="_blank">PCoA</a></li>
<li><a href="https://microbiome.github.io/outreach/dbrda.html" target="_blank">Redundance Analysis</a></li>
<li><a href="https://microbiome.github.io/outreach/differential_abundance.html" target="_blank">Differential Abundance Analysis</a></li>
<li><a href="https://microbiome.github.io/outreach/compositional_heatmap.html" target="_blank">Community Composition</a></li>
</ul>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion quarto/compositional_heatmap.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Then, we agglomerate the experiment to the order level, so that information is m
```{r}
#| label: agglomerate-order
# Agglomerate by order
tse_order <- mergeFeaturesByRank(tse, rank = "Order")
tse_order <- agglomerateByRank(tse, rank = "Order")
```

## Why relative abundances?
Expand Down
21 changes: 8 additions & 13 deletions quarto/data_manipulation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ knitr::opts_chunk$set(message = FALSE, warning = FALSE, echo = TRUE)

## Example 1.1: Data Import

We work with microbiome data inside `TreeSummarizedExperiment` (TreeSE)
containers and `mia` is our toolkit.
We work with microbiome data inside `TreeSummarizedExperiment` (TreeSE) containers and `mia` is our toolkit.

```{r}
#| label: import-tengeler
Expand Down Expand Up @@ -80,8 +79,7 @@ head(rowData(tse)$Genus, 3)

## Example 1.4: Assays

The assays of an experiment (counts, relative abundance, etc.) can be found in
`assays`.
The assays of an experiment (counts, relative abundance, etc.) can be found in `assays`.

```{r}
assays(tse)
Expand Down Expand Up @@ -112,8 +110,7 @@ Create a TreeSE directly from its components in the form of raw data (OMA sectio

## Example 2.1: Subsetting

We can subset features or samples of a TreeSE, but first we need to pick a
variable.
We can subset features or samples of a TreeSE, but first we need to pick a variable.

```{r}
# Check levels of a sample variable
Expand Down Expand Up @@ -145,25 +142,24 @@ dim(subrow_tse)

## Example 2.2: Agglomeration

Agglomeration condenses the assays to higher taxonomic ranks. Related taxa are
combined together. We can agglomerate by different ranks.
Agglomeration condenses the assays to higher taxonomic ranks. Related taxa are combined together. We can agglomerate by different ranks.

```{r}
# View rank options
taxonomyRanks(tse)
```

We agglomerate by Phylum and store the new experiment in the `altExp` slot.

```{r}
# Agglomerate by Phylum and store into altExp slot
altExp(tse, "phylum") <- mergeFeaturesByRank(tse, rank = "Phylum")
altExp(tse, "phylum") <- agglomerateByRank(tse, rank = "Phylum")
altExp(tse, "phylum")
```

## Example 2.3: Transformation

Data can be transformed for different reasons. For example, to make samples
comparable we can use relative abundance.
Data can be transformed for different reasons. For example, to make samples comparable we can use relative abundance.

```{r}
# Transform counts to relative abundance
Expand All @@ -175,8 +171,7 @@ tse <- transformAssay(tse,
head(colSums(assay(tse, "relabundance")), 3)
```

Or to standardise features to the normal distribution we can use z-scores:
$Z = \frac{x - \mu}{\sigma}$.
Or to standardise features to the normal distribution we can use z-scores: $Z = \frac{x - \mu}{\sigma}$.

```{r}
# Transform relative abundance to z-scores
Expand Down
Loading

0 comments on commit 161cd42

Please sign in to comment.