View source: R/randomClusterG.R
randomClusterG | R Documentation |
Construct a network layout. Randomly distributed module positions
randomClusterG(cor = cor, nodeGroup = netClu)
cor |
Correlation matrix |
nodeGroup |
Classification information of network nodes |
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
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
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
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]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.