randomClusterG: Construct a network layout. Randomly distributed module...

View source: R/randomClusterG.R

randomClusterGR Documentation

Construct a network layout. Randomly distributed module positions

Description

Construct a network layout. Randomly distributed module positions

Usage

randomClusterG(cor = cor, nodeGroup = netClu)

Arguments

cor

Correlation matrix

nodeGroup

Classification information of network nodes

Value

result2 Which contains 2 data.frame. Result2[[1]], consists of OTU and its corresponding coordinates. result2[[2]], consists of the network center coordinates of each group

Author(s)

Contact: Tao Wen taowen@njau.edu.cn Penghao Xie 2019103106@njau.edu.cn yongxin liu yxliu@genetics.ac.cn Jun Yuan junyuan@njau.edu.cn

References

Tao Wen#, Penghao Xie#, Shengdie Yang, Guoqing Niu, Xiaoyu Liu, Zhexu Ding, Chao Xue, Yong-Xin Liu *, Qirong Shen, Jun Yuan* ggClusterNet: an R package for microbiome network analysis and modularity-based multiple network layouts iMeta 2022,DOI: doi: 10.1002/imt2.32

Examples

data
data(ps)
result = corMicro (ps = ps,N = 100,r.threshold=0.8,p.threshold=0.05,method = "pearson")
#Extract correlation matrix
cor = result[[1]]
# Extract tax table for grouping
ps_net = result[[3]]
vegan_tax <-  function(physeq){
tax <-  tax_table(physeq)

return(as(tax,"matrix"))
}
tax_table = as.data.frame(vegan_tax(ps_net))
group = as.data.frame(tax_table)
group$ID = row.names(group)
netClu = data.frame(ID = row.names(group),group = group$Phylum)
# Calculate the layout of netwok, extract the coordinate of node
result2 = randomClusterG (cor = cor,nodeGroup =netClu )
node = result2[[1]]



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