ArtifCluster: Manually specify coordinates to display the network

View source: R/ArtifClusterG.R

ArtifClusterR Documentation

Manually specify coordinates to display the network

Description

Manually specify coordinates to display the network

Usage

ArtifCluster(cor = cor, nodeGroup = netClu, r = r, da = da)

Arguments

cor

Correlation matrix

nodeGroup

Classification information of network nodes.Group according to actual requirements, see example

r

Radius of each submodule

da

The coordinates of each submodule

Value

list which contains node position coordinates

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(ps)
result = corMicro (ps = ps,N = 100,r.threshold=0.8,p.threshold=0.05,method = "pearson")
#Extract correlation matrix
cor = result[[1]]
# Extract taxonomy table
ps_net = result[[3]]
# set group of experimental
netClu = data.frame(ID = row.names(tax_table),group =rep(1:5,length(row.names(tax_table)))[1:length(row.names(tax_table))] )
netClu$group = as.factor(netClu$group)
tax_table = ps_net %>% vegan_tax() %>%
as.data.frame()
xs = as.data.frame(table(netClu$group))
# set the radicus
r = rep(4,length(xs$Freq))
# Set the coordinates manually
ax1 = c(120,0)
ax2 = c(130,-30)
ax3 = c(140,-70)
ax4 = c(130,-110)
ax5 = c(120,-140)
da = rbind(ax1,ax2,ax3,ax4,ax5)
# Calculate network layout
result2 = ArtifCluster(cor = cor,nodeGroup =netClu,r = r,da =da)
node = result2[[1]]

taowenmicro/ggClusterNet documentation built on March 29, 2025, 1:04 p.m.