trans_nullmodel: Create trans_nullmodel object.

Description Methods Examples

Description

This class is a wrapper for a series of null model and phylogeny related approaches, including the mantel correlogram analysis of phylogenetic signal, betaNTI, betaNRI and RCbray calculations; see Stegen et al. (2013) <10.1038/ismej.2013.93> and Liu et al. (2017) <doi:10.1038/s41598-017-17736-w>.

Methods

Public methods


Method new()

Usage
trans_nullmodel$new(
  dataset = NULL,
  filter_thres = 0,
  taxa_number = NULL,
  group = NULL,
  select_group = NULL,
  env_cols = NULL,
  add_data = NULL,
  complete_na = FALSE
)
Arguments
dataset

the object of microtable Class.

filter_thres

default 0; the relative abundance threshold.

taxa_number

default NULL; how many taxa you want to use, if set, filter_thres parameter invalid.

group

default NULL; which group column name in sample_table is selected.

select_group

default NULL; the group name, used following the group to filter samples.

env_cols

default NULL; number or name vector to select the environmental data in dataset$sample_table.

add_data

default NULL; provide environmental data table additionally.

complete_na

default FALSE; whether fill the NA in environmental data.

Returns

intermediate files in object.

Examples
data(dataset)
data(env_data_16S)
t1 <- trans_nullmodel$new(dataset, taxa_number = 100, add_data = env_data_16S)

Method cal_mantel_corr()

Calculate mantel correlogram.

Usage
trans_nullmodel$cal_mantel_corr(
  use_env = NULL,
  break.pts = seq(0, 1, 0.02),
  cutoff = FALSE,
  ...
)
Arguments
use_env

default NULL; numeric or character vector to select env_data; if provide multiple variables or NULL, use PCA to reduce dimensionality.

break.pts

default seq(0, 1, 0.02); see mantel.correlog

cutoff

default FALSE; see cutoff in mantel.correlog

...

parameters pass to mantel.correlog

Returns

res_mantel_corr in object.

Examples
\donttest{
t1$cal_mantel_corr(use_env = "pH")
}

Method plot_mantel_corr()

Plot mantel correlogram.

Usage
trans_nullmodel$plot_mantel_corr()
Returns

ggplot.

Examples
\donttest{
t1$plot_mantel_corr()
}

Method cal_betampd()

Calculate betaMPD. Faster than comdist in picante package.

Usage
trans_nullmodel$cal_betampd(abundance.weighted = FALSE)
Arguments
abundance.weighted

default FALSE; whether use weighted abundance

Returns

res_betampd in object.

Examples
\donttest{
t1$cal_betampd(abundance.weighted=FALSE)
}

Method cal_betamntd()

Calculate betaMNTD. Faster than comdistnt in picante package.

Usage
trans_nullmodel$cal_betamntd(
  abundance.weighted = FALSE,
  exclude.conspecifics = FALSE
)
Arguments
abundance.weighted

default FALSE; whether use weighted abundance

exclude.conspecifics

default FALSE; see comdistnt in picante package.

Returns

res_betamntd in object.

Examples
\donttest{
t1$cal_betamntd(abundance.weighted=FALSE)
}

Method cal_ses_betampd()

Calculate ses.betaMPD (betaNRI).

Usage
trans_nullmodel$cal_ses_betampd(
  runs = 1000,
  abundance.weighted = FALSE,
  verbose = TRUE
)
Arguments
runs

default 1000; simulation runs.

abundance.weighted

default FALSE; whether use weighted abundance.

verbose

default TRUE; whether show the calculation process message.

Returns

res_ses_betampd in object.

Examples
\donttest{
t1$cal_ses_betampd(runs = 100, abundance.weighted = FALSE)
}

Method cal_ses_betamntd()

Calculate ses.betaMNTD (betaNTI).

Usage
trans_nullmodel$cal_ses_betamntd(
  runs = 1000,
  abundance.weighted = FALSE,
  exclude.conspecifics = FALSE,
  verbose = TRUE
)
Arguments
runs

default 1000; simulation runs.

abundance.weighted

default FALSE; whether use weighted abundance

exclude.conspecifics

default FALSE; see comdistnt in picante package.

verbose

default TRUE; whether show the calculation process message.

Returns

res_ses_betamntd in object.

Examples
\donttest{
t1$cal_ses_betamntd(runs = 100, abundance.weighted = FALSE, exclude.conspecifics = FALSE)
}

Method cal_rcbray()

Calculate rcbray.

Usage
trans_nullmodel$cal_rcbray(runs = 1000, verbose = TRUE)
Arguments
runs

default 1000; simulation runs.

verbose

default TRUE; whether show the calculation process message.

Returns

res_rcbray in object.

Examples
\donttest{
t1$cal_rcbray(runs=200)
}

Method cal_process()

Infer the processes according to ses.betaMNTD ses.betaMPD and rcbray.

Usage
trans_nullmodel$cal_process(use_betamntd = TRUE)
Arguments
use_betamntd

default TRUE; whether use ses.betaMNTD; if false, use ses.betaMPD.

Returns

res_rcbray in object.

Examples
\donttest{
t1$cal_process(use_betamntd = TRUE)
}

Method clone()

The objects of this class are cloneable with this method.

Usage
trans_nullmodel$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
## ------------------------------------------------
## Method `trans_nullmodel$new`
## ------------------------------------------------

data(dataset)
data(env_data_16S)
t1 <- trans_nullmodel$new(dataset, taxa_number = 100, add_data = env_data_16S)

## ------------------------------------------------
## Method `trans_nullmodel$cal_mantel_corr`
## ------------------------------------------------


t1$cal_mantel_corr(use_env = "pH")


## ------------------------------------------------
## Method `trans_nullmodel$plot_mantel_corr`
## ------------------------------------------------


t1$plot_mantel_corr()


## ------------------------------------------------
## Method `trans_nullmodel$cal_betampd`
## ------------------------------------------------


t1$cal_betampd(abundance.weighted=FALSE)


## ------------------------------------------------
## Method `trans_nullmodel$cal_betamntd`
## ------------------------------------------------


t1$cal_betamntd(abundance.weighted=FALSE)


## ------------------------------------------------
## Method `trans_nullmodel$cal_ses_betampd`
## ------------------------------------------------


t1$cal_ses_betampd(runs = 100, abundance.weighted = FALSE)


## ------------------------------------------------
## Method `trans_nullmodel$cal_ses_betamntd`
## ------------------------------------------------


t1$cal_ses_betamntd(runs = 100, abundance.weighted = FALSE, exclude.conspecifics = FALSE)


## ------------------------------------------------
## Method `trans_nullmodel$cal_rcbray`
## ------------------------------------------------


t1$cal_rcbray(runs=200)


## ------------------------------------------------
## Method `trans_nullmodel$cal_process`
## ------------------------------------------------


t1$cal_process(use_betamntd = TRUE)

microeco documentation built on May 30, 2021, 5:06 p.m.