plotSeries: Plot Series

plotSeriesR Documentation

Plot Series

Description

This function plots series data.

Usage

plotSeries(
  object,
  x,
  y = NULL,
  rank = NULL,
  colour.by = colour_by,
  colour_by = NULL,
  size.by = size_by,
  size_by = NULL,
  linetype.by = linetype_by,
  linetype_by = NULL,
  assay.type = assay_name,
  assay_name = "counts",
  ...
)

## S4 method for signature 'SummarizedExperiment'
plotSeries(
  object,
  x,
  y = NULL,
  rank = NULL,
  colour.by = colour_by,
  colour_by = NULL,
  size.by = size_by,
  size_by = NULL,
  linetype.by = linetype_by,
  linetype_by = NULL,
  assay.type = assay_name,
  assay_name = "counts",
  ...
)

Arguments

object

a SummarizedExperiment object.

x

Character scalar. selecting the column from ColData that will specify values of x-axis.

y

Character scalar. Selects the taxa from rownames. This parameter specifies taxa whose abundances will be plotted.

rank

Character scalar. A taxonomic rank, that is used to agglomerate the data. Must be a value of taxonomicRanks() function. (Default: NULL)

colour.by

Character scalar. A taxonomic rank, that is used to color plot. Must be a value of taxonomicRanks() function. (Default: NULL)

colour_by

Deprecated. Use colour.by instead.

size.by

Character scalar. A taxonomic rank, that is used to divide taxa to different line size types. Must be a value of taxonomicRanks() function. (Default: NULL)

size_by

Deprecated. Use size.by instead.

linetype.by

Character scalar. A taxonomic rank, that is used to divide taxa to different line types. Must be a value of taxonomicRanks() function. (Default: NULL)

linetype_by

Deprecated. Use linetype.by instead.

assay.type

Character scalar. selecting the assay to be plotted. (Default: "counts")

assay_name

Deprecated. Use assay.type instead.

...

additional parameters for plotting. See mia-plot-args for more details i.e. call help("mia-plot-args")

Details

This function creates series plot, where x-axis includes e.g. time points, and y-axis abundances of selected taxa.

Value

A ggplot2 object

Author(s)

Leo Lahti and Tuomas Borman. Contact: microbiome.github.io

Examples

## Not run: 
library(mia)
# Load data from miaTime package
library("miaTime")
data(SilvermanAGutData)
object <- SilvermanAGutData

# Plots 2 most abundant taxa, which are colored by their family
plotSeries(object,
           x = "DAY_ORDER",
           y = getTop(object, 2),
           colour.by = "Family")

# Counts relative abundances
object <- transformAssay(object, method = "relabundance")

# Selects taxa
taxa <- c("seq_1", "seq_2", "seq_3", "seq_4", "seq_5")

# Plots relative abundances of phylums
plotSeries(object[taxa,],
           x = "DAY_ORDER", 
           colour.by = "Family",
           linetype.by = "Phylum",
           assay.type = "relabundance")

# In addition to 'colour.by' and 'linetype.by', 'size.by' can also be used to group taxa.
plotSeries(object,
           x = "DAY_ORDER", 
           y = getTop(object, 5), 
           colour.by = "Family",
           size.by = "Phylum",
           assay.type = "counts")

## End(Not run)

microbiome/miaViz documentation built on Dec. 9, 2024, 2:18 a.m.