Open KirstieJane opened 7 years ago
You may be able to just get rid of this section?
# Put the measures you care about together
# in a data frame
df = pd.DataFrame({ 'degree' : measure_dict['Degree_CT_covar_ones_all_COST_10'] ,
'module' : measure_dict['Module_CT_covar_ones_all_COST_10'],
'renum_module' : measure_dict['Renumbered_Module_CT_covar_ones_all_COST_10'],
'von_economo' : measure_dict['von_economo'],
'lobes' : measure_dict['lobes'],
'x' : measure_dict['centroids'][:,0],
'y' : measure_dict['centroids'][:,1],
'z' : measure_dict['centroids'][:,2]})
df['node'] = range(len(df['degree']))
Happy to use a different tool if it exists. I’ve never used circos.ca but those images look beautiful. The challenge is whether it’s easy to use? Easy to add the brain pics??
It's very lovely, but a three-weeker to install according to jessie
d3.js is a javascript library for creating figures. it can do quite alot, for example very nice circular layouts so it might be a good idea to make bnip interoperable with this
It does look nice! 😃 but I've never coded in java before, not sure how easy it is to pick up. It took me quite a long time picking up circos 😢 but we could certainly try :) thank you Isla!
Back in the day I wrote a little function called
plot_circular_network.py
and now @lzdh would like to use it to visualise her data.Inputs
A correlation matrix and a directory with brain images named in ascending numerical order (starting with
0000.png
).We'll also need to pass a threshold as we can't visualise ALL of these.
Output
A pretty picture of top X edges in a network with brain images around the outside representing the different nodes in the network.
What we already have
get_circular_layout
takes a graph (G
) and a data frame (df
) and returnspos_dict
,theta_dict
.theta_dict
: a list of polar angles from 0 that nodes should be plotted at (in degrees)pos_dict
: the x and y coordinates on a unit circle corresponding to the different anglesdf
can be removed from this function as it only needs the number of nodes and we could get that from the graph easily.plot_circular_network.py
plots the network and returns a figure.What we want
A circle with brains around the outside and some edges connecting these different nodes representing the network.
Stretch goals
[ ] Only visualise nodes that have significant edges. If a node doesn't have a single edge then to remove it from the visualisation.
[ ] Cluster these nodes first and then visualise them in a circle.