[SOLVED] Importing too few edges
-
- Posts:5
- Joined:22 Aug 2011 18:06 [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
Hi there,
I am new to gephi and after three frustrating days trying to import some data I hope you guys can help me. I already walked through the tutorial before trying my own data but have not had luck importing it properly yet. I am preparing the data in R and write it as a .gexf file to import. However, I do not get the correct results for number of nodes and edges.
with "create missing nodes" checked
# of Nodes: 30368
# of Edges: 39878
with "create missing nodes" UNchecked
# of Nodes: 16490
# of Edges: 2660
The problem is, that according to the file I should have 16490 nodes and 39878 edges. Since the graph is undirected, I have removed edges that replicate a relation, just in another direction. Initially I thought that was the problem but it turned out it was not.
Finally, I guess I should say I am running gephi on a Mac.
Any help would be greatly appreciated. I cannot wait to really get started on what looks to be a very cool visualization tool for working with networks.
Kind regards,
Freds
Also, how do I increase the memory or something in gephi so it runs faster? It seems like the dataset I am using is almost too big when I try to use the different layouts.
Oh, my file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.2draft" version="1.2">
<meta lastmodifieddate="2009-03-20">
<creator>Gexf.net</creator>
<description>A hello world! file</description>
</meta>
<graph mode="static" defaultedgetype="undirected" idtype="string">
<nodes count="16490">
<node id="0307514161" label="rudolph the red-nosed reindeer" />
<node id="0307554066" label="underdog (collector's edition)" />
<node id="0634049410" label="the blues guitar of keb' mo': basic techniques for the contemporary player" />
...
...
<node id="b00009mekj" label="the mouse that roared" />
<node id="b00009mekp" label="burnt by the sun" />
<node id="b00009mekq" label="fear of a black hat" />
</nodes>
<edges count="39878">
<edge id="1" source="0307514161" target="B00004VVP9"/>
<edge id="2" source="0307514161" target="B00004VVPA"/>
<edge id="3" source="0307514161" target="B00004W5UM"/>
...
...
<edge id="39876" source="B00009AVA0" target="B00008WI9P"/>
<edge id="39877" source="B00009L4TO" target="B000022TSW"/>
<edge id="39878" source="B00009MEJW" target="B000096IAJ"/>
</edges>
</graph>
</gexf>
I am new to gephi and after three frustrating days trying to import some data I hope you guys can help me. I already walked through the tutorial before trying my own data but have not had luck importing it properly yet. I am preparing the data in R and write it as a .gexf file to import. However, I do not get the correct results for number of nodes and edges.
with "create missing nodes" checked
# of Nodes: 30368
# of Edges: 39878
with "create missing nodes" UNchecked
# of Nodes: 16490
# of Edges: 2660
The problem is, that according to the file I should have 16490 nodes and 39878 edges. Since the graph is undirected, I have removed edges that replicate a relation, just in another direction. Initially I thought that was the problem but it turned out it was not.
Finally, I guess I should say I am running gephi on a Mac.
Any help would be greatly appreciated. I cannot wait to really get started on what looks to be a very cool visualization tool for working with networks.
Kind regards,
Freds
Also, how do I increase the memory or something in gephi so it runs faster? It seems like the dataset I am using is almost too big when I try to use the different layouts.
Oh, my file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.2draft" version="1.2">
<meta lastmodifieddate="2009-03-20">
<creator>Gexf.net</creator>
<description>A hello world! file</description>
</meta>
<graph mode="static" defaultedgetype="undirected" idtype="string">
<nodes count="16490">
<node id="0307514161" label="rudolph the red-nosed reindeer" />
<node id="0307554066" label="underdog (collector's edition)" />
<node id="0634049410" label="the blues guitar of keb' mo': basic techniques for the contemporary player" />
...
...
<node id="b00009mekj" label="the mouse that roared" />
<node id="b00009mekp" label="burnt by the sun" />
<node id="b00009mekq" label="fear of a black hat" />
</nodes>
<edges count="39878">
<edge id="1" source="0307514161" target="B00004VVP9"/>
<edge id="2" source="0307514161" target="B00004VVPA"/>
<edge id="3" source="0307514161" target="B00004W5UM"/>
...
...
<edge id="39876" source="B00009AVA0" target="B00008WI9P"/>
<edge id="39877" source="B00009L4TO" target="B000022TSW"/>
<edge id="39878" source="B00009MEJW" target="B000096IAJ"/>
</edges>
</graph>
</gexf>
Re: Importing too few edges
Hi, welcome!
To debug your gexf file,
- I would delete the lines "node count = 16490" and "edge count = 39878". Gephi does not need them to import the file or to count how many nodes and edges you have. Deleting them will suppress a source of confusion about how many edges and nodes you really have in your gexf.
- still to identify how many nodes and edges you really have, you could rename your nodes and edges id to be incremental (id of node 1 = "1", id of node 2 = "2", etc... and same for edges). This way, by checking the last node and edge you can see with more confidence how many they are. Of course if the ids that you have now are important to you, you could keep them and put them as an attribute.
Does it help?
Best,
Clement
To debug your gexf file,
- I would delete the lines "node count = 16490" and "edge count = 39878". Gephi does not need them to import the file or to count how many nodes and edges you have. Deleting them will suppress a source of confusion about how many edges and nodes you really have in your gexf.
- still to identify how many nodes and edges you really have, you could rename your nodes and edges id to be incremental (id of node 1 = "1", id of node 2 = "2", etc... and same for edges). This way, by checking the last node and edge you can see with more confidence how many they are. Of course if the ids that you have now are important to you, you could keep them and put them as an attribute.
Does it help?
Best,
Clement
-
- Posts:5
- Joined:22 Aug 2011 18:06 [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: Importing too few edges
Hi Clement,
And thank for your reply.
I have deleted the number of nodes and edges but that did not do anything.
I thought about creating another ID key but only if the ID's are causing trouble. Actually, I am quite certain of hovv many nodes and edges I have - Gephi just is not reading it correctly.
Frederik
And thank for your reply.
I have deleted the number of nodes and edges but that did not do anything.
I thought about creating another ID key but only if the ID's are causing trouble. Actually, I am quite certain of hovv many nodes and edges I have - Gephi just is not reading it correctly.
Frederik
- 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: Problems with import of data and # of nodes/edges
Hi, from the numbers you are getting with both options, it seems that some of your edges are using nodes ids that don't exist or are not exactly the same. Because if you check "create missing nodes" it creates the right amount of edges and more nodes as they don't exist.
I guess the exact problem is that you have lower case letters on the nodes IDs and all upper case in the edges source and target ids.
To increase maximum memory, look at this link http://gephi.org/users/install/#memory
Eduardo
I guess the exact problem is that you have lower case letters on the nodes IDs and all upper case in the edges source and target ids.
To increase maximum memory, look at this link http://gephi.org/users/install/#memory
Eduardo
-
- Posts:5
- Joined:22 Aug 2011 18:06 [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: Importing too few edges
Hi again,
I solved the problem which was due to my data manipulation in R. I am still not quite sure what went wrong but it seems to work now.
Thanks.
However, I still have problems with the speed of Gephi when trying to change the layout. I changed the gephi.conf file to say "-J-Xms256m -J-Xmx2048m", which was something I found somewhere on the internet. I have 4 gb of ram on my Macbook Pro. How should I set it optimally?
Frederik
I solved the problem which was due to my data manipulation in R. I am still not quite sure what went wrong but it seems to work now.
Thanks.
However, I still have problems with the speed of Gephi when trying to change the layout. I changed the gephi.conf file to say "-J-Xms256m -J-Xmx2048m", which was something I found somewhere on the internet. I have 4 gb of ram on my Macbook Pro. How should I set it optimally?
Frederik
Last edited by theFreds on 23 Aug 2011 14:43, edited 1 time in total.
- 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: Importing too few edges
Oh, this is the same post.
I answered in the other post.
Try that about memory
I answered in the other post.
Try that about memory
-
- Posts:5
- Joined:22 Aug 2011 18:06 [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: Problems with import of data and # of nodes/edges
Hi there,
I am terribly sorry I have created two posts. I did not want to spam the forum but it seemed as if something went wrong the first time I created the post so I went "back" and re-wrote it, just changing the title.
Can I delete this second post myself or can a moderator help me, please?
Again, I am sorry for the inconvenience.
Thanks for your comment, eduramiba!
I am terribly sorry I have created two posts. I did not want to spam the forum but it seemed as if something went wrong the first time I created the post so I went "back" and re-wrote it, just changing the title.
Can I delete this second post myself or can a moderator help me, please?
Again, I am sorry for the inconvenience.
Thanks for your comment, eduramiba!
-
- Posts:5
- Joined:22 Aug 2011 18:06 [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: Importing too few edges
Hi eduramiba,
Thanks for you comment. I already tried to change this gephi.conf file but it has not really changed anything. It seems to run forever and in the end I force close it.
It seems to take a long while to do the layouts even with small datasets like the Les Miserables example.
Freds
Thanks for you comment. I already tried to change this gephi.conf file but it has not really changed anything. It seems to run forever and in the end I force close it.
It seems to take a long while to do the layouts even with small datasets like the Les Miserables example.
Freds
- 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: Importing too few edges
Hi Freds,
No problem, I merged the posts into this topic and deleted the other.
No problem, I merged the posts into this topic and deleted the other.
- 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: Importing too few edges
There are layouts that don't stop themselves, like force atlas. Do you mean that?theFreds wrote:Hi eduramiba,
Thanks for you comment. I already tried to change this gephi.conf file but it has not really changed anything. It seems to run forever and in the end I force close it.
It seems to take a long while to do the layouts even with small datasets like the Les Miserables example.
Freds
You have to click stop when you are happy with the results.
Eduardo