25 Resources
25.1 Data containers
25.1.1 Documentation
25.1.2 Other containers
-
DataFrame which behaves similarly to
data.frame, yet is efficient and fast when used with large datasets. -
DNAString, along with
DNAStringSet,RNAStringandRNAStringSet, offers efficient storage and handling of long biological sequences within the Biostrings package (Pagès et al. 2020). -
GenomicRanges (Lawrence et al. 2013) offers an efficient representation and manipulation of genomic annotations and alignments, see e.g.
GRangesandGRangesListfrom An Introduction to the GenomicRanges Package.
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 tootu_tablein phyloseq. In a SummarizedExperiment object multiple assays, raw counts, transformed counts can be stored. See also Ramos et al. (2017) for storing data from multipleexperimentssuch as RNA-seq, proteomics, etc.rowData: This slot is similar totax_tablein phyloseq to store taxonomic information.colData: This slot is similar tosample_datain phyloseq to store information related to samples.rowTree: This slot is similar tophy_treein phyloseq to store the phylogenetic tree.
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 (Huang et al. 2021)
Lahti L et al. (2020) Upgrading the R/Bioconductor ecosystem for microbiome research F1000Research 9:1464 (slides), on the reference sequence slot extension.
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:
- List of R tools for microbiome analysis
- phyloseq (McMurdie and Holmes 2013)
- microbiome tutorial
- microbiomeutilities
- phyloseq / TreeSummarizedExperiment cheatsheet from Appendix A
- Bioconductor Workflow for Microbiome Data Analysis: from raw reads to community analyses (Callahan et al. 2016).
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).
- Base R and RStudio cheatsheets
- Package-specific cheatsheets
- Visualization with ggplot2 (Wickham 2016)
- R graphics cookbook
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).
Online documents:
- Hervé Pagès, A quick overview of the S4 class system.
- Laurent Gatto, A practical tutorial on S4 programming
- How S4 Methods Work (Chambers 2006)
Books:
- Software for Data Analysis: Programming with R (Chambers 2008)
- R Programming for Bioinformatics (Gentleman 2008)
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.
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:
25.3.3 Further reading
The following online books provide good general data science background:
- R for Data Science (2nd edition)
- Modern Statistics for Modern Biology open access book (Holmes S, Huber W) (Holmes and Huber 2019)
- The Bioconductor project (background on the Bioconductor project; Carpentries workshop)