taowenmicro / ggClusterNet

Microbial ecological network visualization clustering
100 stars 45 forks source link

Error in validObject(.Object) : 类别为“phyloseq”的对象不对: Component taxa/OTU names do not match. Taxa indices are critical to analysis. Try taxa_names() 此外: There were 50 or more warnings (use warnings() to see the first 50) #4

Closed shinepreventer closed 2 years ago

shinepreventer commented 2 years ago

已仔细检查otu表与taxonomy的otuid(完全匹配),样品名也在“ps”中正常显示

以下为使用的代码:

从文件读取

metadata = read.table("metadata.tsv", header=T, row.names=1, sep="\t", comment.char="", stringsAsFactors = F) otutab = read.table("otu_table.txt", header=T, row.names=1, sep="\t", comment.char="", stringsAsFactors = F) taxonomy = read.table("taxonomy.tsv", header=T, row.names=1,sep="\t", comment.char="", stringsAsFactors = F)

提取两个表中共有的ID

Extract only those ID in common between the two tables

idx = rownames(otutab) %in% rownames(taxonomy) otutab = otutab[idx,] taxonomy = taxonomy[rownames(otutab),]

使用amplicon包内置数据

data("metadata")

data(otutab)

导入phyloseq(ps)对象

ps = phyloseq(sample_data(metadata), otu_table(as.matrix(otutab), taxa_are_rows=TRUE), tax_table(as.matrix(taxonomy))) ps ##################################################################

微生物网络#####--------

library(igraph) library(network) library(sna) library(SpiecEasi)

library(tidyverse) library(phyloseq) library(EasyStat) library(ggClusterNet)

path = "net-500" dir.create(path)

result = ggClusterNet::network(ps = ps, N=500, r.threshold=0.60, p.threshold=0.05, label = FALSE, path = path , zipi = TRUE, method = "sparcc",

method = "pearson",

             R = 10,
             ncpus=16     )

#####################################################################

以下为错误信息:

Error in validObject(.Object) : 类别为“phyloseq”的对象不对: Component taxa/OTU names do not match. Taxa indices are critical to analysis. Try taxa_names() 此外: There were 50 or more warnings (use warnings() to see the first 50)

warnings() 警告信息: 1: Setting row names on a tibble is deprecated. 2: Setting row names on a tibble is deprecated. 3: Setting row names on a tibble is deprecated. 4: Use of taxa.roles$label is discouraged. Use label instead. 5: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 6: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 7: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 8: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 9: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 10: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 11: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 12: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 13: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 14: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 15: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 16: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 17: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 18: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 19: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 20: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 21: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 22: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 23: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 24: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 25: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 26: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 27: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 28: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 29: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 30: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 31: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 32: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 33: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 34: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 35: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 36: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 37: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 38: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 39: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 40: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 41: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 42: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 43: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 44: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 45: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 46: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 47: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot 48: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<80>代替了dot 49: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:<93>代替了dot 50: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), ... : 'mbcsToSbcs'里转换'E–R network'出错:代替了dot

##############################################################

以下为数据结构:

image image image image

##############################################################

以下为终止时已输出的文件(后面组的无法计算)

image ##############################################################

系统信息:

Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy

R语言版本: R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

package版本: ‘ggClusterNet’ version 0.1.0 ‘EasyStat’ version 0.1.0 ‘SpiecEasi’ version 1.1.2

package更新时间: 2022.06.21