Introduction

PhONA provides a framework to select a testable and manageable number of OTUs to support microbiome-based agriculture.

# installation 
library(devtools)
devtools::install_github("ravinpoudel/PhONA", build_vignettes = TRUE, force = TRUE)

# Browse Vignettes to see the output as below. 

browseVignettes("PhONA")
library(tufte)
library(PhONA)
###### Load the data
phyobj <- readRDS(system.file("extdata", "physeqobject.rds", package = "PhONA"))
sparcc.cor <- read.delim(system.file("extdata", "cor_sparcc.out", package = "PhONA"), sep = "\t", header = T, row.names = 1)
sparcc.pval <- read.delim(system.file("extdata", "pvals.txt", package = "PhONA"), sep = "\t", header = T, row.names = 1)
## Assign color to the taxa on the whole phyloseq object so that the same color is assigned for a taxon across treatments
phyobj = taxacolor(phyobj = phyobj, coloredby = "Phylum")
example_lm <- PhONA(
  physeqobj = phyobj,
  cordata = sparcc.cor,
  pdata = sparcc.pval,
  model = "lm",
  iters=1,
  OTU_OTU_pvalue = 0.05,
  OTU_OTU_rvalue = 0.5,
  OTU_Phenotype_pvalue = 0.6,
  definePhenotype = "Marketable",
  defineTreatment = "Maxifort",
  PhenoNodecolor = "yellow",
  PhenoNodesize = 20,
  PhenoNodelabel = "Yield",
  nodesize = 10,
  Pheno2OTUedgecolor = "black",
  netlayout = layout.fruchterman.reingold
)

Summary of the graph

kable(summarizePhONA(example_lm$phona_graph, example_lm$roles))

Role analyses using SA algorithm implemented in rnetcarto package.

rolePlot(example_lm)
library(PhONA)
example_lasso <- PhONA(
  physeqobj = phyobj,
  cordata = sparcc.cor,
  pdata = sparcc.pval,
  model = "lasso",
  iters=2,
  OTU_OTU_pvalue = 0.001,
  OTU_OTU_rvalue = 0.6,
  OTU_Phenotype_pvalue = 0.6,
  definePhenotype = "Marketable",
  defineTreatment = "Maxifort",
  PhenoNodecolor = "yellow",
  PhenoNodesize = 20,
  PhenoNodelabel = "Yield",
  nodesize = 10,
  Pheno2OTUedgecolor = "black",
  netlayout = layout.fruchterman.reingold
)

Summary of the graph

kable(summarizePhONA(example_lasso$phona_graph, example_lasso$roles))
rolePlot(example_lasso)


ravinpoudel/PhONA documentation built on Jan. 30, 2023, 5:12 p.m.