Clarification on subgraph function and sample-specific information

Hello, thank you for the great tool! I have a question regarding the use of the subgraph function in building single-sample subnetworks.

From what I understand, the current implementation takes the global network and then extracts the subgraph based on which microbes are present in each sample. This means that:

  • The subgraph reflects only presence/absence of nodes for each sample.

  • The abundance information is not incorporated into the subnetwork structure.

  • Edge weights in the subgraph are inherited from the global network, rather than recalculated for each sample.

Could you please clarify:

  1. Is this interpretation correct?

  2. If so, is there a recommended way to integrate abundance information into sample-specific subnetworks (e.g., using node attributes or recalculating edge weights)?

Thanks a lot for your help!

I’m sorry, I have some trouble following your terminology.

First, you should use induced_subgraph() instead of subgraph(). The latter name will be repurposed in the future. We will make the documentation clearer about this.

This function computes what is called an induced subgraph: it keeps only the vertices you specify and the edges between them. It also keeps all attributes of these vertices and edges. The documentation says,

creates a subgraph of a graph, containing only the specified vertices and all the edges among them.

I am not sure what this means.

Again, I am not sure what you mean.

I am not sure what you mean by “abundance”. I assume this has to do with your biological dataset. Can you phrase the question in terms of graphs?

Yes.

I am not sure what you mean by “abundance”, and how this is represented in the networks you built.

Vertex attributes are preserved in the subgraph.

I understand that you are analysing some sort of biological dataset where a network representation is useful, but you did not describe what your network is (what do the vertices and edges represent? what attributes?). Thus we are having a bit of of miscommunication. If you can clarify this, perhaps I can answer. At the moment I am overwhelmed and I need a very clearly stated question to be able to answer. :slight_smile:

I’m so sorry that I haven’t clearly clarified my target! I want to build microbial sample-specific networks, which are able to reflect the microbial structure of each sample, and I found some tutorials say that subgraph() is capable to do this. Now with your clear explanation I understand how this function works!! Thanks a lot!!

1 Like