New user attempting to create bipartite graph

Once it's running
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
iembry16
Posts:6
Joined:17 Oct 2016 08:54
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
New user attempting to create bipartite graph

Post by iembry16 » 17 Oct 2016 09:50

Hi, I am a new user and I am using Gephi 0.9.1.

I am attempting to create a bipartite network graph for virus-bat host matrix data rather than virus-macaque data (see the quote from the article below):
"A presence/absence matrix was constructed to show the distribution of viruses across all samples, and used for network and statistical analyses as described in the main text. In summary, A bipartite (two-mode) affiliation network was generated for virus–macaque host matrix data, stratified by site name, and a unipartite (one-mode) virus:virus net- work was generated to display the connections between viruses. Network analyses and visualisation were conducted in the network analysis platform Gephi, using the force-directed algorithm ForceAtlas2 (ref. 28)."
Source: "Non-random patterns in viral diversity" by Simon J. Anthony, et. al., Nature Communications, 22 Sep 2015.


I have two spreadsheets:
  • one with bat species as the row names and the columns with the site names with values for the number of bat species present at each site
    one with virus species as the row names and the columns with the site names with values for the number of virus species present at each site.
I have imported both spreadsheets in as nodes and I have identified all columns as Integers as the values range from 0 to a maximum number. Currently, I have 107 nodes without any edges. I am trying to figure out what I need to do in order to create a network graph.

Here are my questions:

1) a) What is a node?

b) What is an edge?

c) How are they related in Gephi?

d) Where can I find tutorials or postings that explain this information?

2) a) With the format for the spreadsheets described above, can I create a bipartite network graph?

b) If not, then how should I format my spreadsheets?

c) Is there any specific format needed for the spreadsheet files to be imported into Gephi for bipartite or monopartite network analysis?

3) Where can I find tutorials with step-by-step instructions on creating bipartite or monopartite network graphs from creating the spreadsheet files to completion of the figures?

I'm sorry that I have so many questions. I haven't found the User Guides nor Gephi Tutorials helpful with answering my questions and showing step-by-step directions from start to finish.

Thank you in advance.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: New user attempting to create bipartite graph

Post by eduramiba » 17 Oct 2016 10:17


iembry16
Posts:6
Joined:17 Oct 2016 08:54
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: New user attempting to create bipartite graph

Post by iembry16 » 17 Oct 2016 10:47

Thank you for the quick response with the links. I had checked out https://github.com/gephi/gephi/wiki/Import-CSV-Data prior to posting the question and I don't find it very helpful in answering the questions that I had posted.

I do understand more about the difference between the nodes and edges now. I know for my data sets that I will be using the nodes, but I don't know how to go from there.

Can someone point me in the direction of similar networks (virus - host) that I can use as an example to structure my data sets?

The first questions have been answered (1a - 1d), but I am still looking for answers on the remaining questions.

Thank you.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: New user attempting to create bipartite graph

Post by eduramiba » 17 Oct 2016 10:57

It's just that a network only makes sense if it has edges (relationships between nodes).
It seems that your nodes will have 3 types: virus, bats and sites.

Then edges will be relationships between virus -> sites and bats -> sites.

So, for example, if you use spreadsheet format, your nodes CSV will be:

Id,label,type
v1,Virus 1,virus
v2,Virus 2, virus
s1,Site 1,site
b1,Bat 1,bat
...

And edges CSV could be:

Source,Target,Weight
v1,s1,number_of_virus_1_at_site1
v2,s1,number_of_virus_2_at_site1
b1,s2,number_of_bat_1_at_site2
...


This way you will import a bipartite network. Later you can transform it with this plugin: https://gephi.org/plugins/#/plugin/multimode

iembry16
Posts:6
Joined:17 Oct 2016 08:54
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: New user attempting to create bipartite graph

Post by iembry16 » 18 Oct 2016 07:47

Hi, thank you for your response with the helpful example. I am beginning to understand Gephi more now.

Just to clarify for the edges csv file, I would also list all bats at site 1 and not just those at site 2, etc.

Thank you too for sharing the plugin with me too.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable