Skip to content

Commit

Permalink
vignettes
Browse files Browse the repository at this point in the history
Signed-off-by: Daena Rys <[email protected]>
  • Loading branch information
Daenarys8 committed Nov 11, 2024
1 parent 9fa4669 commit 75ca7d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
7 changes: 3 additions & 4 deletions vignettes/articles/manipulation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ BiocManager::install("miaTime")

Once installed, `miaTime` is made available in the usual way.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: load_package
library(miaTime)
```

Expand Down Expand Up @@ -86,7 +85,7 @@ number of readily available

Load example data:

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: lubridate
# Load packages
Expand Down Expand Up @@ -175,7 +174,7 @@ sampling location, ...).

Add time point rank per subject.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: rank_for_subject
library(dplyr)
Expand Down
19 changes: 9 additions & 10 deletions vignettes/articles/minimalgut.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ Dense samples of the minimal gut microbiome. In the initial hours, MDb-MM was
grown under batch condition and 24 h onwards, continuous feeding of media with
pulse feeding cycles. This information is stored in the `colData`.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: sample_table
library(miaTime)
data(minimalgut)
Expand All @@ -50,7 +49,7 @@ table(tse[["StudyIdentifier"]], tse[["condition_1"]])
Visualize samples available for each of the bioreactors. This allows
to identify if there are any missing samples for specific times.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: show_timepoints
library(ggplot2)
Expand All @@ -68,7 +67,7 @@ The `minimalgut` dataset, mucus-diet based minimal microbiome
can investigate the succession of mdbMM16 from the start of experiment
here hour zero until the end of the experiment.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: calculate_divergence
# Transform data to relativeS
Expand All @@ -85,7 +84,7 @@ tse <- addBaselineDivergence(

Let's then visualize the divergence.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: show_divergence
library(scater)
Expand All @@ -103,7 +102,7 @@ p
Now visualize abundance of _Blautia hydrogenotrophica_ using the
`miaViz::plotSeries()` function.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: plot_series
library(miaViz)
Expand All @@ -122,7 +121,7 @@ Sample dissimilarity between consecutive time steps(step size n >= 1) within
a group(subject, age, reaction chamber, etc.) can be calculated by
`addStepwiseDivergence`.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: stepwise_divergence
# Divergence between consecutive time points
Expand All @@ -142,7 +141,7 @@ The results are again stored in `colData`. We calculate the speed of divergence
change by dividing each divergence change by the corresponding change in time.
Then we use similar plotting methods as previously.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: show_stepwise
# Calculate slope for the change
Expand All @@ -166,7 +165,7 @@ p
This shows how to calculate and plot moving average for the variable of
interest (here: slope).

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: moving_average
library(dplyr)
Expand Down Expand Up @@ -194,7 +193,7 @@ tse[["sliding_divergence"]] <- colData(tse) |>
After calculating the moving average of divergences, we can visualize the
result in a similar way to our previous approach.

```{r}
```{r, message = FALSE, warning = FALSE}
#| label: show_moving_average
# Create a time series plot for divergence
Expand Down

0 comments on commit 75ca7d6

Please sign in to comment.