nodeadd: Add annotation information to network nodes

View source: R/nodeadd.R

nodeaddR Documentation

Add annotation information to network nodes

Description

Add annotation information to network nodes

Usage

nodeadd(plotcord = node, otu_table = otu_table, tax_table = tax_table)

Arguments

plotcord

The coordinate information of node OTU

otu_table

Relative abundance of node OTU

tax_table

Species annotation information of the node OTU

Value

list

Author(s)

Contact: Tao Wen 2018203048@njau.edu.cn Jun Yuan junyuan@njau.edu.cn Penghao Xie 2019103106@njau.edu.cn

References

Yuan J, Zhao J, Wen T, Zhao M, Li R, Goossens P, Huang Q, Bai Y, Vivanco JM, Kowalchuk GA, Berendsen RL, Shen Q Root exudates drive the soil-borne legacy of aboveground pathogen infection Microbiome 2018,DOI: doi: 10.1186/s40168-018-0537-x

Examples

data(ps)
# Calculate the correlation network of microbial community data.Generate 4 lists
result = corMicro (ps = ps,N = 100,r.threshold=0.8,p.threshold=0.05,method = "pearson")
# Extract phyloseq object from result
ps_net = result[[3]]
otu_table = as.data.frame(t(vegan_otu(ps_net)))
Extract tax_table from ps_net
vegan_tax <-  function(physeq){
tax <-  tax_table(physeq)

return(as(tax,"matrix"))
}
tax_table = as.data.frame(vegan_tax(ps_net))
# Set up OTU grouping
netClu = data.frame(ID = row.names(otu_table),group =rep(1:5,length(row.names(otu_table)))[1:length(row.names(otu_table))] )
netClu$group = as.factor(netClu$group)
# Construct a network layout. Arrange network nodes to different locations according to grouping
result2 = PolygonClusterG (cor = cor,nodeGroup =netClu  )
node = result2[[1]]
nodes = nodeadd(plotcord =node,otu_table = otu_table,tax_table = tax_table)

taowenmicro/ggClusterNet documentation built on March 29, 2024, 1:32 a.m.