{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Matplotlib is building the font cache; this may take a moment.\n",
      "/Users/nickv/miniforge3/envs/index-nil-value-caption-long-lightbox-bug/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "scanpy==1.10.2 anndata==0.10.8 umap==0.5.5 numpy==2.0.0 scipy==1.14.0 pandas==2.2.2 scikit-learn==1.5.0 statsmodels==0.14.2 pynndescent==0.5.13\n"
     ]
    }
   ],
   "source": [
    "#| label: setup\n",
    "#| output: true\n",
    "import scanpy as sc\n",
    "from matplotlib.pyplot import rc_context\n",
    "sc.set_figure_params(dpi=100, color_map=\"viridis_r\")\n",
    "sc.settings.verbosity = 0\n",
    "sc.logging.print_header()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 700 × 765\n",
       "    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score', 'G2M_score', 'phase', 'louvain'\n",
       "    var: 'n_counts', 'means', 'dispersions', 'dispersions_norm', 'highly_variable'\n",
       "    uns: 'bulk_labels_colors', 'louvain', 'louvain_colors', 'neighbors', 'pca', 'rank_genes_groups'\n",
       "    obsm: 'X_pca', 'X_umap'\n",
       "    varm: 'PCs'\n",
       "    obsp: 'distances', 'connectivities'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pbmc = sc.datasets.pbmc68k_reduced()\n",
    "pbmc\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 73744 characters]",
      "text/plain": [
       "<Figure size 400x400 with 2 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 369,
       "width": 361
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#| label: fig-scatter-plot\n",
    "#| output: true\n",
    "# rc_context is used for the figure size, in this case 4x4\n",
    "with rc_context({\"figure.figsize\": (4, 4)}):\n",
    "    sc.pl.umap(pbmc, color=\"CD79A\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "index-nil-value-caption-long-lightbox-bug",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
