Package 'TestNet'

Title: A method for inferring microbial networks with false discovery rate control for clustered and unclustered samples
Description: TestNet is a testing method for inferring microbial networks. It differs from existing microbial network analyses in that it provides calibrated results by controlling the false discovery rate. TestNet accounts for the features of compositionality, sparsity, and overdispersion in taxa count data. It also accommodates both independent and clustered samples, offers separate linear and nonlinear tests for each pair of taxa, and includes an omnibus test that bypasses the need to pre-specify the type of relationship for each pair of taxa.
Authors: Yi-Juan Hu [aut, cre]
Maintainer: Yi-Juan Hu <[email protected]>
License: GPL (>=2)
Version: 1.0
Built: 2026-06-03 13:41:26 UTC
Source: https://github.com/yijuanhu/testnet

Help Index


OTU count table of the simulated microbiome samples

Description

This table contains read count data simulated for 100 samples and 46 OTUs and under the AR1 dependence structure

Usage

data("sim.otu.tab")

Format

A data frame with 100 observations on 46 OTUs

Examples

data(sim.otu.tab)

A testing method for inferring microbial networks

Description

This function generates a p-value and a q-value for each (linear, nonlinear, or omnibus) test of a pair of taxa.

Usage

TestNet(
  otu.tab,
  clustered.data = FALSE,
  cluster.id = NULL,
  fdr.nominal = 0.1,
  n.perm.max = NULL,
  seed = 123
)

Arguments

otu.tab

An n.sam by n.otu matrix of read counts.

clustered.data

A logical variable indicating whether the samples are clustered. The default is FALSE.

cluster.id

An array of n.sam cluster identifiers, used in the permutation procedure to shuffle the samples as a whole across clusters and simultaneously shuffle the samples within clusters when clustered.data=TRUE. The default is NULL.

fdr.nominal

The nominal FDR level. The default is 0.1.

n.perm.max

The maximum number of permutation replicates. The default is NULL, in which case a maximum of n.otu * n.rej.stop * (1/fdr.nominal) are used, where n.rej.stop is set to 20.

seed

a single-value integer seed for the random process of drawing permutation replicates. The default is 123.

Value

a list consisting of

p.linear

An n.otu by n.otu matrix of p-values for the linear tests

q.linear

An n.otu by n.otu matrix of q-values for the linear tests

p.nonlinear

An n.otu by n.otu matrix of p-values for the nonlinear tests

q.nonlinear

An n.otu by n.otu matrix of q-values for the nonlinear tests

p.omni

An n.otu by n.otu matrix of p-values for the omnibus tests

q.omni

An n.otu by n.otu matrix of q-values for the omnibus tests

which.pmin

An n.otu by n.otu matrix of 0, 1, and 2 values, where 0 and 1 indicate that the nonlinear and linear tests, respectively, achieved the minimum p-value between the two, and 2 indicates that both tests yielded similar p-values.

Author(s)

Yi-Juan Hu <[email protected]>

References

Su C, Mao Y, He M, Van Doren VE, Kelley CF, Hu YJ (2026). TestNet: a method for inferring microbial networks with false discovery rate control for clustered and unclustered samples. Genome Biology, in press.

Examples

data(sim.otu.tab)
TestNet.res <- TestNet(otu.tab = sim.otu.tab)