| Title: | Phylogeny-Guided Bayesian Microbial Network Inference |
|---|---|
| Description: | Implements a phylogeny-aware Bayesian graphical modeling framework for microbial network inference using a shrinkage precision estimator guided by a phylogenetic kernel, with optional hyperparameter-ensemble edge reliability analysis. |
| Authors: | Rosa Aghdam [aut, cre] |
| Maintainer: | Rosa Aghdam <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.3 |
| Built: | 2026-05-26 20:52:21 UTC |
| Source: | https://github.com/cran/phymapnet |
Fit a single PhyMapNet model
phymapnet_fit( otu, tree, alpha = 0.05, k = 5, epsilon1 = 0, epsilon2 = 0, kernel = c("gaussian", "laplacian"), th_sparsity = 0.95, normalization = c("log", "clr", "tss"), prune_tree = TRUE )phymapnet_fit( otu, tree, alpha = 0.05, k = 5, epsilon1 = 0, epsilon2 = 0, kernel = c("gaussian", "laplacian"), th_sparsity = 0.95, normalization = c("log", "clr", "tss"), prune_tree = TRUE )
otu |
samples x taxa matrix. |
tree |
|
alpha |
kernel bandwidth (>0). |
k |
neighborhood scaling (integer >= 1). Uses K_neighbors = k * p internally. |
epsilon1 |
diagonal jitter for omega_hat. |
epsilon2 |
jitter for IB. |
kernel |
"gaussian" or "laplacian". |
th_sparsity |
quantile level for sparsification (e.g., 0.95). |
normalization |
|
prune_tree |
prune tree tips not in OTU when |
A list with precision_map, adjacency, threshold, taxa, dist, kernel_mat.
Computes a patristic distance matrix from a phylogenetic tree, or validates a supplied phylogenetic distance matrix, then aligns taxa to the OTU table.
phymapnet_prepare_inputs(otu, tree, prune = TRUE)phymapnet_prepare_inputs(otu, tree, prune = TRUE)
otu |
A samples x taxa count/abundance matrix (rownames=samples, colnames=taxa). |
tree |
A |
prune |
Logical; if TRUE and |
A list with otu (aligned), dist (aligned), taxa.
Runs an ensemble over (alpha, k, epsilon1, epsilon2, kernel, normalization) and returns edge reliability as selection frequency under fixed sparsification threshold.
phymapnet_reliability( otu, tree, th_fixed = 0.95, alpha_range = seq(0.01, 0.12, by = 0.01), k_range = 2:10, epsilon1_range = seq(0, 1, by = 0.1), epsilon2_range = seq(0, 1, by = 0.1), kernels = c("gaussian"), normalizations = c("log", "clr", "tss"), consensus_cut = 0.5, prune_tree = TRUE, progress = TRUE, progress_every = 500 )phymapnet_reliability( otu, tree, th_fixed = 0.95, alpha_range = seq(0.01, 0.12, by = 0.01), k_range = 2:10, epsilon1_range = seq(0, 1, by = 0.1), epsilon2_range = seq(0, 1, by = 0.1), kernels = c("gaussian"), normalizations = c("log", "clr", "tss"), consensus_cut = 0.5, prune_tree = TRUE, progress = TRUE, progress_every = 500 )
otu |
samples x taxa matrix. |
tree |
|
th_fixed |
fixed quantile threshold for sparsification across all models (e.g., 0.95). |
alpha_range |
numeric vector. |
k_range |
integer vector. |
epsilon1_range |
numeric vector. |
epsilon2_range |
numeric vector. |
kernels |
character vector: "gaussian" and/or "laplacian". |
normalizations |
character vector: subset of |
consensus_cut |
reliability cutoff for binary consensus (default 0.5). |
prune_tree |
prune tree tips not in OTU when |
progress |
print progress every |
progress_every |
integer. |
A list with rel_mat, consensus_mat, edge_list, N_models, grid.