Hello. I am an ecologist who studies the structure and function of food webs. I wanted to use Gelpi to better understand how plankton food webs are structured along a gradient of pollution stress. Yes, a Gelpi newbee -- in fact a network analysis newbee.
The software seems intuitive and useful, however, my data consist of matrices of 0 and 1 values between predators and their prey (1 = predation, 0 = lack of predation). So for example in a very simple case with two predators (species A, B) and two prey eaten by them (C, D), the data matrix would look like this and exists as a .txt file:
A B
C 1 1
D 1 1
My actual matrices are much more complex, with up to 50 species and hundreds of links.
How do I bring data like this into Gelpi? Or can I? Is there some process that I must do first to create the network diagrams?
[SOLVED] generating networks from data matrices
-
- Gephi Community Manager
- Posts:964
- Joined:09 Dec 2009 14:41 [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: generating networks from data matrices
Welcome here!
Write your matrix as a DL file (see this page), and load the data as explained in the Quick Start tutorial.
Cheers!
Write your matrix as a DL file (see this page), and load the data as explained in the Quick Start tutorial.
Cheers!
Re: generating networks from data matrices
Your matrix is already a graph, you just need to pivot it:
ABCD
A 0110
B 1000
C 1101
D 0100
Can be represented in one of two ways. You can either only map the predation connections, which could be outputed as a simple CSV:
A,B,C
B,A
C,A,B,D
D,B
(Remember, Gephi's CSV import expects source, target, target, target, target, etc for each line)
Or you can map each type of connection with the predator/prey distinction as an edge type:
Source Target Type
A, A, 0
A, B, 1
A, C, 1
A, D, 0
B, A, 1
B, B, 0
B, C, 0
B, D, 0
How you get there from your data depends on its actual format and the method you're most comfortable with using to transform data. You can write this as a script, or use a tool like Data Wrangler or even do it in Excel if it's not too many columns.
ABCD
A 0110
B 1000
C 1101
D 0100
Can be represented in one of two ways. You can either only map the predation connections, which could be outputed as a simple CSV:
A,B,C
B,A
C,A,B,D
D,B
(Remember, Gephi's CSV import expects source, target, target, target, target, etc for each line)
Or you can map each type of connection with the predator/prey distinction as an edge type:
Source Target Type
A, A, 0
A, B, 1
A, C, 1
A, D, 0
B, A, 1
B, B, 0
B, C, 0
B, D, 0
How you get there from your data depends on its actual format and the method you're most comfortable with using to transform data. You can write this as a script, or use a tool like Data Wrangler or even do it in Excel if it's not too many columns.
-
- Posts:2
- Joined:07 Jun 2011 19:01 [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: generating networks from data matrices
THANK YOU FOR THE HELP !