joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
567 stars 187 forks source link

Error in plot_net and plot_network functions #1665

Open cpavloud opened 1 year ago

cpavloud commented 1 year ago

Hi! I am using R version 4.1.1 and phyloseq version 1.38.0 trying to create a network with my data.

I first tried to use plot_net(physeq, distance = "bray", maxdist=0.4, type = "samples", color="Status", shape="Sample_type") but I get the error Error in setkeyv(vertexDT, "vertex") : some columns are not in the data.table: vertex

Then I tried to run first
network <- make_network(physeq, type="samples", distance="bray", max.dist = 0.4, keep.isolates=TRUE) which resulted in IGRAPH daf445a UN-- 18 0 -- + attr: name (v/c) + edges from daf445a (vertex names):

but, when I tried to run plot_network(network, physeq, type="samples", color="Status", shape="Sample_type") I get the error Error in $<-.data.frame(*tmp*, "id", value = 1:0) : replacement has 2 rows, data has 0

When I used the same functions with the GlobalPatterns dataset, they worked. However, I cannot understand what it the issue with my phyloseq object... Everything else seems to work fine...