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

Calculate nodal measures (function) doesn't include the module partition (but class does?) #123

Open
KirstieJane opened this issue Jun 17, 2019 · 1 comment
Assignees

Comments

@KirstieJane
Copy link
Member

As part of calculating the participation coefficient of each node, we have to figure out the modular partition....so it makes sense to add it to the standard nodal measures calculated by calculate_nodal_measures function:

def calculate_nodal_measures(
G,
partition=None,
measure_list=None,
additional_measures=None,
force=True):
'''
Calculate and store nodal measures as nodal attributes.
By default `calculate_nodal_measures` calculates the following :
* "degree" : int
* "closeness" : float
* "betweenness" : float
* "shortest_path_length" : float
* "clustering" : float
* "participation_coefficient" : float

I'm a bit confused though, because in the calculate_nodal_measures class then the module is calculated:

scona/scona/classes.py

Lines 223 to 241 in b095326

def calculate_nodal_measures(
self,
force=False,
measure_list=None,
additional_measures=None):
'''
Calculate and store nodal measures as nodal attributes
which can be accessed directly, or using
:func:`BrainNetwork.report_nodal_measures()``
By default calculates:
* `betweenness` : float
* `closeness` : float
* `clustering` : float
* `degree` : int
* `module` : int
* `participation_coefficient` : float
* `shortest_path_length` : float

@Islast - you wrote these two sections. Is there a clear way of explaining the difference? Sorry for my misunderstanding. You're likely going to have to explain something about classes (I've never written them myself!) 😬

@Islast
Copy link
Collaborator

Islast commented Jun 17, 2019

There's not a terribly good reason for this.
The nodal partition is handled by a different function (scona.graph_measures.calc_nodal_partition).
I didn't include module partitioning in scona.graph_measures.calculate_nodal_measures because it is time consuming, however when we call scona.BrainNetwork.calculate_nodal_measures we immediately save the nodal partition so that we only have to calculate it once. In this second case I felt that this was not too time consuming however I now realise that this asymmetry is confusing.

Since nodal partition is an important nodal measure I propose changingscona.graph_measures.calculate_nodal_measures to by default call cal_nodal_partition with an option to suppress this to save time.

@Islast Islast self-assigned this Jun 17, 2019
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