|
45 | 45 |
|
46 | 46 | ca_dynamics = {} |
47 | 47 |
|
48 | | -print("Parsing cell dirs: %s" % cell_dirs) |
| 48 | +print("PA >> Parsing cell dirs: %s" % cell_dirs) |
49 | 49 |
|
50 | 50 | for model_id in cell_dirs: |
51 | 51 |
|
|
65 | 65 |
|
66 | 66 | # configure NEURON |
67 | 67 | if all_active: |
68 | | - continue # skip this... |
| 68 | + #continue # skip this... |
69 | 69 | utils = AllActiveUtils(description, axon_type='stub') # all-active type |
70 | 70 | else: |
71 | 71 | #continue |
|
74 | 74 |
|
75 | 75 | h = utils.h |
76 | 76 |
|
77 | | - print("NEURON configured") |
| 77 | + print("PA >> NEURON configured") |
78 | 78 |
|
79 | 79 | # configure model |
80 | 80 | manifest = description.manifest |
|
87 | 87 | with open('metadata.json', "r") as json_file: |
88 | 88 | metadata_info = json.load(json_file) |
89 | 89 |
|
90 | | - print("Loaded manifest: %s (fit: %s)"%(manifest_info['biophys'][0]["model_type"], manifest_info['biophys'][0]["model_file"][1])) |
| 90 | + print("PA >> Loaded manifest: %s (fit: %s)"%(manifest_info['biophys'][0]["model_type"], manifest_info['biophys'][0]["model_file"][1])) |
91 | 91 |
|
92 | | - print("Cell loaded from: %s"%morphology_path) |
| 92 | + print("PA >> Cell loaded from: %s"%morphology_path) |
93 | 93 |
|
94 | 94 | h.finitialize() |
95 | 95 | h.psection() |
|
102 | 102 | nml_cell_loc = "%s/%s"%(nml2_cell_dir,nml_cell_file) |
103 | 103 |
|
104 | 104 |
|
105 | | - print(' > Exporting to %s'%(nml_net_loc)) |
| 105 | + print('PA >> Exporting to %s'%(nml_net_loc)) |
106 | 106 |
|
107 | 107 | export_to_neuroml2(None, |
108 | 108 | nml_net_loc, |
109 | 109 | separateCellFiles=True, |
110 | | - includeBiophysicalProperties=False) |
| 110 | + includeBiophysicalProperties=False, |
| 111 | + validate=False) |
111 | 112 |
|
112 | | - print(' > Exported to: %s and %s'%(nml_net_loc, nml_cell_loc)) |
| 113 | + print('PA >> Exported to: %s and %s'%(nml_net_loc, nml_cell_loc)) |
113 | 114 |
|
114 | 115 |
|
115 | 116 | clear_neuron() |
|
133 | 134 | p = neuroml.Property(tag=k, value=metadata_info[k]) |
134 | 135 | cell.properties.append(p) |
135 | 136 |
|
136 | | - print(' > Altering groups') |
| 137 | + print('PA >> Altering groups') |
137 | 138 |
|
138 | 139 | for sg in cell.morphology.segment_groups: |
139 | | - print("Found group: %s"%sg.id) |
| 140 | + print("PA >> Found group: %s"%sg.id) |
140 | 141 | if (sg.id.startswith('ModelViewParm')) and len(sg.members)==0: |
141 | 142 | replace = {} |
142 | 143 | replace['soma_'] = 'soma' |
|
282 | 283 |
|
283 | 284 | ''' |
284 | 285 | # @type ca_dynamics dict |
285 | | - print('Handling Ca dynamics: %s'%ca_dynamics) |
| 286 | + print('PA >> Handling Ca dynamics: %s'%ca_dynamics) |
286 | 287 | for key, values in ca_dynamics.items(): |
287 | 288 | if int(key) in ALL_ACTIVE_MODEL_IDS: |
288 | 289 | for segment, prop in values.items(): |
|
309 | 310 | cell.biophysical_properties = biophysical_properties |
310 | 311 |
|
311 | 312 |
|
312 | | - pynml.write_neuroml2_file(nml_doc, nml_cell_loc) |
| 313 | + print('PA >> Writing to: %s'%nml_cell_loc) |
| 314 | + pynml.write_neuroml2_file(nml_doc, nml_cell_loc, validate=False) |
313 | 315 |
|
314 | 316 |
|
315 | | - pynml.nml2_to_svg(nml_cell_loc) |
| 317 | + pynml.nml2_to_svg(nml_cell_loc, verbose=False) |
316 | 318 |
|
317 | 319 |
|
318 | 320 | pref_duration_ms = 2500 |
|
359 | 361 | input_list.input.append(input) |
360 | 362 | new_net.input_lists.append(input_list) |
361 | 363 |
|
362 | | - pynml.write_neuroml2_file(new_net_doc, new_net_loc) |
| 364 | + print('PA >> Writing to: %s'%new_net_loc) |
| 365 | + |
| 366 | + pynml.write_neuroml2_file(new_net_doc, new_net_loc, validate=False) |
363 | 367 |
|
364 | 368 | generate_lems_file_for_neuroml(model_id, |
365 | 369 | new_net_loc, |
|
386 | 390 | Z = ((count-1) -X) / width |
387 | 391 | inst.location = neuroml.Location(x=300*X, y=0, z=300*Z) |
388 | 392 |
|
| 393 | + print('PA >> Adding to network of all cells at: %s'%inst.location) |
| 394 | + |
389 | 395 |
|
390 | 396 | net_file = '%s/%s.net.nml'%(nml2_cell_dir,net_ref) |
391 | 397 | neuroml.writers.NeuroMLWriter.write(net_doc, net_file) |
392 | 398 |
|
393 | | -print("Written network with %i cells in network to: %s"%(count,net_file)) |
| 399 | +print("PA >> Written network with %i cells in network to: %s"%(count,net_file)) |
394 | 400 |
|
395 | | -pynml.nml2_to_svg(net_file) |
| 401 | +pynml.nml2_to_svg(net_file, verbose=False) |
396 | 402 |
|
397 | | -print("Finished parsing cell dirs: %s" % cell_dirs) |
| 403 | +print("PA >> Finished parsing cell dirs: %s" % cell_dirs) |
0 commit comments