trans_rarefy: Rarefaction and plotting.

trans_rarefyR Documentation

Rarefaction and plotting.

Description

Rarefaction based on the microtable rarefy_samples function and plotting based on the ggplot2.

Methods

Public methods


Method new()

Usage
trans_rarefy$new(dataset = NULL, alphadiv = "Shannon", depth = NULL, ...)
Arguments
dataset

the object of microtable Class.

alphadiv

default "Shannon"; alpha diversity measurement used for the rarefaction; see microtable$cal_alphadiv for all the measurement.

depth

default NULL; an integer vecotr used for the rarefying.

...

parameters passed to rarefy_samples function of microtable class, except the sample.size parameter.

Returns

res_rarefy stored in the object.

Examples
\donttest{
library(microeco)
data(dataset)
t1 <- trans_rarefy$new(dataset = dataset, depth = c(0, 10, 50, 400, 800))
}

Method plot_rarefy()

Plotting the rarefied result.

Usage
trans_rarefy$plot_rarefy(
  color_values = RColorBrewer::brewer.pal(8, "Dark2"),
  color = "SampleID",
  show_point = TRUE,
  point_size = 0.3,
  point_alpha = 0.6,
  add_fitting = FALSE,
  x_axis_title = "Sequence number",
  y_axis_title = NULL,
  show_legend = TRUE,
  show_samplename = FALSE,
  samplename_size = 3,
  samplename_color = "grey30",
  ...
)
Arguments
color_values

colors used for presentation.

color

default "SampleID"; color mapping in the plot.

show_point

default TRUE; whether show the point.

point_size

default .3; point size value.

point_alpha

default .6; point alpha value.

add_fitting

default FALSE; whether add fitted line.

x_axis_title

default "Sequence number"; x axis title.

y_axis_title

default NULL; default NULL represents the measure used.

show_legend

default TRUE; whether show the legend in the plot.

show_samplename

default FALSE; whether show the sample name in the plot.

samplename_size

default 3; the sample name text size. Only available when show_samplename is TRUE.

samplename_color

default "grey70"; sample name text color. Only available when show_samplename is TRUE.

...

parameters pass to ggplot2::geom_line (when add_fitting = FALSE) or ggplot2::geom_smooth (when add_fitting = TRUE).

Returns

ggplot.

Examples
\donttest{
t1$plot_rarefy(color = "Group")
}

Method print()

Print the trans_rarefy object.

Usage
trans_rarefy$print()

Method clone()

The objects of this class are cloneable with this method.

Usage
trans_rarefy$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `trans_rarefy$new`
## ------------------------------------------------


library(microeco)
data(dataset)
t1 <- trans_rarefy$new(dataset = dataset, depth = c(0, 10, 50, 400, 800))


## ------------------------------------------------
## Method `trans_rarefy$plot_rarefy`
## ------------------------------------------------


t1$plot_rarefy(color = "Group")


ChiLiubio/mecodev documentation built on Jan. 20, 2025, 8:05 a.m.