Skip to content

Commit

Permalink
Fix utils script for no owmeta
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Aug 28, 2024
1 parent 8684c05 commit c062d3c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions c302/c302_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,24 @@ def generate_conn_matrix(nml_doc, save_fig_dir=None, verbose=False, figsize=defa

all_cells = sorted(all_cells)

all_neurons = []
all_muscles = []
for c in all_cells:
if c302.is_muscle(c):
all_muscles.append(c)
else:
all_neurons.append(c)

try:
from owmeta_core.bundle import Bundle
with Bundle('openworm/owmeta-data', version=6) as bnd:
all_neuron_info, all_muscle_info = c302._get_cell_info(bnd, all_cells)
except Exception as e:
c302.print_('Unable to connect to owmeta bundle: %s' % e)
traceback.print_exc()
c302.print_('Unable to connect to the owmeta bundle: %s\n Proceeding anyway...' % e)
all_neuron_info = {n:('cell?','neuron_types?', 'receptor?', 'neurotransmitter?', n, 'color?') for n in all_neurons}
all_muscle_info = {m:('cell?','neuron_types?', 'receptor?', 'neurotransmitter?', m, 'color?') for m in all_muscles}


'''
if order_by_type:
Expand All @@ -478,13 +489,6 @@ def generate_conn_matrix(nml_doc, save_fig_dir=None, verbose=False, figsize=defa
print('Swapping %s with %s'%(all_neuron_info,ordered_all_neuron_info))
all_neuron_info = ordered_all_neuron_info'''

all_neurons = []
all_muscles = []
for c in all_cells:
if c302.is_muscle(c):
all_muscles.append(c)
else:
all_neurons.append(c)


data_exc_n = np.zeros((len(all_neurons),len(all_neurons)))
Expand Down

0 comments on commit c062d3c

Please sign in to comment.