divnet: divnet

View source: R/divnet_main.R

divnetR Documentation

divnet

Description

divnet

Usage

divnet(
  W,
  X = NULL,
  fitted_model = NULL,
  tuning = NULL,
  perturbation = NULL,
  network = NULL,
  base = NULL,
  ncores = NULL,
  variance = "parametric",
  B = 5,
  nsub = NULL,
  formula = NULL,
  ...
)

Arguments

W

An abundance table with taxa as columns and samples as rows; or a phyloseq object.

X

The covariate matrix, with samples as rows and variables as columns. Defaults to NULL (sample_names are the covariates). Instead of specifying X, you can specify this information using the argument formula. If you specify a formula and W is a phyloseq object, this argument will be ignored.

fitted_model

object produced by fit_aitchison. Defaults to NULL.

tuning

settings for tuning the MC-MH algorithm. Options include NULL (defaults to "fast"), "fast", "careful" or a named list with components EMiter (number of EM iterations; 6 for fast, 10 for careful), EMburn (number of EM iterations to burn; 3 for fast, 5 for careful), MCiter (number of MC iterations; 500 for fast, 1000 for careful), MCburn (number of MC iterations to burn; 250 for fast, 500 for careful) and stepsize (variance used for MH samples; 0.01 for both fast and careful)

perturbation

Perturbation magnitude for zero values when calculating logratios.

network

How to estimate network. Defaults to NULL (the default), "default" (generalised inverse, aka naive). Other options include "diagonal", "stars" (requires glasso and SpiecEasi to be installed), or a function that you want to use to estimate the network

base

The column index of the base taxon in the columns of W, or the name of the taxon (must be a column name of W, or a taxon name if W is a phyloseq object). If NULL, will use 'pick_base' to choose a taxon. If no taxa are observed in all samples, an error will be thrown. In that case, we recommend trying a number of different highly abundant taxa to confirm the results are robust to the taxon choice.

ncores

Number of cores to use for parallelization

variance

method to get variance of estimates. Current options are "parametric" for parametric bootstrap, "nonparametric" for nonparametric bootstrap, and "none" for no variance estimates

B

Number of bootstrap iterations for estimating the variance.

nsub

Number of subsamples for nonparametric bootstrap. Defaults to half the number of observed samples.

formula

an object of class formula: a symbolic description of the model to be fitted; a means of constructing X via stats::model.matrix. If W is a phyloseq object, the formula should refer to variables stored in sample_data. If W is not a phyloseq object, X should be a data frame containing columns referred to in your formula. Formula references must match column names found in the sample data from W or X. Optional, defaults to NULL.

...

Additional parameters to be passed to the network function

Author(s)

Amy Willis


adw96/DivNet documentation built on Oct. 2, 2023, 11:49 a.m.