corBionetwork: Microbial related bipartite network analysis

View source: R/corBionetwork2.R

corBionetworkR Documentation

Microbial related bipartite network analysis

Description

Microbial related bipartite network analysis

Usage

corBionetwork(
  otu = NULL,
  tax = NULL,
  map = NULL,
  ps = NULL,
  lab = NULL,
  N = 0,
  r.threshold = 0.6,
  p.threshold = 0.05,
  label = FALSE,
  group = "Group",
  env = NULL,
  envGroup = NULL,
  method = "spearman",
  layout = "fruchtermanreingold",
  path = "./",
  fill = "Phylum",
  size = "igraph.degree",
  scale = TRUE,
  bio = TRUE,
  zipi = FALSE,
  step = 100,
  width = 20,
  height = 20,
  big = TRUE,
  select_layout = TRUE,
  layout_net = "model_maptree",
  clu_method = "cluster_fast_greedy",
  minsize = 4,
  maxsize = 14
)

Arguments

ps

phyloseq Object, contains OTU tables, tax table and map table, represented sequences,phylogenetic tree.

N

filter OTU tables by abundance.The defult, N=0.001, extract the top 0.001 relative abundance of OTU.

r.threshold

The defult, r.threshold=0.6, it represents the correlation that the absolute value of the correlation threshold is greater than 0.6. the value range of correlation threshold from 0 to 1.

p.threshold

The defult, p.threshold=0.05, it represents significance threshold below 0.05.

label

Whether to add node label.

group

Separate Group.

env

Environmental factor index table which do network analysis with the microbiome.

envGroup

group of env table.

method

method for Correlation calculation,method="pearson" is the default value. The alternatives to be passed to cor are "spearman" and "kendall".

path

save path of all of network analyse.

fill

fill coulor of node.

size

node size.

scale

Whether relative abundance standardization is required.

bio

Do you need to do a binary network.

zipi

zipi Calculation.

step

Random network sampling times.

width

Save the width of the picture settings.

height

Save the height of the picture setting.

lay

layout which network show.

Value

list which contains OTU correlation matrix

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

path = "./netowrk/"
data(ps)
ps16s = ps %>% ggClusterNet::scale_micro()
psITS = NULL
library(phyloseq)
ps.merge <- ggClusterNet::merge16S_ITS(ps16s = ps16s,
                                       psITS = NULL,
                                       N16s = 100)
map =  phyloseq::sample_data(ps.merge)
head(map)
map$Group = "one"
phyloseq::sample_data(ps.merge) <- map
data(env1)
data1 = env1
data1$id = row.names(data1)
data1 = data1 %>% select(id,everything())
envRDA.s = vegan::decostand(env1,"hellinger")
data1[,-1] = envRDA.s
Gru = data.frame(ID = colnames(data1)[-1],group = "env" )
head(Gru)
corBionetwork(ps = ps.merge,
                            N = 0,
                            r.threshold = 0.4, # 相关阈值
                            p.threshold = 0.05,
                            big = T,
                            group = "Group",
                            env = data1, # 环境指标表格
                            envGroup = Gru,# 环境因子分组文件表格
                            # layout = "fruchtermanreingold",
                            path = path,# 结果文件存储路径
                            fill = "Phylum", # 出图点填充颜色用什么值
                            size = "igraph.degree", # 出图点大小用什么数据
                            scale = TRUE, # 是否要进行相对丰度标准化
                            bio = TRUE, # 是否做二分网络
                            zipi = F, # 是否计算ZIPI
                            step = 100, # 随机网络抽样的次数
                            width = 18,
                            label = TRUE,
                            height = 10
)

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