{ "cells": [ { "cell_type": "markdown", "id": "controlling-agenda", "metadata": {}, "source": [ "# Quick Start - Mouse Brain" ] }, { "cell_type": "markdown", "id": "controlling-construction", "metadata": {}, "source": [ "[](https://colab.research.google.com/github/earmingol/scCellFie/blob/main/docs/source/notebooks/quick_start_mouse.ipynb)" ] }, { "cell_type": "markdown", "id": "extended-batch", "metadata": {}, "source": [ "In this tutorial, we will use the postnatal mouse brain dataset [(Hochgerner & Zeisel et al 2018)](https://doi.org/10.1038/s41593-017-0056-2) to explore the metabolic pathways in early development of dentate gyrus. This dataset captures the molecular progression of early neurogenesis and granule cell maturation across P24 and P35.\n", "\n", "Here we cover mainly basic visualizations of metabolic tasks. **For additional downstream analyses**, please visit our **Extended Tutorials**. A good starting point is our **[General Overview Tutorial](https://sccellfie.readthedocs.io/en/latest/notebooks/extended_quick_start.html)**, which will get you started with some downstream analyses." ] }, { "cell_type": "markdown", "id": "acute-arkansas", "metadata": {}, "source": [ "## This tutorial includes following steps:\n", "* [Loading libraries](#loading-libraries)\n", "* [Loading mouse brain data](#loading-mouse-brain-data)\n", "* [Run scCellFie](#run-sccellfie)\n", "* [Export results](#export-results)\n", "* [Visualization of results](#visualization-of-results)" ] }, { "cell_type": "markdown", "id": "environmental-independence", "metadata": {}, "source": [ "## Loading libraries " ] }, { "cell_type": "code", "execution_count": 1, "id": "excited-suspect", "metadata": {}, "outputs": [], "source": [ "import sccellfie\n", "import scanpy as sc\n", "import pandas as pd\n", "import numpy as np\n", "\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import glasbey\n", "\n", "import textwrap\n", "\n", "## To avoid warnings\n", "import warnings\n", "warnings.filterwarnings(\"ignore\")" ] }, { "cell_type": "markdown", "id": "bearing-burton", "metadata": {}, "source": [ "## Loading mouse brain data \n", "\n", "The Postnatal Dentate Gyrus dataset contains 2930 cells `(n_obs)` with 13913 genes `(n_vars)`.\n", "\n", "This is a processed data including 14 cell type annotations in `.obs['clusters']`, and 22 subclusters of cell type annotations in `.obs['clusters_enlarged']`. For demonstration purpose, this tutorial will use the `.obs['clusters']` cell labels." ] }, { "cell_type": "code", "execution_count": 2, "id": "varying-video", "metadata": {}, "outputs": [], "source": [ "adata = sc.read(filename='./data/MusMusculus_DentateGyrus.h5ad', \n", " backup_url='https://cell2fate.cog.sanger.ac.uk/DentateGyrus/DentateGyrus_anndata.h5ad')" ] }, { "cell_type": "code", "execution_count": 3, "id": "manual-segment", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "AnnData object with n_obs × n_vars = 2930 × 13913\n", " obs: 'clusters', 'age(days)', 'clusters_enlarged'\n", " uns: 'clusters_colors'\n", " obsm: 'X_umap'\n", " layers: 'ambiguous', 'spliced', 'unspliced'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "adata" ] }, { "cell_type": "markdown", "id": "thermal-fancy", "metadata": {}, "source": [ "
| Task | \n", "(R)-3-Hydroxybutanoate synthesis | \n", "3'-Phospho-5'-adenylyl sulfate synthesis | \n", "AMP salvage from adenine | \n", "ATP generation from glucose (hypoxic conditions) - glycolysis | \n", "Acetoacetate synthesis | \n", "Alanine degradation | \n", "Arachidonate degradation | \n", "Arachidonate synthesis | \n", "Arginine degradation | \n", "Aspartate degradation | \n", "... | \n", "Valine degradation | \n", "Valine to succinyl-coA | \n", "Vesicle secretion | \n", "beta-Alanine degradation | \n", "cis-vaccenic acid degradation | \n", "cis-vaccenic acid synthesis | \n", "gamma-Linolenate degradation | \n", "gamma-Linolenate synthesis | \n", "glyco-cholate synthesis | \n", "tauro-cholate synthesis | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Astrocytes | \n", "2.215738 | \n", "0.844881 | \n", "1.078215 | \n", "3.025266 | \n", "2.180813 | \n", "1.271653 | \n", "1.173559 | \n", "1.496051 | \n", "1.144285 | \n", "1.272288 | \n", "... | \n", "1.265002 | \n", "1.021153 | \n", "0.219967 | \n", "1.370236 | \n", "1.097025 | \n", "1.350242 | \n", "1.084651 | \n", "0.040205 | \n", "0.116810 | \n", "0.116810 | \n", "
| Cajal Retzius | \n", "2.152997 | \n", "0.762255 | \n", "0.781326 | \n", "3.233032 | \n", "2.278572 | \n", "1.226291 | \n", "1.332409 | \n", "1.605646 | \n", "1.107574 | \n", "1.223449 | \n", "... | \n", "1.218253 | \n", "0.700417 | \n", "0.364217 | \n", "1.276242 | \n", "1.245782 | \n", "1.538652 | \n", "1.222371 | \n", "0.003803 | \n", "0.052228 | \n", "0.052228 | \n", "
| Cck-Tox | \n", "2.604648 | \n", "0.632633 | \n", "1.476637 | \n", "4.123826 | \n", "2.710471 | \n", "1.091097 | \n", "1.159861 | \n", "1.626234 | \n", "1.000101 | \n", "1.072762 | \n", "... | \n", "1.083331 | \n", "0.490523 | \n", "0.449315 | \n", "1.130592 | \n", "1.060528 | \n", "1.566899 | \n", "1.065214 | \n", "0.002493 | \n", "0.033301 | \n", "0.033301 | \n", "
| Endothelial | \n", "1.596339 | \n", "0.316229 | \n", "1.305453 | \n", "2.109409 | \n", "1.701548 | \n", "0.802888 | \n", "1.031869 | \n", "1.064677 | \n", "0.717107 | \n", "0.819215 | \n", "... | \n", "0.805487 | \n", "0.462138 | \n", "0.518148 | \n", "0.805076 | \n", "0.955358 | \n", "1.003883 | \n", "0.955235 | \n", "0.003446 | \n", "0.071355 | \n", "0.071355 | \n", "
| GABA | \n", "2.415382 | \n", "0.105530 | \n", "2.512534 | \n", "3.490342 | \n", "2.442147 | \n", "1.150116 | \n", "1.228355 | \n", "1.754267 | \n", "1.109770 | \n", "1.148401 | \n", "... | \n", "1.150649 | \n", "0.500643 | \n", "0.513985 | \n", "1.215773 | \n", "1.116914 | \n", "1.625362 | \n", "1.133955 | \n", "0.023749 | \n", "0.042844 | \n", "0.042844 | \n", "
5 rows × 196 columns
\n", "| \n", " | metabolic_task | \n", "cell_type | \n", "scaled_trimean | \n", "
|---|---|---|---|
| 0 | \n", "(R)-3-Hydroxybutanoate synthesis | \n", "Astrocytes | \n", "0.770617 | \n", "
| 1 | \n", "3'-Phospho-5'-adenylyl sulfate synthesis | \n", "Astrocytes | \n", "0.490093 | \n", "
| 2 | \n", "AMP salvage from adenine | \n", "Astrocytes | \n", "0.288284 | \n", "
| 3 | \n", "ATP generation from glucose (hypoxic condition... | \n", "Astrocytes | \n", "0.615816 | \n", "
| 4 | \n", "Acetoacetate synthesis | \n", "Astrocytes | \n", "0.694958 | \n", "