stefpeschel / NetCoMi

Network construction, analysis, and comparison for microbial compositional data
https://netcomi.de
GNU General Public License v3.0
152 stars 27 forks source link

Identify the members of a node #18

Closed Matmey closed 3 years ago

Matmey commented 3 years ago

Hello, First, thank you for developing such great tools!

But I wanted to know if it was possible to identify the components of a node? With the summary function, I can see that my network is composed of 4 nodes, with a different number of species in each. But I have too many species to be able to read them correctly on the plot. Is there a method to identify them directly?

Thanks, Mathisse

stefpeschel commented 3 years ago

Dear Mathisse, Thank you for the nice feedback!

What do you mean by "4 nodes"? Nodes are usually the species (or, more generally, the taxa or OTUs). If you say, there is a different number of species in each node, I assume you mean either four clusters or four components?

Best, Stefanie

xjallen commented 3 years ago

Jumping off of this, finding the members of a cluster is what I'd like to know how to do. How would that be done in the package?

Matmey commented 3 years ago

Indeed I wanted to know how to find the OTU corresponding to the different clusters. It possible with : sort(props_guyane$clustering$clust1)

Thanks!

stefpeschel commented 3 years ago

Thanks @Matmey for your response. Indeed, this is the right way to access the cluster assignment. Here again a bit more detailed:

net <- netConstruct(...)
netprops <- netAnalyze(net, ...)
netprops$clustering$clust1 #clustering of group 1
netprops$clustering$clust2 #clustering of group 2 if existent

Best, Stefanie

lixiaopi1985 commented 2 years ago

Hi @stefpeschel, is there a way to find the nodes by cluster colors?

stefpeschel commented 2 years ago

Hey @lixiaopi1985 , The colors itself are not exportet but you can access the cluster assignments as described above, where each number corresponds to a certain color. In other words, all nodes with the same cluster number are colored equally in the network plot.