WhitakerLab / scona

Code to analyse structural covariance brain networks using python.
https://whitakerlab.github.io/scona/
MIT License
68 stars 33 forks source link

a line of code does not seem effective #85

Open zuxfoucault opened 6 years ago

zuxfoucault commented 6 years ago

This probably not a bug but cause me a bit confused.

d['weight'] = 1

https://github.com/WhitakerLab/scona/blob/master/BrainNetworksInPython/scripts/make_graphs.py#L384 it doesn't seem to have any influence on subsequent executions?

Islast commented 6 years ago

This is a good point and ought to be addressed by some in code comment, which I will do. The answer to this is that the community module raises an error if it receives edges with non binarised weights (e.g weights equal to anything other than 1 or 0). It is possible that after threshold your matrix you might choose to reassign the "weight" key to some other data, this line undoes that change to submit the network to the community detection algorithm. I think a better approach would be either to create a copy with edge weights equal to one (to avoid overwriting this new data) or to warn users not to reassign that key