{ "cells": [ { "cell_type": "markdown", "id": "e133670f", "metadata": {}, "source": [ "# Quick Start\n", "This guide gives you the essential steps to get started with CellDyc.\n" ] }, { "cell_type": "markdown", "id": "4bfba01c", "metadata": {}, "source": [ "## Import CellDyc" ] }, { "cell_type": "code", "execution_count": null, "id": "c3130531", "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "import celldyc as cdc" ] }, { "cell_type": "markdown", "id": "data-loading", "metadata": {}, "source": [ "## Load the Data\n", "Built‑in Dataset:" ] }, { "cell_type": "code", "execution_count": null, "id": "2e61ec42", "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "adata = cdc.datasets.celegans() # 3 sampling time points, 333 cells" ] }, { "cell_type": "markdown", "id": "5ae60e04", "metadata": {}, "source": [ "Your Own Dataset:" ] }, { "cell_type": "code", "execution_count": null, "id": "80834ff5", "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "import scanpy as sc\n", "adata = sc.read_h5ad(\"my_data.h5ad\") # requires .obs[\"time_point\"] with discrete time labels" ] }, { "cell_type": "markdown", "id": "preprocessing", "metadata": {}, "source": [ "## Preprocess the Data\n", "One-liner to filter, normalize, pick HVGs, run PCA, and build the neighbor graph:" ] }, { "cell_type": "code", "execution_count": null, "id": "fec7fcf8", "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "adata = cdc.tl.preprocess(adata)" ] }, { "cell_type": "markdown", "id": "reconstruction", "metadata": {}, "source": [ "## Estimation of Time Representation and Transcriptomic Velocity" ] }, { "cell_type": "code", "execution_count": null, "id": "90518002", "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "cdc.tl.recover_dyc(adata, time_key=\"time_point\")" ] }, { "cell_type": "markdown", "id": "29780199", "metadata": {}, "source": [ "**Outputs**\n", "- `adata.obs[\"getime\"]` – Continuous time representation (0‑1)\n", "- `adata.layers[\"velocity\"]` – Velocity matrix" ] }, { "cell_type": "markdown", "id": "visualization", "metadata": {}, "source": [ "**Visualization**\n", "- `cdc.pl.plot_velocity_projection(adata)` \n", "- `cdc.pl.getime_violin(adata, key_cont=\"getime\", key_cat=\"time_point\")` \n", "- ......" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.12.0" } }, "nbformat": 4, "nbformat_minor": 5 }