iblatlas.connectivity.mesoscale

Functions

load

Reads in the regionalized mesoscale connectivity matrix.

load_hierarchy

Reads in the Harris et al. (2019) precomputed cortical/thalamic hierarchy scores.

load(folder_cache=None)[source]

Reads in the regionalized mesoscale connectivity matrix.

This is the Oh et al. (2014) / Knox et al. (2018) regularized-regression connectivity model – fit jointly across all injection experiments to statistically correct for injection-site overlap contamination, rather than a naive per-experiment average – regionalized onto 291 Allen “summary structures”.

Parameters:

folder_cache

Returns:

a tidy long dataframe (671_628, 9), one row per (source structure, hemisphere, target structure, metric), with columns:

  • source_structure_id / source_acronym: source (injection-side) structure

  • target_structure_id / target_acronym: target structure

  • hemisphere: ‘ipsi’ or ‘contra’ (relative to the source)

  • metric: one of ‘connection_strength’, ‘connection_density’, ‘normalized_connection_strength’, ‘normalized_connection_density’

  • value: metric value for this (source, hemisphere, target) triple

  • source_volume_mm3 / target_volume_mm3: single-hemisphere volume (mm^3) of the source/target structure, including descendants (e.g. layers)

Notes

Only connection_strength is additive across a re-parcellation (it is proportional to integrated axon volume): summing it within each new group, on both the source and target side, gives the exact value for that group – provided the new parcellation partitions the 291 summary structures with no overlap or gaps (true of any Allen ontology grouping, e.g. Beryl or Cosmos, via iblatlas.regions.BrainRegions.id2id). connection_density and the normalized metrics are ratios: re-derive them from the aggregated connection_strength and volumes at the new parcellation, rather than summing or averaging the ratio columns directly.

Example

Reaggregate onto the 10 Cosmos regions:

>>> from iblatlas.regions import BrainRegions
>>> br = BrainRegions()
>>> df = load()
>>> strength = df[df['metric'] == 'connection_strength'].copy()
>>> strength['source_cosmos'] = br.id2acronym(br.id2id(strength['source_structure_id'].values, mapping='Cosmos'))
>>> strength['target_cosmos'] = br.id2acronym(br.id2id(strength['target_structure_id'].values, mapping='Cosmos'))
>>> cosmos = strength.groupby(['source_cosmos', 'target_cosmos', 'hemisphere'])['value'].sum()
load_hierarchy(folder_cache=None)[source]

Reads in the Harris et al. (2019) precomputed cortical/thalamic hierarchy scores.

Parameters:

folder_cache

Returns:

a dataframe (122, 9), one row per (area, correction scheme), with columns: - correction: ‘cre_conf’ (Cre-line confidence weighted) or ‘no_conf’ (unweighted) - area: structure acronym (e.g. ‘VISp’), matching source_acronym / target_acronym

returned by load()

  • region_type: ‘C’ = cortex, ‘T’ = thalamus

  • cc_before / cc_iter: hierarchy score using cortico-cortical connections only, before/after iterative refinement

  • cctc_before / cctc_iter: + thalamo-cortical connections

  • cctcct_before / cctcct_iter: + cortico-thalamic connections (full model used in the paper)

Lower score = earlier/more feedforward in the hierarchy (e.g. VISp is near the bottom of the visual hierarchy); higher = later/more association-like.