SpiecEasi 2.2.0
SpiecEasi includes some convenience wrappers to work directly with phyloseq objects.
library(SpiecEasi)
library(phyloseq)
## Load round 2 of American gut project
data('amgut2.filt.phy')
se.mb.amgut2 <- spiec.easi(amgut2.filt.phy, method='mb', lambda.min.ratio=1e-2,
nlambda=20, pulsar.params=list(rep.num=50))
ig2.mb <- adj2igraph(getRefit(se.mb.amgut2), vertex.attr=list(name=taxa_names(amgut2.filt.phy)))
The plot_network function provides an easy way to visualize networks with taxonomic information from phyloseq objects. You can specify different taxonomic ranks for coloring nodes and customize the visualization further.
plot_network(ig2.mb, amgut2.filt.phy, type='taxa', color="Rank3")
# Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
# ℹ Please use tidy evaluation idioms with `aes()`.
# ℹ See also `vignette("ggplot2-in-packages")` for more information.
# ℹ The deprecated feature was likely used in the phyloseq package.
# Please report the issue at <https://github.com/joey711/phyloseq/issues>.
# This warning is displayed once per session.
# Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
# generated.
# Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
# ℹ Please use `linewidth` instead.
# ℹ The deprecated feature was likely used in the phyloseq package.
# Please report the issue at <https://github.com/joey711/phyloseq/issues>.
# This warning is displayed once per session.
# Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
# generated.
Session info:
sessionInfo()
# R version 4.6.1 (2026-06-24)
# Platform: x86_64-pc-linux-gnu
# Running under: Ubuntu 24.04.5 LTS
#
# Matrix products: default
# BLAS: /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so
# LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
#
# locale:
# [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
# [3] LC_TIME=en_GB LC_COLLATE=C
# [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
# [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
# [9] LC_ADDRESS=C LC_TELEPHONE=C
# [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#
# time zone: America/New_York
# tzcode source: system (glibc)
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods base
#
# other attached packages:
# [1] phyloseq_1.58.0 igraph_2.3.4 Matrix_1.7-6 SpiecEasi_2.2.0
# [5] BiocStyle_2.42.0
#
# loaded via a namespace (and not attached):
# [1] ade4_1.7-24 tidyselect_1.2.1
# [3] dplyr_1.2.1 farver_2.1.2
# [5] Biostrings_2.82.0 S7_1.0.0
# [7] fastmap_1.2.0 digest_0.6.39
# [9] lifecycle_1.0.5 cluster_2.1.8.3
# [11] survival_3.8-13 magrittr_2.0.5
# [13] compiler_4.6.1 rlang_1.3.0
# [15] sass_0.5.0 tools_4.6.1
# [17] yaml_2.3.12 data.table_1.18.6.1
# [19] knitr_1.52 labeling_0.4.3
# [21] S4Arrays_1.14.0 DelayedArray_0.40.0
# [23] plyr_1.8.9 RColorBrewer_1.1-3
# [25] abind_1.4-8 withr_3.0.3
# [27] BiocGenerics_0.60.0 grid_4.6.1
# [29] stats4_4.6.1 multtest_2.70.0
# [31] biomformat_1.42.0 ggplot2_4.0.4
# [33] scales_1.4.0 iterators_1.0.14
# [35] MASS_7.3-66 dichromat_2.0-1
# [37] tinytex_0.61 SummarizedExperiment_1.44.0
# [39] cli_3.6.6 rmarkdown_2.32
# [41] vegan_2.7-8 crayon_1.5.3
# [43] generics_0.1.4 otel_0.3.0
# [45] pulsar_0.3.14 reshape2_1.4.5
# [47] ape_5.8-1 cachem_1.1.0
# [49] stringr_1.6.0 splines_4.6.1
# [51] parallel_4.6.1 BiocManager_1.30.27
# [53] XVector_0.54.0 matrixStats_1.5.0
# [55] vctrs_0.7.3 glmnet_5.2
# [57] jsonlite_2.0.0 VGAM_1.1-14
# [59] bookdown_0.48 IRanges_2.48.0
# [61] S4Vectors_0.52.0 magick_2.9.1
# [63] foreach_1.5.2 jquerylib_0.1.4
# [65] glue_1.8.1 codetools_0.2-20
# [67] stringi_1.8.9 shape_1.4.6.1
# [69] gtable_0.3.6 GenomicRanges_1.66.0
# [71] tibble_3.3.1 pillar_1.11.1
# [73] htmltools_0.5.9 Seqinfo_1.4.0
# [75] huge_2.0.1 R6_2.6.1
# [77] evaluate_1.0.5 lattice_0.23-1
# [79] Biobase_2.74.0 bslib_0.12.0
# [81] Rcpp_1.1.2 permute_0.10-1
# [83] SparseArray_1.14.0 nlme_3.1-172
# [85] mgcv_1.9-5 xfun_0.62
# [87] MatrixGenerics_1.26.0 pkgconfig_2.0.3