neuralib.atlas.cellatlas.core

class neuralib.atlas.cellatlas.core.CellAtlas[source]

CellAtlas(dataframe: polars.dataframe.frame.DataFrame)

dataframe: DataFrame

Example:

┌────────────────────────────────┬────────────────┬───────────┐
│ Brain region                   ┆ Volumes [mm^3] ┆ n_neurons │
│ ---                            ┆ ---            ┆ ---       │
│ str                            ┆ f64            ┆ i64       │
╞════════════════════════════════╪════════════════╪═══════════╡
│ Abducens nucleus               ┆ 0.015281       ┆ 1324      │
│ Accessory facial motor nucleus ┆ 0.013453       ┆ 497       │
│ Accessory olfactory bulb       ┆ 0.6880625      ┆ 189608    │
│ …                              ┆ …              ┆ …         │
│ Zona incerta                   ┆ 2.157641       ┆ 136765    │
│ posteromedial visual area      ┆ 1.2225625      ┆ 197643    │
└────────────────────────────────┴────────────────┴───────────┘
classmethod load_from_csv(file=None, ignore_cell_types_info=True, ignore_detail_info=True)[source]

Load/Download the csv file

Parameters:
  • file (Path | None) – filepath. If None, download from source paper

  • ignore_cell_types_info (bool) – ignore cell types information, only select neuron and volume foreach areas

  • ignore_detail_info (bool) – ignore information in brain subregion

Returns:

Return type:

Self

property brain_regions: list[str]

list of brain regions

__init__(dataframe)
Parameters:

dataframe (DataFrame)

Return type:

None

classmethod load_sync_allen_structure_tree(force_save=True)[source]

TODO ProS not found Based on cellatlas dataframe, create a sync used acronym header in allen struct_tree (sorted by name)

fields

name: Brain region found in cellatlas

n_neurons: n_neurons from cellatlas dataframe

acronym: acronym found in the structure_tree csv

Parameters:

force_save (bool) – create sync file every time in root directory

Returns:

sync_dataframe example:

┌────────────────────────────────┬────────────────┬───────────┬─────────┐
│ name                           ┆ Volumes [mm^3] ┆ n_neurons ┆ acronym │
│ ---                            ┆ ---            ┆ ---       ┆ ---     │
│ str                            ┆ f64            ┆ i64       ┆ str     │
╞════════════════════════════════╪════════════════╪═══════════╪═════════╡
│ Abducens nucleus               ┆ 0.015281       ┆ 1324      ┆ VI      │
│ Agranular insular area         ┆ 4.901734       ┆ 242362    ┆ AI      │
│ …                              ┆ …              ┆ …         ┆ …       │
│ Visual areas                   ┆ 12.957203      ┆ 1297194   ┆ VIS     │
│ Zona incerta                   ┆ 2.157641       ┆ 136765    ┆ ZI      │
│ posteromedial visual area      ┆ 1.2225625      ┆ 197643    ┆ VISpm   │
└────────────────────────────────┴────────────────┴───────────┴─────────┘

Return type:

DataFrame