The Probabilistic Mapping Extension is a Python package designed to facilitate the creation and analysis of probabilistic maps for voxel-based datasets. It provides tools to download experimental data, compute probabilistic maps, and perform optional density transcriptions and visualizations.
- Download experimental data for mapping workflows.
- Compute probabilistic maps in a structured sequence of steps.
- Optional transcription and visualization of voxel densities.
- Override specific regions for custom analyses.
To install and use this package, follow these steps:
-
Clone the Repository
Clone the repository to your local machine:git clone https://github.com/YannRoussel/probabilistic_mapping_extention.git cd probabilistic_mapping_extention -
Install Dependencies
Install the required dependencies withpip:pip install -r requirements.txt
-
Set Up the Package
Install the package locally using:pip install .
Navigate to the experimental_data directory and run the scripts provided to download the necessary experimental data:
cd experimental_data
# Run the appropriate script(s)Sequentially execute the scripts in the probability_map directory:
-
Align T-types:
python t_type_alignement.py
-
Compute the probabilistic ME-T map:
python compute_p_me_t.py
-
Extend the ME-T map:
python extend_p_me_t.py
-
Transcribe T-types to ME-types
Use thedens_app/transcribe_t_types_to_me_types.ipynbJupyter notebook to convert T-type densities (from another package) into ME-type densities. -
Visualize Results
Visualize the results using the following notebooks:dens_app/Validation_compute_m_type_gene_expressions.ipynbdens_app/visualisation_multiproc.ipynb
Override certain ME-type densities using the special_region_override/densities_override.py script:
python special_region_override/densities_override.pyIn this folder, you can find an extended analysis of the m/e/me cell types.
-
In the
datafolder, we generated cell type–by–brain area matrices for easier access to the densities.- All files are
.csvfiles. We show how to access them in the notebook tutorials. - e-, m-, and me-types are kept separate, as suggested by the file names.
- Brain region naming follows the Allen Institute nomenclature. You can include unassigned regions by selecting the file that contains this in its file name.
all_celltypesmeans everything is combined into a single large file.
- All files are
-
In the
etypefolder, you can find generated figure insets for all (ephys) “electric types,” shown as cross-sections of generated axial or transversal example brain slices. These are located in:etype/fig_me_ax(axial)etype/fig_me_tr(sagittal)
The notebooks demonstrate how to generate and concatenate these figures.
-
In the
figuresfolder, you can find all m/e/me-type insets concatenated into composite images. The notebooks show how to generate these, including the brain slices as 2D arrays in.npyformat (not included here). -
In the
laminar_validationfolder, you can find code to generate cell type compositions plotted across different brain regions, along with the resulting images (inlaminar_validation/results). As an example, we plot excitatory and inhibitory m/e/me-types in the AUD, VISp, and SSs layers of the CTX. -
In the
me-typesfolder, you can find generated figure insets for all “morpho-electric types,” shown as cross-sections of generated axial or transversal example brain slices. These are located in:me-types/fig_me_ax(axial)me-types/fig_me_tr(sagittal)
The notebooks demonstrate how to generate and concatenate these figures.
-
In the
mtypesfolder, you can find generated figure insets for all “morphological types,” shown as cross-sections of generated axial or transversal example brain slices. These are located in:m-types/fig_me_ax(axial)m-types/fig_me_tr(sagittal)
The notebooks demonstrate how to generate and concatenate these figures.
-
The
notebooksfolder contains Jupyter notebook tutorials:compare_your_data.ipynb: Visualize any cell type in any brain slice together with your own data. This is the only notebook that usesipywidgets.create_all_celltype_df.ipynb: Intermediate step showing how to concatenate cell types intoall_celltypes_composition_with_unassigned_regions.csvin thedatafolder.e_type_slices_for_figure.ipynb: Generate.npyfiles (2D NumPy arrays) of brain slices with e-type densities.laminarity_structure_metypes.ipynb: Test code demonstrating laminar organization of me-types for validation. This notebook helps clarify the corresponding Python implementation.laminarity_structure_mtypes.ipynb: Test code demonstrating laminar organization of m-types for validation.m_type_slices_for_figure.ipynb: Generate.npyfiles (2D NumPy arrays) of brain slices with m-type densities.me_type_slices_for_figure.ipynb: Generate.npyfiles (2D NumPy arrays) of brain slices with me-type densities.transcribing_t_types.ipynb: Simplified version ofdensities_app/transcribe_t_types_to_me_types.ipynb, focusing only on the necessary steps and including instructions on saving.csvfiles in thedatafolder.visualisation_multiproc.ipynb: Simplified version ofdensities_app/visualisation_multiproc.ipynb, focusing only on the necessary steps.visualize_celltypes_supp_figures.ipynb: Notebook showing how to generate selected supplementary figures for the white paper. The resulting composite images are available in thefiguresfolder.
-
annotation_25_2022_CCFv3a.nrrd: All notebooks use this Common Coordinate Framework (from the Blue Brain Cell Atlas), which is a modified version of the Allen Institute’s CCFv3.
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b my-feature-branch
- Make your changes and commit them:
git commit -m "Add my feature" - Push to your branch:
git push origin my-feature-branch
- Open a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for more details.
Special thanks to all contributors and collaborators who helped bring this project to life!