{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Preprocessing Tutorial \n", "This tutorial focuses on how to utilize {mod}`dynamo` to preprocess data. In the new version, we make {class}`dynamo.pp.Preprocessor` class to allow you to freely explore different preprocessing recipes whose step parameters that can be configured inside {class}`dynamo.pp.Preprocessor`. Existing recipes in preprocessor includes monocle, pearson residual, seurat and sctransform. Moreover, you can replace each preprocessing step with your own implementation with ease. For instance, {class}`dynamo.pp.Preprocessor`'s monocle pipeline contains {meth}`dynamo.pp.filter_cells`, {meth}`dynamo.pp.filter_genes`, {meth}`dynamo.pp.normalize_cell_expr_by_size_factors`, {meth}`dynamo.pp.select_genes_by_pearson_residuals` and other steps. You can replace the implementation and default monocle parameters passed in to these functions by replacing or changing attributes of {class}`dynamo.pp.Preprocessor`.\n", "\n", "In older versions, {mod}`dynamo` offer several recipes, among which {func}`dynamo.pp.recipe_monocle` is a basic function as a building block of other recipes. You can still use these functions to preprocess data. \n", "\n", "{class}`dynamo.pp.Preprocessor` provides users with {meth}`dynamo.pp.Preprocessor.config_monocle_recipe` and other `config_*_recipes` methods to help you reproduce different preprocessor results and integrate with your newly developed preprocessing algorithms." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using already downloaded Arial font from: /tmp/dynamo_arial.ttf\n", "Registered custom font as: Arial\n", "\n", "\n", " ███ ████████ \n", "█████ █████ █████ █████ ███ █████ \n", " ██████ ██████ ██████ ████████ ████ \n", " ___ ████ ███\n", " | \\ _ _ _ _ __ _ _ __ ___ ███\n", " | |) | || | ' \\/ _` | ' \\/ _ \\█████ ███ \n", " |___/ \\_, |_||_\\__,_|_|_|_\\___/█████ ████ \n", " |__/ ███ █████ \n", "Tutorial: https://dynamo-release.readthedocs.io/ \n", " █████ \n", "\n" ] }, { "data": { "text/html": [ "
| package | \n", "umap-learn | \n", "typing-extensions | \n", "tqdm | \n", "statsmodels | \n", "setuptools | \n", "session-info | \n", "seaborn | \n", "scipy | \n", "requests | \n", "pynndescent | \n", "pre-commit | \n", "pandas | \n", "openpyxl | \n", "numdifftools | \n", "numba | \n", "networkx | \n", "mudata | \n", "matplotlib | \n", "loompy | \n", "leidenalg | \n", "igraph | \n", "dynamo-release | \n", "colorcet | \n", "anndata | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| version | \n", "0.5.7 | \n", "4.13.2 | \n", "4.67.1 | \n", "0.14.4 | \n", "79.0.0 | \n", "1.0.1 | \n", "0.13.2 | \n", "1.11.4 | \n", "2.32.3 | \n", "0.5.13 | \n", "4.2.0 | \n", "2.2.3 | \n", "3.1.5 | \n", "0.9.41 | \n", "0.60.0 | \n", "3.4.2 | \n", "0.3.1 | \n", "3.10.3 | \n", "3.0.8 | \n", "0.10.2 | \n", "0.11.8 | \n", "1.4.2rc1 | \n", "3.1.0 | \n", "0.11.4 | \n", "