In [1]:
!python --version


Python 3.5.2 :: Anaconda custom (x86_64)

In [2]:
import json
from pprint import pprint

In [3]:
with open('data/goWOgenes.cyjs') as f:    
    tree = json.load(f)

In [4]:
tree.keys()

pprint(tree['elements']['nodes'][1])

nodes = tree['elements']['nodes']


{'data': {'AverageShortestPathLength': 17.18280147,
          'BetweennessCentrality': 0.00015342,
          'ClosenessCentrality': 0.05819773,
          'ClusteringCoefficient': 0.0,
          'Degree': 2,
          'Eccentricity': 26,
          'EdgeCount': 2,
          'Indegree': 1,
          'IsSingleNode': False,
          'NeighborhoodConnectivity': 2.0,
          'NumberOfDirectedEdges': 2,
          'NumberOfUndirectedEdges': 0,
          'Outdegree': 1,
          'PartnerOfMultiEdgedNodePairs': 0,
          'Radiality': 0.47797415,
          'SUID': 13097,
          'SelfLoops': 0,
          'Stress': 26070,
          'TopologicalCoefficient': 0.5,
          'id': '13097',
          'id_original': 'GO:0016973',
          'name': 'poly(A)+ mRNA export from nucleus',
          'namespace': 'biological_process',
          'selected': False,
          'shared_name': 'poly(A)+ mRNA export from nucleus',
          'type': ''},
 'position': {'x': 15274.211570440326, 'y': 12397.140132129309},
 'selected': False}

In [9]:
bc = map(lambda x : x['data']['BetweennessCentrality'], nodes)
cc = map(lambda x : x['data']['ClosenessCentrality'], nodes)

# print(min(bc))
print(max(bc))
# print(min(cc))
print(max(cc))


0.68912488
0.13639978