connectome_manipulator.model_building.pos_mapping_from_table

Module for building position mapping models based on pre-computed position tables

connectome_manipulator.model_building.pos_mapping_from_table.build(nrn_ids, coord_names, map_pos, model_coord_names=None, **_)[source]

Builds a position mapping model from data.

Parameters:
  • nrn_ids (list-like) – List of mapped neuron IDs, as returned by extract()

  • coord_names (list-like) – List of coordinate names of the mapped neuron positions table

  • map_pos (numpy.ndarray) – Mapped neuron positions table of size <#neurons x #coordinates>, as returned by extract()

  • model_coord_names (list-like) – Optional list of coordinate names that should be used in the resulting model

Returns:

Resulting position mapping model

Return type:

connectome_manipulator.model_building.model_types.PosMapModel

connectome_manipulator.model_building.pos_mapping_from_table.extract(circuit, pos_file, coord_names, coord_scale=None, nodes_pop_name=None, nodes_spec=None, zero_based_indexing=False, gid_column=None, CV_dict=None, **_)[source]

Loads pre-computed position mapping of a given nodes population.

Parameters:
  • circuit (bluepysnap.Circuit) – Input circuit

  • pos_file (str) – Position table file name of format .feather, containing a pandas DataFrame

  • coord_names (list-like) – List of mapped coordinate names which must be present as columns in the DataFrame

  • coord_scale (list-like) – List of scaling factors for all mapped coordinates

  • nodes_pop_name (str) – Name of SONATA nodes population to extract data from

  • nodes_spec (str/list-like/dict) – Selection of neurons to be include in the mapping model

  • zero_based_indexing (bool) – If selected, zero-based indexing of neuron IDs in the position table file is assumed (as in SONATA); otherwise, one-based indexing is assumed (for backward compatibility)

  • gid_column (str) – Name of a column in the position table which contains the neuron IDs; if not provideed, the index column will be used

  • CV_dict (dict) – Cross-validation dictionary - Not supported

Returns:

Dictionary containing the extracted data elements, i.e., neuron positions in original and mapped space

Return type:

dict

connectome_manipulator.model_building.pos_mapping_from_table.plot(out_dir, nrn_ids, nrn_pos, nrn_lay, model, **_)[source]

Visualizes neuron positions in original space vs. mapped space from model output.

Parameters:
  • out_dir (str) – Path to output directory where the results figures will be stored

  • nrn_ids (list-like) – List of mapped neuron IDs, as returned by extract()

  • nrn_pos (numpy.ndarray) – Table of original neuron positions in 3D atlas space of size <#neurons x 3>, as returned by extract()

  • nrn_lay (list-like) – List of layer property values for all mapped neurons, as returned by extract()

  • model (connectome_manipulator.model_building.model_types.PosMapModel) – Resulting position mapping model, as returned by build()

Note

Only mappings to 2D or 3D space are supported for visualization.