Visualize Connection Statistics of CBGTC model

class analyseur.cbgtc.visual.connections.Conn(rootfolder=None, region_connections='ctx->bg')[source]

Bases: object

Use Cases

1. Pre-requisites

1.1. Import Modules

from analyseur.cbgtc.visual.connectiions import Conn

1.2. Assign path to data location

root_folder = "/path/to/data_folder/"

The root_folder is the CBGT data directory whose structure is shown below

.
├── BG/
│   ├── connection_list/
│   │   ├── scale=4_nbchannels=4/
│   │   │   └── model_9/
│   │   └── active_cortex_inputs_scale=4_nbchannels=4/
│   │       └── model_9/
│   └── ...
├── CORTEX/
│   ├── connection_list/
│   │   ├── Thalamus_inputs_nbpops=4/
│   │   └── nbpops=4/
│   └── ...
├── THALAMUS/
│   ├── connection_list/
│   │   ├── nbpops=4/
│   │   ├── BG_inputs_nbpops=4/
│   │   └── active_cortex_inputs_nbpops=4/
│   └── ...
├── ...
:

where

  • terminal folders in connection_list/ contains files connection_lists_i.dat and connection_lists_j.dat

1.3. Instantiate class object

Following the choice of desired connected regions

  • “CTX->CTX”

  • “CTX->BG”

  • “CTX->THAL”

  • “BG->THAL”

  • “THAL->CTX”

  • “BG->BG”

  • “THAL->THAL”

Note that tests abbreviations are not case-sensitive. Instantiate for “ctx->bg”

conn = Conn(rootfolder=root_folder, region_connections="ctx->bg")

# or simply
conn = Conn(root_folder, "ctx->bg")

2. Cases

For visualizing connection related stuffs invoke conn.<method_name> from the available options:

Method name

Obligatory argument

connections_bar_chart()

no argument is mandatory

overall_connections_bar_chart()

no argument is mandatory

global_stats()

no argument is mandatory

plot_connectivity_matrix()

string: “<nucleus>-><nucleus>”

plot_density()

string: “<nucleus>-><nucleus>”

plot_degree_distribution()

string: “<nucleus>-><nucleus>”

plot_all_density()

no argument is mandatory

plot_global_connectivity()

no argument is mandatory

plot_global_density()

no argument is mandatory

plot_channel_projection()

string: “<nucleus>-><nucleus>”

plot_all_channel_projections()

no argument is mandatory

plot_population_connectome()

no argument is mandatory


connections_bar_chart(show=True)[source]

Show summary of connections at population level

Source Region → Target Region Connectivity

Populations   Number of Connections
src  target
--------------------------------
R1a → R2a     ██████████████████████████
R1b → R2a     ████
R1a → R2b     ████
R1b → R2c     █
R1b → R2b     ▏

global_stats()[source]

Returns connection statistics for each population connection pair:

  • total connections

  • number of cortex neurons

  • number of basal ganglia neurons

  • convergence

  • divergence


overall_connections_bar_chart(show=True)[source]

Compare connection patterns across all populations

Source Region → Target Region Connectivity

Total Connections
R1a→R2a █████████████████████████████████████████
R1a→R2b ██
R1b→R2a ██
R1b→R2c ▏
R1b→R2b ▏

Unique Neurons
Cortex:        R1a→R2a ████████  R1a→R2b ███████  R1b→R2a ███████
BasalGanglia:  R1a→R2a ██████████████████████████  R1b→R2a ████████

Avg Convergence (BG neurons)
R1a→R2a █████████████████
R1a→R2b █████████████
R1b→R2c █████

Avg Divergence (Cortex neurons)
R1a→R2a █████████████████████████████████████
R1a→R2b ██
R1b→R2a ██

plot_all_channel_projections(n_channels=None)[source]

Show channel-projection map for all population pairs using plot_channel_projection()


plot_all_connectivity_matrices(show=True)[source]

Shows all the projection patterns.

Source → Target connectivity

Target
│
│        ████
│      ████
│    ████
│  ████
└──────────────── Source

plot_all_density(bins=100, show=True)[source]

Shows connection density patterns for all source region nucleus to target region nucleus.

Projection Density: Source Region → Target

Target neurons
↑
│   [::::***:::#:]
│        [:::**:*::]
│             [::*:#::*]
│                  [::**:#::]
│
└────────────────────────────────→ Source neurons

plot_channel_projection(pair_name, n_channels=None, show=True)[source]

Show channel-projection map for desired population pair as diagonal channel blocks.

       Target channels
        0   1   2   3
Sx 0    ██
Sx 1        ██
Sx 2            ██
Sx 3                ██

Patterns References:

Focused connectivity

█
  █
    █
      █

Diffuse connectivity

████
████
████

Surround inhibition

 █
███
 █

Channel crosstalk

█ █
 █ █

plot_connectivity_matrix(pair_name, show=True)[source]

Plot connection matrix for a <source nucleus>-><target nucleus> (e.g PTN->MSN)

Target neuron index
↑
│ 42000 ┤                             ███████████████
│       │                             ███████████████
│ 32000 ┤              ███████████████
│       │              ███████████████
│ 21000 ┤      ███████████████
│       │      ███████████████
│ 10000 ┤██████████████
│       │██████████████
│     0 └──────────────────────────────────────────→ Source neuron index
        0      2000      4000      6000      8000

plot_degree_distribution(pair_name, show=True)[source]

Plot convergence and divergence patterns for a <Source nucleus>-><Target nucleus> (e.g PTN->MSN)

Source divergence
1 ███████████████████████████████████
2 ███████████████████
3 █████████
4 ███
5 █
6 ▏
7 ▏

Target convergence
1 █████████████████████████████████████████████████
2 ▏
3 ▏
4 ▏

plot_density(pair_name, bins=100, show=True)[source]

Plot density heatmap for a <Source nucleus>-><Target nucleus> (e.g PTN->MSN)

Basal Ganglia neurons
↑

16000 |                           :##::*:*:#*
14000 |                           **:#*::*:#:

12000 |               :*#*::*:#*:
10000 |               :*#::*:#*#:

 8000 |      *:#*#::*#:
 6000 |      :##::*:*#*

 4000 | *:#*::*:#:
 2000 | :*#::*:#*

      ----------------------------------------------------→ Cortex neurons
        0      2000      4000      6000      8000

plot_global_connectivity(n_channels=None, band_height=2000, density_contours=False)[source]

Shows global connectivity scatter plot with channel boundaries.

Target neurons
↑
|----|----|----|----|
| ██ |    |    |    |
|----|----|----|----|
|    | ██ |    |    |
|----|----|----|----|
|    |    | ██ |    |
                    → Source neurons

plot_global_density(bins=150, show=True)[source]

Connectome-style plot.

Source → Target projection density

Target
│      ░▓█
│    ░▓█
│  ░▓█
│░▓█
└──────── Source

Legend:

█ very high
▓ high
▒ medium
░ low
zero

plot_population_connectome(show=True)[source]

Displays model connectivity as a connectome diagram.

  Cortex
  //   \
CSN     PTN
  \   //
  Striatum
  //   \
FSI     MSN