-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recreate top two images in summary figure #122
Comments
@Islast Could you please elaborate on the idea of ordered nodes?
and later we use it here:
Just can not figure out by which criteria we are sorting. |
Hi @KirstieJane , Could you please explain what the parameter measure='module' to the
And then we pass measure to
And also how do we decide which color a node will have? (e.g. in the image above, nodes are displayed in 4 different colors) I thought that measure is one of the nodal measures we calculate for our nodes (like degree, closeness, betweenness ...). And my best guess was that color and measure is connected. Depending on the measure we select a color for a node. But does it mean that there will be as many colors as different measure for nodes? ps. I have already created the above mentioned images, but at this moment all nodes are "green" |
Hi @wingedRuslan!! This is so exciting that you can make the figures! Let me try to answer some of the questions (brushing off my memory hat from 3 years ago 😆) Ordered nodes (re: #122 (comment))
The short answer is, yes 😸 The nodes in a 2D image of the brain will overlap. For example when you're looking sideways at the brain (top left image) the nodes on the left and right sides will be on top of each other. The sorting in the code above says:
If this isn't clear @wingedRuslan, please let me know - it might be easiest to cover in the weekly call when I can point and explain things in person! measure='module' (re: #122 (comment))
Yes! Exactly. In the code above I've chosen to color each node according to the module in which it is allocated by the (Update: Looking at the code in scona/graph_measures.py#L279-L295 below, I think the answer is no 😄. But then I looked in scona/classes.py#L223-L241 and the class does calculate the module for each node. I've opened a new issue to see if we can document this better! #123) A few more notes on this function (which definitely needs more documentation, and can be found at scona/scona/scripts/make_figures.py Line 2697 in 38e5f31
I hope that's helpful! Let me know if not! |
Thank you @KirstieJane ! it is definitely helpful :) I still have a vague picture about ordered nodes. So yeah, looking forward to a weekly call, if I would not understand before by myself.
And speaking about measure='module', do we decide the color of a node based only on this measure, or we could pass any other measure? What I do not understand is that if we pass, let's say, measure=betweenness we will have as many colors as there are distinct values of measure. So we will have 300 different colors for 300 different measures of nodes(number of nodes 300). Is it okay? Cause I think it would be quite messy. |
I think in the case that you pass measure=betweenness you want a continuous cmap. I think the best way to handle this is to allow the user to specify which colourmap they want to use. |
@KirstieJane, what do you think about the produced figures for measure = "module" ? |
In this summary figure from the PNAS paper we have two lovely plots of the connectome. To recreate these we will need the following things:
N
these are stored atN.centroids
as a dict mapping nodes to (x,y,z) tuples.The original code used to do this is here and there is also a reimplementation of it here. It is possible that neither work, but hopefully they will guide you.
networkx.drawing
module.The code to create the original figure can be found here
I forget what the original colouring scheme for the nodes is. It may have been a data driven community analysis of the nodes (network communities can be accessed at
N.partition()
) or by some other scheme. Kirstie can let us know when she gets back, for now I think it's best to simply accept as an argument some dictionary mapping nodes to colours.Let me know if you have any concerns. Good luck and don't be afraid to ask questions!
The text was updated successfully, but these errors were encountered: