Skip to content
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

[KeepUpdating] Help to understand parameters #115

Open
2 tasks
wingedRuslan opened this issue Jun 4, 2019 · 2 comments
Open
2 tasks

[KeepUpdating] Help to understand parameters #115

wingedRuslan opened this issue Jun 4, 2019 · 2 comments
Assignees

Comments

@wingedRuslan
Copy link
Collaborator

  • 1) graph_measures/calculate_global_measures returns dics of average_clustering, average_shortest_path_length, assortativity, modularity, and efficiency of G , but the scripts/make_figures/plot_network_measures plots
       df = measure_dict
   
       df = df[['a', 'a_rand',
                'M', 'M_rand',
                'E', 'E_rand',
                'C', 'C_rand',
                'L', 'L_rand',
                'sigma', 'sigma_rand']]

What are these values 'a', 'M', 'E', 'C', 'L', 'sigma'?
I suppose 'E' - 'efficiency', 'M' - 'modularity' but others...

  • 2) scripts/make_figures/plot_sagittal_network
    What are the inputs G_edge, sagittal_pos, axial_pos?
def plot_sagittal_network(G,
                         G_edge,
                         sagittal_pos,
                         axial_pos,
                         integer_adjust=3,
                         fractional_adjust=2.5,
                         cmap_name='jet',
                         ax=None,
                         figure_name=None):

Also there is unresolved reference to sort_partition, this function is not defined within the project and is not available from networkx. So I just can't figure out why it is needed to calculate the number of modules

    # Compute the best partition based on the threshold you've specified in cost
    partition = community.best_partition(G)

    # Create a sorted list of communitites (modules) according to their average
    # Y coordinate (front to back)
    module_list = sort_partition(partition, axial_pos)

    # Display the number of modules
    size = np.float(len(module_list))
@KirstieJane
Copy link
Member

Thanks @wingedRuslan!!

This code comes from https://github.com/KirstieJane/NSPN_WhitakerVertes_PNAS2016 which is the code and data to reproduce "Adolescence is associated with genomically patterned consolidation of the hubs of the human brain connectome" (doi: 10.1073/pnas.1601745113).

You can read the application that funded @Islast to start the re-factoring work for this project at https://whitakerlab.github.io/resources/Mozilla-Science-Mini-Grant-June2017.

The supplementary materials for the PNAS paper (https://www.pnas.org/content/pnas/suppl/2016/07/21/1601745113.DCSupplemental/pnas.1601745113.sapp.pdf) contain a lot of useful information. Specifically the "Structural covariance and network analyses" section at the top of page 6 should answer some of your questions. Figure S6 is also quite useful.

  • a : assortativity
  • C: clustering
  • E: efficiency
  • L: shortest path
  • M: modularity
  • sigma: small world measure

This page is also really useful: https://sites.google.com/site/bctnet/measures/list. Some of this code has been translated into python, but networkx will also do quite a bit of the work for us!

Here's a link to the code (that hasn't been translated to the scona module yet) that explains how to get the different layout coordinates:

def get_anatomical_layouts(G):
. This wikipedia page looks ok: https://en.wikipedia.org/wiki/Anatomical_terms_of_neuroanatomy#Planes_and_axes, but this video might be interesting to watch too: https://www.youtube.com/watch?v=f_hxX_xvHQY.

G_edge is a copy of G but probably with a different threshold. If you show all the edges it looks super messy, so in the PNAS paper I used a 2% threshold: https://github.com/KirstieJane/NSPN_WhitakerVertes_PNAS2016/blob/5c9c46caf91768d4cadec2b24078b640f05d3d76/SCRIPTS/make_figures.py#L777

The sort_partition function came from here: https://github.com/KirstieJane/NSPN_CODE/blob/ba8ac4cf42b1aec76030ce67945d95a625107ff0/networkx_functions.py#L16 🙀 🙀 🙀 That one was really tough to search for 😭.

I hope this is useful!

@KirstieJane
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants