Nephele uses the ampvis2 R package v2.3.2 for statistical computation. We also make use of the Plotly R interface for the plotly.js charting library. The plots can be minimally edited interactively. However, they also have a link to export the data to the Plotly Chart Studio which allows for making a variety of charts. We have a tutorial for making simple edits to the plots here.
The rarefaction curves are made with the amp_rarecurve function. The table is written to rarecurve.txt and the plot to rarecurve.html.
rarecurve <- amp_rarecurve(amp, color_by = "TreatmentGroup")
sampling depth is used to filter out samples with few counts. Samples with counts which fall below the
sampling depth are removed from the OTU table using amp_subset_samples. The names of samples that are removed are output to samples_being_ignored.txt.
sampling depth is used to rarefy the counts for the Bray-Curtis PCoA and the alpha diversity plots. The OTU table is rarefied using rrarefy from the vegan R package. The table of the filtered, rarefied counts is saved as rarefied_OTU_table.txt.
If you do not provide a
sampling depth, please see FAQ:How is the sampling depth calculated? for more information.
amp <- amp_subset_samples(amp, minreads = sampdepth) otu <- rrarefy(t(amp$abund), sampdepth) amprare <- ampsub amprare$abund <- t(otu)
The binomial distance is able to handle varying sample sizes, so the raw counts from the OTU table are used. For the Bray-Curtis distance, the rarefied counts are used. The coordinates from the plots are written to pcoa_binomial.txt and pcoa_bray.txt and the plots to pcoa_binomial.html and pcoa_bray.html. At least 3 samples are needed for these plots.
pcoa_binomial <- amp_ordinate(amp, filter_species = 0.01, type = "PCOA", distmeasure = "binomial", sample_color_by = "TreatmentGroup", detailed_output = TRUE, transform = "none") pcoa_bray <- amp_ordinate(amprare, filter_species = 0.01, type = "PCOA", distmeasure = "bray", sample_color_by = "TreatmentGroup", detailed_output = TRUE, transform = "none")
The Shannon diversity and Chao species richness are computed using amp_alphadiv. The rarefied counts are used for this computation. The diversity values are saved in alphadiv.txt, and boxplots are output to alphadiv.html. At least 3 samples are needed to produce these plots.
alphadiv <- amp_alphadiv(amprare, measure = "shannon", richness = TRUE, rarefy = sampdepth)
The heatmap, seq_heatmap.html, is made from the raw OTU table with the counts normalized to 100 to represent the relative abundances using amp_subset_samples before the heatmap is made with morpheus. If there are too many OTUs or sequence variants, then the heatmap is made at the species level instead. A heatmap is also made from the rarefied counts, seq_heatmap_rarefied.html.
amptax <-amp_subset_samples(amp, normalise = TRUE) heatmap <- morpheus(amp$abund, columns = columns, rows = rows, columnColorModel = list(type = as.list(colors)), colorScheme = list(scalingMode = "fixed", stepped = FALSE), columnAnnotations = amptax$metadata, rowAnnotations = amptax$tax)