
Last chance! 50% off unlimited learning
Sale ends in
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>.
new()
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 )
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.
intermediate files in object.
data(dataset) data(env_data_16S) t1 <- trans_nullmodel$new(dataset, taxa_number = 100, add_data = env_data_16S)
cal_mantel_corr()
Calculate mantel correlogram.
trans_nullmodel$cal_mantel_corr( use_env = NULL, break.pts = seq(0, 1, 0.02), cutoff = FALSE, ... )
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
res_mantel_corr in object.
\donttest{ t1$cal_mantel_corr(use_env = "pH") }
plot_mantel_corr()
Plot mantel correlogram.
trans_nullmodel$plot_mantel_corr()
ggplot.
\donttest{ t1$plot_mantel_corr() }
cal_betampd()
Calculate betaMPD. Faster than comdist in picante package.
trans_nullmodel$cal_betampd(abundance.weighted = FALSE)
abundance.weighted
default FALSE; whether use weighted abundance
res_betampd in object.
\donttest{ t1$cal_betampd(abundance.weighted=FALSE) }
cal_betamntd()
Calculate betaMNTD. Faster than comdistnt in picante package.
trans_nullmodel$cal_betamntd( abundance.weighted = FALSE, exclude.conspecifics = FALSE )
abundance.weighted
default FALSE; whether use weighted abundance
exclude.conspecifics
default FALSE; see comdistnt in picante package.
res_betamntd in object.
\donttest{ t1$cal_betamntd(abundance.weighted=FALSE) }
cal_ses_betampd()
Calculate ses.betaMPD (betaNRI).
trans_nullmodel$cal_ses_betampd( runs = 1000, abundance.weighted = FALSE, verbose = TRUE )
runs
default 1000; simulation runs.
abundance.weighted
default FALSE; whether use weighted abundance.
verbose
default TRUE; whether show the calculation process message.
res_ses_betampd in object.
\donttest{ t1$cal_ses_betampd(runs = 100, abundance.weighted = FALSE) }
cal_ses_betamntd()
Calculate ses.betaMNTD (betaNTI).
trans_nullmodel$cal_ses_betamntd( runs = 1000, abundance.weighted = FALSE, exclude.conspecifics = FALSE, verbose = TRUE )
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.
res_ses_betamntd in object.
\donttest{ t1$cal_ses_betamntd(runs = 100, abundance.weighted = FALSE, exclude.conspecifics = FALSE) }
cal_rcbray()
Calculate rcbray.
trans_nullmodel$cal_rcbray( runs = 1000, verbose = TRUE, null.model = "independentswap" )
runs
default 1000; simulation runs.
verbose
default TRUE; whether show the calculation process message.
null.model
default "independentswap"; see more available options in randomizeMatrix function of picante package.
res_rcbray in object.
\donttest{ t1$cal_rcbray(runs=200) }
cal_process()
Infer the processes according to ses.betaMNTD ses.betaMPD and rcbray.
trans_nullmodel$cal_process(use_betamntd = TRUE)
use_betamntd
default TRUE; whether use ses.betaMNTD; if false, use ses.betaMPD.
res_rcbray in object.
\donttest{ t1$cal_process(use_betamntd = TRUE) }
cal_NRI()
Calculates Nearest Relative Index (NRI), equivalent to -1 times the standardized effect size of MPD.
trans_nullmodel$cal_NRI( null.model = "taxa.labels", abundance.weighted = FALSE, runs = 999, ... )
null.model
default "taxa.labels"; Null model to use; see null.model parameter in ses.mpd function of picante package for available options.
abundance.weighted
default FALSE; Should mean nearest relative distances for each species be weighted by species abundance?
runs
default 999; Number of randomizations.
...
paremeters pass to ses.mpd function in picante package.
res_NRI in object, equivalent to -1 times ses.mpd.
\dontrun{ t1$cal_NRI() }
cal_NTI()
Calculates Nearest Taxon Index (NTI), equivalent to -1 times the standardized effect size of MNTD.
trans_nullmodel$cal_NTI( null.model = "taxa.labels", abundance.weighted = FALSE, runs = 999, ... )
null.model
default "taxa.labels"; Null model to use; see null.model parameter in ses.mntd function of picante package for available options.
abundance.weighted
default FALSE; Should mean nearest taxon distances for each species be weighted by species abundance?
runs
default 999; Number of randomizations.
...
paremeters pass to ses.mntd function in picante package.
res_NTI in object, equivalent to -1 times ses.mntd.
\dontrun{ t1$cal_NTI() }
cal_Cscore()
Calculates the (normalised) mean number of checkerboard combinations (C-score) using C.score function in bipartite package.
trans_nullmodel$cal_Cscore(by_group = NULL, ...)
by_group
default NULL; one column name or number in sample_table; calculate C-score for different groups separately.
...
paremeters pass to C.score function in bipartite package.
results directly.
\dontrun{ t1$cal_Cscore() }
clone()
The objects of this class are cloneable with this method.
trans_nullmodel$clone(deep = FALSE)
deep
Whether to make a deep clone.
# NOT RUN {
## ------------------------------------------------
## 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`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_mantel_corr(use_env = "pH")
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$plot_mantel_corr`
## ------------------------------------------------
# }
# NOT RUN {
t1$plot_mantel_corr()
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_betampd`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_betampd(abundance.weighted=FALSE)
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_betamntd`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_betamntd(abundance.weighted=FALSE)
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_ses_betampd`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_ses_betampd(runs = 100, abundance.weighted = FALSE)
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_ses_betamntd`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_ses_betamntd(runs = 100, abundance.weighted = FALSE, exclude.conspecifics = FALSE)
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_rcbray`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_rcbray(runs=200)
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_process`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_process(use_betamntd = TRUE)
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_NRI`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_NRI()
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_NTI`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_NTI()
# }
# NOT RUN {
## ------------------------------------------------
## Method `trans_nullmodel$cal_Cscore`
## ------------------------------------------------
# }
# NOT RUN {
t1$cal_Cscore()
# }
Run the code above in your browser using DataLab