Skip to content

Commit

Permalink
book: fix calls to extdata/
Browse files Browse the repository at this point in the history
  • Loading branch information
js2264 committed Nov 15, 2023
1 parent e0b59de commit 04b0151
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion inst/pages/01_intro.qmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Preamble {#preamble}
# Preamble {-}

```{r setup, echo=FALSE, results="asis"}
library(rebook)
Expand Down
29 changes: 15 additions & 14 deletions inst/pages/04_containers.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ List the [available
datasets](https://microbiome.github.io/mia/reference/mia-datasets.html) in
the `mia` package:

```{r, message=FALSE, eval=FALSE}
```{r, message=FALSE}
library(mia)
data(package="mia")
```
Expand Down Expand Up @@ -350,8 +350,8 @@ You can find full workflow script without further explanations and comments from

```{r dada2_1, include=FALSE}
# Load objects
seqtab.nochim <- readRDS(system.file("data", "dada2_seqtab.nochim", package = "OMA"))
taxa <- readRDS(system.file("data", "dada2_taxa", package = "OMA"))
seqtab.nochim <- readRDS(system.file("extdata", "dada2_seqtab.nochim", package = "OMA"))
taxa <- readRDS(system.file("extdata", "dada2_taxa", package = "OMA"))
```

Load required packages.
Expand Down Expand Up @@ -454,9 +454,9 @@ arbitrary; we refer here to the same names as in the examples:
After you have set up the CSV files, you can read them in R:

```{r importingcsv1, message=FALSE}
count_file <- system.file("data", "assay_taxa.csv", package = "OMA")
tax_file <- system.file("data", "rowdata_taxa.csv", package = "OMA")
sample_file <- system.file("data", "coldata.csv", package = "OMA")
count_file <- system.file("extdata", "assay_taxa.csv", package = "OMA")
tax_file <- system.file("extdata", "rowdata_taxa.csv", package = "OMA")
sample_file <- system.file("extdata", "coldata.csv", package = "OMA")
# Load files
counts <- read.csv(count_file, row.names=1) # Abundance table (e.g. ASV data; to assay data)
Expand Down Expand Up @@ -544,8 +544,8 @@ To construct a _MultiAssayExperiment_ object, just combine multiple _TreeSE_ dat
Here we import metabolite data from the same study.

```{r importingcsv4, message=FALSE}
count_file <- system.file("data", "assay_metabolites.csv", package = "OMA")
sample_file <- system.file("data", "coldata.csv", package = "OMA")
count_file <- system.file("extdata", "assay_metabolites.csv", package = "OMA")
sample_file <- system.file("extdata", "coldata.csv", package = "OMA")
# Load files
counts <- read.csv(count_file, row.names=1)
Expand Down Expand Up @@ -594,9 +594,9 @@ To begin with, we store the data in a local directory within the working
directory, such as _data/_, and define the source file paths.

```{r}
biom_file_path <- system.file("data", "Aggregated_humanization2.biom", package = "OMA")
sample_meta_file_path <- system.file("data", "Mapping_file_ADHD_aggregated.csv", package = "OMA")
tree_file_path <- system.file("data", "Data_humanization_phylo_aggregation.tre", package = "OMA")
biom_file_path <- system.file("extdata", "Aggregated_humanization2.biom", package = "OMA")
sample_meta_file_path <- system.file("extdata", "Mapping_file_ADHD_aggregated.csv", package = "OMA")
tree_file_path <- system.file("extdata", "Data_humanization_phylo_aggregation.tre", package = "OMA")
```

Now we can read in the biom file and convert it into a TreeSE object. In addition, we retrieve the rank names from the prefixes of the feature names and then remove them with the `rankFromPrefix` and `removeTaxaPrefixes` optional arguments.
Expand Down Expand Up @@ -728,7 +728,8 @@ GlobalPatterns_phyloseq2
```

Conversion is possible between other data formats. Interested readers can refer to the following functions:
* [makeTreeSummarizedExperimentFromDADA2](https://microbiome.github.io/mia/reference/makeTreeSummarizedExperimentFromDADA2.html)
* [makeSummarizedExperimentFromBiom](https://microbiome.github.io/mia/reference/makeSummarizedExperimentFromBiom.html)
* [loadFromMetaphlan](https://microbiome.github.io/mia/reference/loadFromMetaphlan.html)

* [makeTreeSummarizedExperimentFromDADA2](https://microbiome.github.io/mia/reference/makeTreeSummarizedExperimentFromDADA2.html)
* [makeSummarizedExperimentFromBiom](https://microbiome.github.io/mia/reference/makeSummarizedExperimentFromBiom.html)
* [loadFromMetaphlan](https://microbiome.github.io/mia/reference/loadFromMetaphlan.html)
* [readQZA](https://microbiome.github.io/mia/reference/loadFromQIIME2.html)
2 changes: 1 addition & 1 deletion inst/pages/90_acknowledgments.qmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Developers {-}
# Contributions

```{r setup, echo=FALSE, results="asis"}
library(rebook)
Expand Down
4 changes: 2 additions & 2 deletions inst/pages/97_extra_materials.qmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Extra material {#extras}
# Extra material {#extras}

```{r}
knitr::opts_chunk$set(eval=FALSE)
Expand Down Expand Up @@ -124,7 +124,7 @@ tse <- SprockettTHData()
```{r, message=FALSE, warning=FALSE, echo=FALSE}
# saveRDS(tse, file="data/SprockettTHData.Rds")
# Hidden reading of the saved data
tse <- readRDS("data/SprockettTHData.Rds")
tse <- readRDS(system.file("extdata", "SprockettTHData.Rds", package = "OMA"))
```

We pick three covariates ("Sex","Age_Years","Delivery_Mode") during this
Expand Down
2 changes: 1 addition & 1 deletion inst/pages/Session_info.qmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sessioninfo {-}
# Session info

```{r "session info"}
#| cache: false
Expand Down

0 comments on commit 04b0151

Please sign in to comment.