From 9e839a2d6510fef1a50d6f90e40a236b29295e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20B=C3=BCttner?= Date: Wed, 22 May 2024 06:18:26 -0700 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20add=20pandas=202=20support?= =?UTF-8?q?=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :arrow_up: add pandas 2 support * :bento: run notebooks * :lipstick: reformat with precommit * :wrench: Move pandas down in deps * :wrench: remove version req from pandas * :lipstick: precommit run --------- Co-authored-by: buettnerm --- docs/tutorials/preprocessing.ipynb | 14 ++++++++++++-- docs/tutorials/quickstart.ipynb | 22 ++++++++++++++++++++-- pyproject.toml | 3 ++- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/preprocessing.ipynb b/docs/tutorials/preprocessing.ipynb index 79bbb40..e4429dc 100644 --- a/docs/tutorials/preprocessing.ipynb +++ b/docs/tutorials/preprocessing.ipynb @@ -187,7 +187,8 @@ "In the next step, we normalize the data. By default, normalization is an inplace operation, i.e. we only create a new anndata object, if we set the argument `inplace=False`. We demonstrate three different normalization methods that are build in `pytometry`:\n", "* arcsinh \n", "* logicle \n", - "* bi-exponential" + "* bi-exponential\n", + "* auto-logicle" ] }, { @@ -216,6 +217,15 @@ "source": [ "adata_biex = pm.tl.normalize_biExp(adata, inplace=False)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "adata_autologicle = pm.tl.normalize_autologicle(adata, inplace=False)" + ] } ], "metadata": { @@ -234,7 +244,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.9.19" }, "vscode": { "interpreter": { diff --git a/docs/tutorials/quickstart.ipynb b/docs/tutorials/quickstart.ipynb index 183f797..6119c58 100644 --- a/docs/tutorials/quickstart.ipynb +++ b/docs/tutorials/quickstart.ipynb @@ -18,7 +18,8 @@ "source": [ "import pytometry as pm\n", "import readfcs\n", - "import anndata" + "import anndata\n", + "from matplotlib import rcParams" ] }, { @@ -114,7 +115,16 @@ "metadata": {}, "outputs": [], "source": [ - "pm.pl.scatter_density(adata, x_lim=[-1, 2.7e5])" + "rcParams[\"figure.figsize\"] = (6, 5)\n", + "pm.pl.scatter_density(adata, x_lim=[-5e3, 2e5], y_lim=[-5e3, 2e5])" + ] + }, + { + "cell_type": "markdown", + "id": "29e11870", + "metadata": {}, + "source": [ + "Compensate with the compensation matrix that is deposited in the FCS file. The `compensate` function also accepts a custom compensation matrix. " ] }, { @@ -127,6 +137,14 @@ "pm.pp.compensate(adata)" ] }, + { + "cell_type": "markdown", + "id": "2200fd8d", + "metadata": {}, + "source": [ + "For normalization, `pytometry` provides several different approaches:" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/pyproject.toml b/pyproject.toml index de4dbab..f095819 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ requires-python = '>= 3.9' dependencies = [ "numpy>=1.20.0", "numba>=0.57", - "pandas<2.0.0,>=1.5.3", + "pandas", "anndata", "scanpy", "scipy", @@ -25,6 +25,7 @@ dependencies = [ "flowutils", "consensusclustering", "minisom" + ] [project.urls]