25  Resources

25.1 Data containers

25.1.1 Documentation

SingleCellExperiment: S4 classes for single cell data. Lun et al. (2020). R package version 1.12.0.
SummarizedExperiment: SummarizedExperiment container. Morgan et al. (2020). R package version 1.20.0. https://bioconductor.org/packages/SummarizedExperiment.
TreeSummarizedExperiment: A S4 class for data with tree structures. Huang (2020). R package version 1.6.2.

25.1.2 Other containers

Biostrings: Efficient manipulation of biological strings. Pagès et al. (2020). R package version 2.58.0. https://bioconductor.org/packages/Biostrings.
Software for computing and annotating genomic ranges. Lawrence et al. (2013). PLoS Comput Biol 9. doi:10.1371/journal.pcbi.1003118.

NGS Analysis Basics provides a walk-through of the above-mentioned features with detailed examples.

25.1.3 phyloseq

The phyloseq package and class became the first widely used data container for microbiome data science in R. Many methods for taxonomic profiling data are readily available for this class. We provide here a short description of how phyloseq and SummarizedExperiment classes relate to each other.

  • assays: This slot is similar to otu_table in phyloseq. In a SummarizedExperiment object multiple assays, raw counts, transformed counts can be stored. See also Ramos et al. (2017) for storing data from multiple experiments such as RNA-seq, proteomics, etc.

  • rowData: This slot is similar to tax_table in phyloseq to store taxonomic information.

  • colData: This slot is similar to sample_data in phyloseq to store information related to samples.

  • rowTree: This slot is similar to phy_tree in phyloseq to store the phylogenetic tree.

Software for the integration of multiomics experiments in Bioconductor. Ramos et al. (2017). Cancer Res. doi:10.1158/0008-5472.CAN-17-0344.

In this book, you will encounter terms such as FeatureIDs and SampleIDs.

  • FeatureIDs: These are basically OTU/ASV ids which are row names in assays and rowData.

  • SampleIDs: As the name suggests, these are sample ids which are column names in assays and row names in colData. FeatureIDs and SampleIDs are used but the technical terms rownames and colnames are encouraged to be used, since they relate to actual objects we work with.

The structure of a TreeSE object is shown in Figure 3.1. For more background, see:

TreeSummarizedExperiment: A S4 class for data with hierarchical structure [version 2; peer review: 3 approved]. Huang et al. (2021). F1000Res 9:1246. doi:10.12688/f1000research.26669.2.

25.1.3.1 Benchmarking TreeSE with phyloseq

TreeSummarizedExperiment objects can be converted into phyloseq objects and vice versa, therefore it is possible to compare the two containers in terms of computational efficiency. In 2021, TreeSummarizedExperiment and phyloseq were benchmarked against one another in mia v1.2.3 and phyloseq v1.38.0, respectively. Five standard microbiome analysis operations were applied to four datasets of varying size with both containers. In a nutshell, TreeSummarizedExperiment and phyloseq showed a similar performance for datasets of small and medium size for most of the operations. However, TreeSummarizedExperiment performed more efficiently as the size of the datasets increased. Further details on such results can be found in the benchmarking repository.

25.1.3.2 Resources on phyloseq

The phyloseq container provides analogous methods to TreeSummarizedExperiment. The following material can be used to familiarize yourself with such alternative methods:

phyloseq: An R package for reproducible interactive analysis and graphics of microbiome census data. McMurdie et al. (2013). PLoS One 8:e61217. doi:10.1371/journal.pone.0061217.
Bioconductor workflow for microbiome data analysis: From raw reads to community analyses [version 2; peer review: 3 approved]. Callahan et al. (2016). F1000Res 5:1492. doi:10.12688/f1000research.8986.2.

25.2 R programming

25.2.1 Base R and RStudio

If you are new to R, you could try swirl for a kickstart to R programming. Further support resources are available through the Bioconductor project (Huber et al. 2015).

ggplot2: Elegant graphics for data analysis. Wickham (2016). Springer International Publishing. doi:10.1007/978-3-319-24277-4.

25.2.2 Bioconductor classes

Introduction to data analysis with R and Bioconductor; Carpentries introduction, including R & RStudio installation instructions

S4 system

The S4 class system has brought several useful features to the object-oriented programming paradigm within R, and it is constantly deployed in R/Bioconductor packages (Huber et al. 2015).

Orchestrating high-throughput genomic analysis with Bioconductor. Huber et al. (2015). Nat Methods 12:115–121. doi:10.1038/nmeth.3252.

Online documents:

How s4 methods work. Chambers (2006). Technical report.

Books:

  • John M. Chambers. Software for Data Analysis: Programming with R. Springer, New York, 2008. ISBN-13 978-0387759357 (Chambers 2008)
  • Robert Gentleman. R Programming for Bioinformatics. Chapman & Hall/CRC, New York, 2008. ISBN-13 978-1420063677 (Gentleman 2008)
Software for data analysis: Programming with R. Chambers (2008). Springer. doi:10.1007/978-0-387-75936-4.
R programming for bioinformatics. Gentleman (2008). CRC Press. doi:10.1201/9781420063684.

25.3 Reproducible reporting

25.3.1 Learn Quarto

Reproducible reporting is the starting point for robust interactive data science. Perform the following tasks:

  • If you are entirely new to Quarto (Allaire et al. 2022), take this short tutorial to get introduced to the most important functions within Quarto. Then experiment with different options from the Quarto cheatsheet.

  • Create a Quarto template in RStudio, and render it into a document (markdown, PDF, docx or other format). In case you are new to Quarto, its documentation provides guidelines to use Quarto with the R language (here) and the RStudio IDE (here).

  • Further examples and tips for Quarto are available in this online tutorial on interactive reproducible reporting.

Quarto. Allaire et al. (2022). doi:10.5281/zenodo.5960048.

25.3.2 R Markdown

Being able to use Quarto in R partly relies on your previous knowledge of R Markdown (Xie et al. 2018, 2020). The following resources can help you get familiar with R Markdown:

R Markdown: The definitive guide. Xie et al. (2018). Chapman & Hall/CRC. ISBN 9781138359338. doi:10.1201/9781138359444.
R Markdown cookbook. Xie et al. (2020). Chapman & Hall/CRC. ISBN 9780367563837. doi:10.1201/9781003097471.

25.3.3 Further reading

The following online books provide good general data science background:

Modern statistics for modern biology. Holmes et al. (2019). Cambridge University Press. https://www.huber.embl.de/msmb/.
Back to top