From 34983717ce51dc6711fb1bbc3f61b851ce2949f1 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 13:10:48 +0200 Subject: [PATCH 01/40] :memo: update index --- docs/examples/index.md | 1 - docs/guides/index.md | 4 ++-- docs/notes/index.md | 5 +---- pytometry/__init__.py | 8 +++++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/examples/index.md b/docs/examples/index.md index 6e68683..0991814 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -9,5 +9,4 @@ The notebooks do **not** get executed in CI for testing because they involve lar :glob: :reversed: -* ``` diff --git a/docs/guides/index.md b/docs/guides/index.md index f673551..fc75860 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -1,9 +1,9 @@ # Guides -These are guides on specific problems. The notebooks get executed in CI for testing. +These are guides on specific problems. The notebooks are executed in CI for testing. ```{toctree} :maxdepth: 1 -curate-data + ``` diff --git a/docs/notes/index.md b/docs/notes/index.md index 62e29be..bc98e23 100644 --- a/docs/notes/index.md +++ b/docs/notes/index.md @@ -1,13 +1,10 @@ # Notes -These are any notes on design decisions, prototypes, background that don't make it into the package. - -They can be the material for a blog post or paper later on! +These are any notes on design decisions, prototypes, background that do not make it into the package. ```{toctree} :maxdepth: 1 :glob: :reversed: -* ``` diff --git a/pytometry/__init__.py b/pytometry/__init__.py index 7cdf4e4..08b732a 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -9,8 +9,9 @@ .. autosummary:: :toctree: . - example_function - ExampleClass + io.read_fcs + pp.compensate + """ __version__ = "0.0.1" # denote a pre-release for 0.1.0 with 0.1a1 @@ -18,4 +19,5 @@ from . import preprocessing as pp from . import read_write as io from . import tools as tl -from ._core import ExampleClass, example_function # noqa + +# from ._core import ExampleClass, example_function # noqa From 0cba7107bfddd1241f4baa5a7e9966ea54a59436 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 13:16:08 +0200 Subject: [PATCH 02/40] :fire: remove test for example --- tests/test_base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_base.py b/tests/test_base.py index b5f16c6..29ab4cc 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,7 +1,7 @@ -from pytometry import ExampleClass, example_function +# from pytometry import ExampleClass, example_function -def test_dummy(): - assert example_function("A") == "a" - ex = ExampleClass(1) - assert ex.bar() == "hello" +# def test_dummy(): +# assert example_function("A") == "a" +# ex = ExampleClass(1) +# assert ex.bar() == "hello" From bf50137daf8bc4321c2ff519a15704ad69a93e32 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 13:27:43 +0200 Subject: [PATCH 03/40] :memo: update quickstart --- docs/tutorials/quickstart.ipynb | 47 ++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/quickstart.ipynb b/docs/tutorials/quickstart.ipynb index e73de3a..35e0bf9 100644 --- a/docs/tutorials/quickstart.ipynb +++ b/docs/tutorials/quickstart.ipynb @@ -15,7 +15,17 @@ "metadata": {}, "outputs": [], "source": [ - "from pytometry import ExampleClass, example_function" + "import pytometry as pm\n", + "import readfcs\n", + "import anndata" + ] + }, + { + "cell_type": "markdown", + "id": "e40e3302", + "metadata": {}, + "source": [ + "Read fcs file example from the `readfcs` package." ] }, { @@ -25,7 +35,9 @@ "metadata": {}, "outputs": [], "source": [ - "example_function(\"A\")" + "from urllib.request import urlretrieve\n", + "\n", + "path_data, _ = urlretrieve(readfcs.datasets.example(), \"example.fcs\")" ] }, { @@ -35,7 +47,25 @@ "metadata": {}, "outputs": [], "source": [ - "ex = ExampleClass(1)" + "adata = pm.io.read_fcs(path_data)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d571a05", + "metadata": {}, + "outputs": [], + "source": [ + "assert isinstance(adata, anndata._core.anndata.AnnData)" + ] + }, + { + "cell_type": "markdown", + "id": "995de332", + "metadata": {}, + "source": [ + "Save data to `HDF5` file format." ] }, { @@ -45,13 +75,13 @@ "metadata": {}, "outputs": [], "source": [ - "assert ex.bar() == \"hello\"" + "adata.write(\"example.h5ad\")" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.9.7 ('pyto_dev')", "language": "python", "name": "python3" }, @@ -65,7 +95,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.9.7" + }, + "vscode": { + "interpreter": { + "hash": "48c3c4927e81daf79217bae0bb1c93e3ab00a11990990ff2e155253980f357b0" + } } }, "nbformat": 4, From e51ca125eda2154552057ce8074525e062e7c241 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 13:28:22 +0200 Subject: [PATCH 04/40] :white_check_mark: Test read function --- tests/test_base.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_base.py b/tests/test_base.py index 29ab4cc..ed61f0d 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,4 +1,15 @@ -# from pytometry import ExampleClass, example_function +import anndata +import readfcs + +from pytometry.read_write import read_fcs + + +def test_read_fcs(): + from urllib.request import urlretrieve + + path_data, _ = urlretrieve(readfcs.datasets.example(), "example.fcs") + adata = read_fcs(path_data) + assert isinstance(adata, anndata._core.anndata.AnnData) # def test_dummy(): From c7c56bff7363491196132b9a55904953a0db22e2 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 13:29:05 +0200 Subject: [PATCH 05/40] :see_no_evil: update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b5aee9a..2b4d77f 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,4 @@ docs/conf.py # data docs/tutorials/*.fcs +docs/tutorials/*.h5ad From 168628a76993a156f0322403dcbd4947c81f654d Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 14:25:49 +0200 Subject: [PATCH 06/40] :white_check_mark: modify test --- tests/test_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_base.py b/tests/test_base.py index ed61f0d..7b419e2 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,14 +1,15 @@ import anndata import readfcs -from pytometry.read_write import read_fcs +# from pytometry.read_write import read_fcs +import pytometry as pm def test_read_fcs(): from urllib.request import urlretrieve path_data, _ = urlretrieve(readfcs.datasets.example(), "example.fcs") - adata = read_fcs(path_data) + adata = pm.io.read_fcs(path_data) assert isinstance(adata, anndata._core.anndata.AnnData) From 76cdc04364ca2f836c5f13c0eaed74556ca8afab Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 14:35:33 +0200 Subject: [PATCH 07/40] :memo: update refs --- pytometry/__init__.py | 4 ++-- tests/test_base.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index 08b732a..ad354d6 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -9,8 +9,8 @@ .. autosummary:: :toctree: . - io.read_fcs - pp.compensate + pytometry.read_write.read_fcs + pytometry.preprocessing.compensate """ diff --git a/tests/test_base.py b/tests/test_base.py index 7b419e2..ed61f0d 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,15 +1,14 @@ import anndata import readfcs -# from pytometry.read_write import read_fcs -import pytometry as pm +from pytometry.read_write import read_fcs def test_read_fcs(): from urllib.request import urlretrieve path_data, _ = urlretrieve(readfcs.datasets.example(), "example.fcs") - adata = pm.io.read_fcs(path_data) + adata = read_fcs(path_data) assert isinstance(adata, anndata._core.anndata.AnnData) From 40b6e8efdd9286e1b31bea431fa378f31677885b Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 15:57:06 +0200 Subject: [PATCH 08/40] :memo: strip docs --- pytometry/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index ad354d6..ea7e77b 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -9,8 +9,6 @@ .. autosummary:: :toctree: . - pytometry.read_write.read_fcs - pytometry.preprocessing.compensate """ From a97889f9142bd74a0ed3705770c9c740a0d9e81b Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 16:03:05 +0200 Subject: [PATCH 09/40] :fire: remove example notebooks --- docs/examples/YYYY-MM-DD-task-slug.ipynb | 43 ------------------ docs/guides/curate-data.ipynb | 55 ------------------------ 2 files changed, 98 deletions(-) delete mode 100644 docs/examples/YYYY-MM-DD-task-slug.ipynb delete mode 100644 docs/guides/curate-data.ipynb diff --git a/docs/examples/YYYY-MM-DD-task-slug.ipynb b/docs/examples/YYYY-MM-DD-task-slug.ipynb deleted file mode 100644 index e43c6d8..0000000 --- a/docs/examples/YYYY-MM-DD-task-slug.ipynb +++ /dev/null @@ -1,43 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "1d7b3b73-75f9-468d-8783-873ebadcab9b", - "metadata": {}, - "source": [ - "# My task description" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "97ec6631-8473-4a2d-b488-def921bb83de", - "metadata": {}, - "outputs": [], - "source": [ - "from nbproject import header" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.9.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/docs/guides/curate-data.ipynb b/docs/guides/curate-data.ipynb deleted file mode 100644 index 38c8413..0000000 --- a/docs/guides/curate-data.ipynb +++ /dev/null @@ -1,55 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "0a9571ac-9c68-437f-ba51-95d06e283cac", - "metadata": {}, - "source": [ - "# How to curate data" - ] - }, - { - "cell_type": "markdown", - "id": "0abfc3c7", - "metadata": {}, - "source": [ - "```{note}\n", - "Any guide notebook is automatically run for testing! If a cell fails, the tests will fail! Try changing the assert statement below to observe.\n", - "\n", - "Note that task notebooks are neither tested, nor being built!\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bcc0c374-0224-4935-b862-0b013c624375", - "metadata": {}, - "outputs": [], - "source": [ - "assert 1 == 1" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.9.12" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From 2593829b1ad7486614271d9552cff3d246e6b778 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 16:15:54 +0200 Subject: [PATCH 10/40] :fire: more cleanup --- docs/notes/YYYY-MM-DD-my-design-choice.ipynb | 43 -------------------- 1 file changed, 43 deletions(-) delete mode 100644 docs/notes/YYYY-MM-DD-my-design-choice.ipynb diff --git a/docs/notes/YYYY-MM-DD-my-design-choice.ipynb b/docs/notes/YYYY-MM-DD-my-design-choice.ipynb deleted file mode 100644 index 1ad4b0d..0000000 --- a/docs/notes/YYYY-MM-DD-my-design-choice.ipynb +++ /dev/null @@ -1,43 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "1d7b3b73-75f9-468d-8783-873ebadcab9b", - "metadata": {}, - "source": [ - "# My design choice" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "97ec6631-8473-4a2d-b488-def921bb83de", - "metadata": {}, - "outputs": [], - "source": [ - "from nbproject import header" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.9.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From e06074bf688e5cda2d9729bc73ab2a97657109eb Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 16:34:26 +0200 Subject: [PATCH 11/40] :memo: add doc --- pytometry/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index ea7e77b..d029d58 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -7,8 +7,10 @@ This is the complete API reference: .. autosummary:: + :recursive: :toctree: . + read_write.read_fcs """ From bdc7c80f47dfd8c87027f60aee7addf33437e72b Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 16:45:14 +0200 Subject: [PATCH 12/40] :memo: update dependency --- pytometry/read_write/_readfcs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytometry/read_write/_readfcs.py b/pytometry/read_write/_readfcs.py index a07f255..9cc36e6 100644 --- a/pytometry/read_write/_readfcs.py +++ b/pytometry/read_write/_readfcs.py @@ -1,9 +1,10 @@ from pathlib import PosixPath import readfcs +from anndata import AnnData -def read_fcs(path: str): +def read_fcs(path: str) -> AnnData: """Read FCS file and convert into anndata format. Args: From b0f2a6301b497202c5fdf313762ce5ea1f1eadad Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 16:52:55 +0200 Subject: [PATCH 13/40] :memo: more fixes --- pytometry/read_write/_readfcs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pytometry/read_write/_readfcs.py b/pytometry/read_write/_readfcs.py index 9cc36e6..a697a05 100644 --- a/pytometry/read_write/_readfcs.py +++ b/pytometry/read_write/_readfcs.py @@ -1,10 +1,10 @@ from pathlib import PosixPath +import anndata as ad import readfcs -from anndata import AnnData -def read_fcs(path: str) -> AnnData: +def read_fcs(path: str) -> ad.AnnData: """Read FCS file and convert into anndata format. Args: @@ -12,7 +12,7 @@ def read_fcs(path: str) -> AnnData: location of fcs file to parse Returns: - adata: AnnData object of the fcs file + an AnnData object of the fcs file """ if isinstance(path, PosixPath): path = path.as_posix() From f721ea394f35e876b0599faee816f2fb6d9d361f Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 17:09:18 +0200 Subject: [PATCH 14/40] :memo: add return for all functions --- pytometry/preprocessing/_process_data.py | 18 ++++++++---------- pytometry/read_write/_readfcs.py | 6 +++--- pytometry/tools/_normalization.py | 14 ++++++++++---- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pytometry/preprocessing/_process_data.py b/pytometry/preprocessing/_process_data.py index aeed92b..7962642 100644 --- a/pytometry/preprocessing/_process_data.py +++ b/pytometry/preprocessing/_process_data.py @@ -1,11 +1,9 @@ -import math import re +from typing import Optional import numpy as np import pandas as pd import seaborn as sb - -# import FlowCytometryTools as fct from anndata import AnnData from matplotlib import pyplot as plt from matplotlib import rcParams @@ -16,7 +14,7 @@ # import os.path -def create_comp_mat(spillmat, relevant_data=""): +def create_comp_mat(spillmat, relevant_data="") -> pd.DataFrame: """Creates a compensation matrix from a spillover matrix. Args: @@ -25,7 +23,7 @@ def create_comp_mat(spillmat, relevant_data=""): Defaults to ''. Returns: - pd.DataFrame: Compensation matrix as pandas dataframe. + pd.DataFrame of the compensation matrix. """ if relevant_data == "": comp_mat = np.linalg.inv(spillmat) @@ -43,11 +41,11 @@ def find_indexes( key_added="signal_type", data_type="facs", copy: bool = False, -): +) -> Optional[AnnData]: """Find channels of interest for computing compensation. Args: - adata (AnnData): anndata object + adata (AnnData): AnnData object var_key (str, optional): key where to check if a feature is an area, height etc. type of value. Use `var_names` if None. key_added (str, optional): key where result vector is added to the adata.var. @@ -108,7 +106,7 @@ def compensate( comp_matrix=None, matrix_type="spillover", copy: bool = False, -): +) -> Optional[AnnData]: """Computes compensation for data channels. Args: @@ -186,7 +184,7 @@ def split_signal( option="area", data_type="facs", copy: bool = False, -): +) -> Optional[AnnData]: """Method to filter out height or area data. Args: @@ -290,7 +288,7 @@ def plotdata( number = len(names) columns = 3 - rows = math.ceil(number / columns) + rows = np.ceil(number / columns) fig = plt.figure() fig.subplots_adjust(hspace=0.4, wspace=0.6) diff --git a/pytometry/read_write/_readfcs.py b/pytometry/read_write/_readfcs.py index a697a05..e782cce 100644 --- a/pytometry/read_write/_readfcs.py +++ b/pytometry/read_write/_readfcs.py @@ -1,11 +1,11 @@ from pathlib import PosixPath -import anndata as ad import readfcs +from anndata import AnnData -def read_fcs(path: str) -> ad.AnnData: - """Read FCS file and convert into anndata format. +def read_fcs(path: str) -> AnnData: + """Read FCS file and convert into AnnData format. Args: path (str): path or Path diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 836ba27..3199acb 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -1,9 +1,13 @@ +from typing import Optional + import numpy as np from anndata import AnnData from scipy import interpolate -def normalize_arcsinh(adata: AnnData, cofactor: float, copy: bool = False): +def normalize_arcsinh( + adata: AnnData, cofactor: float, copy: bool = False +) -> Optional[AnnData]: """Inverse hyperbolic sine transformation. Args: @@ -24,7 +28,9 @@ def normalize_arcsinh(adata: AnnData, cofactor: float, copy: bool = False): return adata if copy else None -def normalize_logicle(adata: AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False): +def normalize_logicle( + adata: AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False +) -> Optional[AnnData]: """Logicle transformation. Logicle transformation, implemented as defined in the @@ -44,7 +50,7 @@ def normalize_logicle(adata: AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = Cytometry A., 2012:81A(4):273-277. Args: - :param adata: anndata object + :param adata: AnnData object :param t: parameter for the top of the linear scale (e.g. 262144) :param m: parameter for the number of decades the true @@ -282,7 +288,7 @@ def normalize_biExp( positive=4.418540, max_value=262144.000029, copy: bool = False, -): +) -> Optional[AnnData]: """Biexponential transformation. Biex transform as implemented in FlowJo 10. Adapted from FlowKit From 5ca8c4664dcee962b49f343b98cc5ea5eb98358b Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 17:13:34 +0200 Subject: [PATCH 15/40] :memo: add all functions to API --- pytometry/__init__.py | 6 ++++++ pytometry/preprocessing/_process_data.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index d029d58..16e9390 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -11,6 +11,12 @@ :toctree: . read_write.read_fcs + preprocess.split_signal + preprocess.compensate + preprocess.find_indexes + tools.normalize_arcsinh + tools.normalize_logicle + tools.normalize_biExp """ diff --git a/pytometry/preprocessing/_process_data.py b/pytometry/preprocessing/_process_data.py index 7962642..84eeeb5 100644 --- a/pytometry/preprocessing/_process_data.py +++ b/pytometry/preprocessing/_process_data.py @@ -14,7 +14,7 @@ # import os.path -def create_comp_mat(spillmat, relevant_data="") -> pd.DataFrame: +def create_comp_mat(spillmat: pd.DataFrame, relevant_data: str = "") -> pd.DataFrame: """Creates a compensation matrix from a spillover matrix. Args: From 7705791df64b156ff86303b2bc38b99493720cc4 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 17:19:26 +0200 Subject: [PATCH 16/40] :pencil2: fix typo --- pytometry/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index 16e9390..34d675f 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -11,9 +11,9 @@ :toctree: . read_write.read_fcs - preprocess.split_signal - preprocess.compensate - preprocess.find_indexes + preprocessing.split_signal + preprocessing.compensate + preprocessing.find_indexes tools.normalize_arcsinh tools.normalize_logicle tools.normalize_biExp From a3084972674273541b2c2aa256bdba80bf07f474 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 17:32:37 +0200 Subject: [PATCH 17/40] :pencil2: fix docu --- pytometry/tools/_normalization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 3199acb..4fc482e 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -335,11 +335,11 @@ def normalize_biExp( :param max_value: parameter for the top of the linear scale (default=262144) or pd.Series :param copy (bool, optional): Return a copy instead of writing to adata. - Defaults to False. + Defaults to False. Returns: Depending on `copy`, returns or updates `adata` in the following field - `adata.X` is then a normalised adata object + `adata.X` is then a normalised adata object """ # check inputs inputs = [negative, width, positive, max_value] From ba2f99c0edb14e4600ec32ba0815d738607b492b Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 17:46:13 +0200 Subject: [PATCH 18/40] :memo: fix docs --- pytometry/tools/_normalization.py | 82 ++++++++++++++++--------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 4fc482e..f361115 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -296,50 +296,52 @@ def normalize_biExp( is implemented, using lookup tables with only a limited set of parameter values. - Information on the input parameters from the FlowJo docs: - Adjusting width: - The value for w will determine the amount of channels to be - compressed into linear space around zero. The space of linear does - not change, but rather the number of channels or bins being - compressed into the linear space. Width should be set high enough - that all of the data in the histogram is visible on screen, but not - so high that extra white space is seen to the left hand side of your - dimmest distribution. For most practical uses, once all events have - been shifted off the axis and there is no more axis 'pile-up', then - the optimal width basis value has been reached. - Negative: - Another component in the biexponential transform calculation is the - negative decades or negative space. This is the only other value you - will probably ever need to adjust. In cases where a high width basis - may start compressing dim events into the negative cluster, you may - want to lower the width basis (less compression around zero) and - instead, increase the negative space by 0.5 - 1.0. Doing this will - expand the space around zero so the dim events are still visible, - but also expand the negative space to remove the cells from the axis - and allow you to see the full distribution. - Positive: - The presence of the positive decade adjustment is due to the - algorithm used for logicle transformation, but is not useful in - 99.9% of the cases that require adjusting the biexponential - transform. It may be appropriate to adjust this value only if you - use data that displays data with a data range greater than 5 decades. + Information on the input parameters from the FlowJo docs can be found in the + details section. Args: - :param adata: anndata object representing the FCS data - :param negative: Value for the FlowJo biex option 'negative' (float) - or pd.Series - :param width: Value for the FlowJo biex option 'width' (float) or - pd.Series - :param positive: Value for the FlowJo biex option 'positive' (float) - or pd.Series - :param max_value: parameter for the top of the linear scale - (default=262144) or pd.Series - :param copy (bool, optional): Return a copy instead of writing to adata. - Defaults to False. + adata (AnnData): AnnData object representing the FCS data + negative (float, optional): Value for the FlowJo biex option 'negative' (float) + or pd.Series. Defaults to 0.0. + width (float, optional): Value for the FlowJo biex option 'width' (float) or + pd.Series. Defaults to -10.0. + positive (float, optional): Value for the FlowJo biex option 'positive' (float) + or pd.Series. Defaults to 4.418540. + max_value (float, optional): parameter for the top of the linear scale + or pd.Series. Defaults to 262144.000029. + copy (bool, optional): Return a copy instead of writing to adata. + Defaults to False. Returns: - Depending on `copy`, returns or updates `adata` in the following field - `adata.X` is then a normalised adata object + Optional[AnnData]: Depending on `copy`, returns or updates `adata` in the + following field `adata.X` is then a normalised adata object + + Details: + Adjusting width: The value for `w` will determine the amount of channels to be + compressed into linear space around zero. The space of linear does + not change, but rather the number of channels or bins being + compressed into the linear space. Width should be set high enough + that all of the data in the histogram is visible on screen, but not + so high that extra white space is seen to the left hand side of your + dimmest distribution. For most practical uses, once all events have + been shifted off the axis and there is no more axis 'pile-up', then + the optimal width basis value has been reached. + Negative: + Another component in the biexponential transform calculation is the + negative decades or negative space. This is the only other value you + will probably ever need to adjust. In cases where a high width basis + may start compressing dim events into the negative cluster, you may + want to lower the width basis (less compression around zero) and + instead, increase the negative space by 0.5 - 1.0. Doing this will + expand the space around zero so the dim events are still visible, + but also expand the negative space to remove the cells from the axis + and allow you to see the full distribution. + Positive: + The presence of the positive decade adjustment is due to the + algorithm used for logicle transformation, but is not useful in + 99.9% of the cases that require adjusting the biexponential + transform. It may be appropriate to adjust this value only if you + use data that displays data with a data range greater than 5 decades. """ # check inputs inputs = [negative, width, positive, max_value] From 69ad3905d16fcd84016a90e53c6830878e36599f Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 17:54:43 +0200 Subject: [PATCH 19/40] :memo: Fix docs --- pytometry/tools/_normalization.py | 33 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index f361115..a80d68e 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -35,34 +35,37 @@ def normalize_logicle( Logicle transformation, implemented as defined in the GatingML 2.0 specification, adapted from FlowKit and Flowutils - Python packages: + Python packages. logicle(x, T, W, M, A) = root(B(y, T, W, M, A) - x) - where B is a modified bi-exponential function defined as: + where B is a modified bi-exponential function defined as B(y, T, W, M, A) = ae^(by) - ce^(-dy) - f The Logicle transformation was originally defined in the publication: - Moore WA and Parks DR. Update for the logicle data scale - including operational code implementations. - Cytometry A., 2012:81A(4):273-277. + Moore WA and Parks DR. Update for the logicle data scale + including operational code implementations. + Cytometry A., 2012:81A(4):273-277. Args: - :param adata: AnnData object - :param t: parameter for the top of the linear scale - (e.g. 262144) - :param m: parameter for the number of decades the true - logarithmic scale approaches at the high end of the scale - :param w: parameter for the approximate number of decades - in the linear region - :param a: parameter for the additional number of negative decades - :param copy (bool, optional): Return a copy instead of writing to adata. + adata (AnnData): AnnData object + t (int, optional): parameter for the top of the linear scale. + Defaults to 262144. + m (float, optional): parameter for the number of decades + the true logarithmic scale approaches at the high end of + the scale. Defaults to 4.5. + w (float, optional): parameter for the approximate number of + decades in the linear region. Defaults to 0.5. + a (float, optional): parameter for the additional number of + negative decades. Defaults to 0. + copy (bool, optional): Return a copy instead of writing to adata. Defaults to False. Returns: - Depending on `copy`, returns or updates `adata` in the following field + Optional[AnnData]: Depending on `copy`, returns or updates `adata` + in the following field `adata.X` is then a normalised adata object """ # initialise precision From e436d9730416125dce7ef78d98c839b72c8d3d75 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 18:00:10 +0200 Subject: [PATCH 20/40] :memo: indent fix --- pytometry/tools/_normalization.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index a80d68e..367bba1 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -20,8 +20,9 @@ def normalize_arcsinh( Defaults to False. Returns: - Depending on `copy`, returns or updates `adata` in the following field - `adata.X` is then a normalised adata object + Optional[AnnData]: Depending on `copy`, returns or updates `adata` + in the following field `adata.X` is then a normalised + adata object """ adata = adata.copy() if copy else adata adata.X = np.arcsinh(adata.X / cofactor) @@ -43,11 +44,11 @@ def normalize_logicle( B(y, T, W, M, A) = ae^(by) - ce^(-dy) - f - The Logicle transformation was originally defined in the publication: + The Logicle transformation was originally defined in the publication of - Moore WA and Parks DR. Update for the logicle data scale - including operational code implementations. - Cytometry A., 2012:81A(4):273-277. + Moore WA and Parks DR. Update for the logicle data scale + including operational code implementations. + Cytometry A., 2012:81A(4):273-277. Args: adata (AnnData): AnnData object @@ -65,8 +66,8 @@ def normalize_logicle( Returns: Optional[AnnData]: Depending on `copy`, returns or updates `adata` - in the following field - `adata.X` is then a normalised adata object + in the following field `adata.X` is then a normalised + adata object """ # initialise precision taylor_length = 16 From 2efd88ea1c8e0ac814dff6f2a2927a6218d3f7c1 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 18:04:19 +0200 Subject: [PATCH 21/40] :pencil2: typo --- pytometry/tools/_normalization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 367bba1..6bc8cb8 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -11,7 +11,7 @@ def normalize_arcsinh( """Inverse hyperbolic sine transformation. Args: - adata (AnnData): anndata object + adata (AnnData): AnnData object cofactor (float): all values are divided by this factor before arcsinh transformation recommended values for cyTOF data: 5 From b8fb8d612871803c0290c270406bb0a0c504b0f2 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 18:09:58 +0200 Subject: [PATCH 22/40] :memo: fix deps --- pytometry/tools/_normalization.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 6bc8cb8..decd71a 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -1,13 +1,13 @@ from typing import Optional +import anndata as ad import numpy as np -from anndata import AnnData from scipy import interpolate def normalize_arcsinh( - adata: AnnData, cofactor: float, copy: bool = False -) -> Optional[AnnData]: + adata: ad.AnnData, cofactor: float, copy: bool = False +) -> Optional[ad.AnnData]: """Inverse hyperbolic sine transformation. Args: @@ -20,7 +20,7 @@ def normalize_arcsinh( Defaults to False. Returns: - Optional[AnnData]: Depending on `copy`, returns or updates `adata` + Optional[ad.AnnData]: Depending on `copy`, returns or updates `adata` in the following field `adata.X` is then a normalised adata object """ @@ -30,8 +30,8 @@ def normalize_arcsinh( def normalize_logicle( - adata: AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False -) -> Optional[AnnData]: + adata: ad.AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False +) -> Optional[ad.AnnData]: """Logicle transformation. Logicle transformation, implemented as defined in the @@ -65,7 +65,7 @@ def normalize_logicle( Defaults to False. Returns: - Optional[AnnData]: Depending on `copy`, returns or updates `adata` + Optional[ad.AnnData]: Depending on `copy`, returns or updates `adata` in the following field `adata.X` is then a normalised adata object """ @@ -286,13 +286,13 @@ def _seriesBiexponential(p, value): def normalize_biExp( - adata: AnnData, + adata: ad.AnnData, negative=0.0, width=-10.0, positive=4.418540, max_value=262144.000029, copy: bool = False, -) -> Optional[AnnData]: +) -> Optional[ad.AnnData]: """Biexponential transformation. Biex transform as implemented in FlowJo 10. Adapted from FlowKit @@ -317,7 +317,7 @@ def normalize_biExp( Defaults to False. Returns: - Optional[AnnData]: Depending on `copy`, returns or updates `adata` in the + Optional[ad.AnnData]: Depending on `copy`, returns or updates `adata` in the following field `adata.X` is then a normalised adata object Details: From 0b382910bc69194a4067fb0fa0718e18cccb3f25 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Wed, 3 Aug 2022 18:30:48 +0200 Subject: [PATCH 23/40] :memo: reduce docs --- pytometry/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index 34d675f..1a13a34 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -14,9 +14,6 @@ preprocessing.split_signal preprocessing.compensate preprocessing.find_indexes - tools.normalize_arcsinh - tools.normalize_logicle - tools.normalize_biExp """ From 1b488a8af39f0d76c8d1e73972da24610262ff75 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 11:26:41 +0200 Subject: [PATCH 24/40] :memo: update docs for normalisation --- pytometry/tools/_normalization.py | 65 ++++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index decd71a..7c74671 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -1,26 +1,25 @@ from typing import Optional -import anndata as ad import numpy as np +from anndata import AnnData from scipy import interpolate def normalize_arcsinh( - adata: ad.AnnData, cofactor: float, copy: bool = False -) -> Optional[ad.AnnData]: + adata: AnnData, cofactor: float, copy: bool = False +) -> Optional[AnnData]: """Inverse hyperbolic sine transformation. Args: adata (AnnData): AnnData object cofactor (float): all values are divided by this - factor before arcsinh transformation - recommended values for cyTOF data: 5 - and for flow data: 150 + factor before arcsinh transformation recommended value for + cyTOF data is 5 and for flow data 150. copy (bool, optional): Return a copy instead of writing to adata. Defaults to False. Returns: - Optional[ad.AnnData]: Depending on `copy`, returns or updates `adata` + Optional[AnnData]: Depending on `copy`, returns or updates `adata` in the following field `adata.X` is then a normalised adata object """ @@ -30,26 +29,10 @@ def normalize_arcsinh( def normalize_logicle( - adata: ad.AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False -) -> Optional[ad.AnnData]: + adata: AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False +) -> Optional[AnnData]: """Logicle transformation. - Logicle transformation, implemented as defined in the - GatingML 2.0 specification, adapted from FlowKit and Flowutils - Python packages. - - logicle(x, T, W, M, A) = root(B(y, T, W, M, A) - x) - - where B is a modified bi-exponential function defined as - - B(y, T, W, M, A) = ae^(by) - ce^(-dy) - f - - The Logicle transformation was originally defined in the publication of - - Moore WA and Parks DR. Update for the logicle data scale - including operational code implementations. - Cytometry A., 2012:81A(4):273-277. - Args: adata (AnnData): AnnData object t (int, optional): parameter for the top of the linear scale. @@ -65,9 +48,27 @@ def normalize_logicle( Defaults to False. Returns: - Optional[ad.AnnData]: Depending on `copy`, returns or updates `adata` + Optional[AnnData]: Depending on `copy`, returns or updates `adata` in the following field `adata.X` is then a normalised adata object + + Details: + Logicle transformation, implemented as defined in the + GatingML 2.0 specification, adapted from FlowKit and Flowutils + Python packages. + + logicle(x, T, W, M, A) = root(B(y, T, W, M, A) - x) + + where B is a modified bi-exponential function defined as + + B(y, T, W, M, A) = ae^(by) - ce^(-dy) - f + + The Logicle transformation was originally defined in the + publication of + + Moore WA and Parks DR. Update for the logicle data scale + including operational code implementations. + Cytometry A., 2012:81A(4):273-277. """ # initialise precision taylor_length = 16 @@ -190,7 +191,7 @@ def _scale(value, p): return -1 -def _solve(b, w): +def _solve(b, w) -> float: """Helper function for biexponential transformation. Args: @@ -265,7 +266,7 @@ def _solve(b, w): return -1 -def _seriesBiexponential(p, value): +def _seriesBiexponential(p, value) -> float: """Helper function to compute biex trafo. Args: @@ -286,13 +287,13 @@ def _seriesBiexponential(p, value): def normalize_biExp( - adata: ad.AnnData, + adata: AnnData, negative=0.0, width=-10.0, positive=4.418540, max_value=262144.000029, copy: bool = False, -) -> Optional[ad.AnnData]: +) -> Optional[AnnData]: """Biexponential transformation. Biex transform as implemented in FlowJo 10. Adapted from FlowKit @@ -317,7 +318,7 @@ def normalize_biExp( Defaults to False. Returns: - Optional[ad.AnnData]: Depending on `copy`, returns or updates `adata` in the + Optional[AnnData]: Depending on `copy`, returns or updates `adata` in the following field `adata.X` is then a normalised adata object Details: @@ -487,7 +488,7 @@ def _generate_biex_lut( return positive, values -def _log_root(b, w): +def _log_root(b, w) -> float: """Helper function. Args: From 2fc5c217f31f12106030cbe94b48dd3ce5414793 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 12:24:58 +0200 Subject: [PATCH 25/40] :memo: update init --- pytometry/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytometry/__init__.py b/pytometry/__init__.py index 1a13a34..34d675f 100644 --- a/pytometry/__init__.py +++ b/pytometry/__init__.py @@ -14,6 +14,9 @@ preprocessing.split_signal preprocessing.compensate preprocessing.find_indexes + tools.normalize_arcsinh + tools.normalize_logicle + tools.normalize_biExp """ From 8a1b66f5e0856886c4fe543781bdbf6240875d74 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 13:37:14 +0200 Subject: [PATCH 26/40] :memo: fix docs --- pytometry/tools/_normalization.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 7c74671..a845b0e 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -29,13 +29,18 @@ def normalize_arcsinh( def normalize_logicle( - adata: AnnData, t=262144, m=4.5, w=0.5, a=0, copy: bool = False + adata, + t=262144, + m=4.5, + w=0.5, + a=0, + copy: bool = False, ) -> Optional[AnnData]: """Logicle transformation. Args: adata (AnnData): AnnData object - t (int, optional): parameter for the top of the linear scale. + t (float, optional): parameter for the top of the linear scale. Defaults to 262144. m (float, optional): parameter for the number of decades the true logarithmic scale approaches at the high end of @@ -123,7 +128,7 @@ def normalize_logicle( return adata if copy else None -def _scale(value, p): +def _scale(value, p) -> float: """Scale helper function. Args: From a7616a192a7b708ec4939a2cc36625372d654360 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 13:40:28 +0200 Subject: [PATCH 27/40] :memo: fix docs --- pytometry/tools/_normalization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index a845b0e..33174e3 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -35,7 +35,7 @@ def normalize_logicle( w=0.5, a=0, copy: bool = False, -) -> Optional[AnnData]: +): """Logicle transformation. Args: From a5fc2c0b159cc5e781b9eee90f6107589d339ad8 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 13:43:59 +0200 Subject: [PATCH 28/40] :memo: more fixes --- pytometry/tools/_normalization.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 33174e3..26308c6 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -5,9 +5,7 @@ from scipy import interpolate -def normalize_arcsinh( - adata: AnnData, cofactor: float, copy: bool = False -) -> Optional[AnnData]: +def normalize_arcsinh(adata, cofactor: float, copy: bool = False): """Inverse hyperbolic sine transformation. Args: From 6d5bc7a2dbeadb5becf9f63389f58c9cbe674976 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 13:47:00 +0200 Subject: [PATCH 29/40] :memo: no clue why it fails --- pytometry/tools/_normalization.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 26308c6..ea42416 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -9,7 +9,7 @@ def normalize_arcsinh(adata, cofactor: float, copy: bool = False): """Inverse hyperbolic sine transformation. Args: - adata (AnnData): AnnData object + adata : AnnData object cofactor (float): all values are divided by this factor before arcsinh transformation recommended value for cyTOF data is 5 and for flow data 150. @@ -17,9 +17,9 @@ def normalize_arcsinh(adata, cofactor: float, copy: bool = False): Defaults to False. Returns: - Optional[AnnData]: Depending on `copy`, returns or updates `adata` - in the following field `adata.X` is then a normalised - adata object + Depending on `copy`, returns or updates `adata` + in the following field `adata.X` is then a normalised + adata object """ adata = adata.copy() if copy else adata adata.X = np.arcsinh(adata.X / cofactor) From a9e869e76b0eb3c30ef53ce94e00ce6732bb9f33 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 13:53:08 +0200 Subject: [PATCH 30/40] :memo: remove anndata from docs --- pytometry/tools/_normalization.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index ea42416..6eb533f 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -1,11 +1,11 @@ -from typing import Optional +# from typing import Optional import numpy as np from anndata import AnnData from scipy import interpolate -def normalize_arcsinh(adata, cofactor: float, copy: bool = False): +def normalize_arcsinh(adata: AnnData, cofactor: float, copy: bool = False): """Inverse hyperbolic sine transformation. Args: @@ -290,13 +290,13 @@ def _seriesBiexponential(p, value) -> float: def normalize_biExp( - adata: AnnData, + adata, negative=0.0, width=-10.0, positive=4.418540, max_value=262144.000029, copy: bool = False, -) -> Optional[AnnData]: +): """Biexponential transformation. Biex transform as implemented in FlowJo 10. Adapted from FlowKit @@ -308,7 +308,7 @@ def normalize_biExp( details section. Args: - adata (AnnData): AnnData object representing the FCS data + adata: AnnData object representing the FCS data negative (float, optional): Value for the FlowJo biex option 'negative' (float) or pd.Series. Defaults to 0.0. width (float, optional): Value for the FlowJo biex option 'width' (float) or From afb7dc4d0630eff172c6025541b0ffa854b2c29f Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 13:58:22 +0200 Subject: [PATCH 31/40] :memo: more fixes --- pytometry/tools/_normalization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index 6eb533f..f858d1c 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -321,8 +321,8 @@ def normalize_biExp( Defaults to False. Returns: - Optional[AnnData]: Depending on `copy`, returns or updates `adata` in the - following field `adata.X` is then a normalised adata object + Depending on `copy`, returns or updates `adata` in the + following field `adata.X` is then a normalised adata object Details: Adjusting width: The value for `w` will determine the amount of channels to be From 6dd2fcdba7cf1c6cfa2e27877483e7d7c2b459ce Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 14:06:06 +0200 Subject: [PATCH 32/40] :memo: remove typing --- pytometry/tools/_normalization.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index f858d1c..3c66ea6 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -51,9 +51,9 @@ def normalize_logicle( Defaults to False. Returns: - Optional[AnnData]: Depending on `copy`, returns or updates `adata` - in the following field `adata.X` is then a normalised - adata object + Depending on `copy`, returns or updates `adata` + in the following field `adata.X` is then a normalised + adata object Details: Logicle transformation, implemented as defined in the From 13649f1d909fca161816a205dfd7a2786cf6ea26 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 17:40:04 +0200 Subject: [PATCH 33/40] :lipstick: add stars on readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 955df47..36059ae 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ +[![Stars](https://img.shields.io/github/stars/buettnerlab/pytometry?logo=GitHub&color=yellow)](https://github.com/buettnerlab/pytometry/stargazers) - Gitmoji +Gitmoji # Pytometry: Flow & mass cytometry analytics From fe44c4631ff4c82ceabf6d92b670dc3100def88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20B=C3=BCttner?= Date: Thu, 4 Aug 2022 18:20:03 +0200 Subject: [PATCH 34/40] :lipstick: add logo --- docs/logo.svg | 437 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 437 insertions(+) create mode 100644 docs/logo.svg diff --git a/docs/logo.svg b/docs/logo.svg new file mode 100644 index 0000000..d245a3f --- /dev/null +++ b/docs/logo.svg @@ -0,0 +1,437 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8f69f4ceda69e5d9c70842eb576cea0c38509a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20B=C3=BCttner?= Date: Thu, 4 Aug 2022 18:22:56 +0200 Subject: [PATCH 35/40] :fire: delete logo --- docs/logo.svg | 437 -------------------------------------------------- 1 file changed, 437 deletions(-) delete mode 100644 docs/logo.svg diff --git a/docs/logo.svg b/docs/logo.svg deleted file mode 100644 index d245a3f..0000000 --- a/docs/logo.svg +++ /dev/null @@ -1,437 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 5069222667bb3bad23402a419860c6573c0d9097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20B=C3=BCttner?= Date: Thu, 4 Aug 2022 18:24:22 +0200 Subject: [PATCH 36/40] :lipstick: change logo size --- docs/logo.svg | 436 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 436 insertions(+) create mode 100644 docs/logo.svg diff --git a/docs/logo.svg b/docs/logo.svg new file mode 100644 index 0000000..793c9cf --- /dev/null +++ b/docs/logo.svg @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f2b24ed378b13365ce37f70093c76eb3df146c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20B=C3=BCttner?= Date: Thu, 4 Aug 2022 18:27:35 +0200 Subject: [PATCH 37/40] change logo --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index d797951..213ab35 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,7 @@ } html_logo = ( - "https://raw.githubusercontent.com/laminlabs/lamin-profile/main/assets/logo.svg" + "https://raw.githubusercontent.com/buettnerlab/pytometry/docs/docs/logo.svg" ) html_favicon = "../lamin_sphinx/_static/img/favicon.ico" templates_path = ["_templates", "../lamin_sphinx/_templates"] From c28548259db8346964f783a4d7e2be0c9d1bd799 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 18:39:01 +0200 Subject: [PATCH 38/40] :see_no_evil: gitignore logo --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b4d77f..b5f423c 100644 --- a/.gitignore +++ b/.gitignore @@ -107,6 +107,7 @@ _build docs/pytometry.* lamin_sphinx docs/conf.py +docs/logo.svg # data docs/tutorials/*.fcs From b8e6056777d50165ba69d31334f8890969a22534 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 18:48:15 +0200 Subject: [PATCH 39/40] :truck: move logo --- .gitignore | 2 +- docs/{ => _static}/logo.svg | 872 ++++++++++++++++++------------------ docs/conf.py | 2 +- 3 files changed, 438 insertions(+), 438 deletions(-) rename docs/{ => _static}/logo.svg (98%) diff --git a/.gitignore b/.gitignore index b5f423c..ca7cf1f 100644 --- a/.gitignore +++ b/.gitignore @@ -107,7 +107,7 @@ _build docs/pytometry.* lamin_sphinx docs/conf.py -docs/logo.svg +docs/_static/logo.svg # data docs/tutorials/*.fcs diff --git a/docs/logo.svg b/docs/_static/logo.svg similarity index 98% rename from docs/logo.svg rename to docs/_static/logo.svg index 793c9cf..a73e655 100644 --- a/docs/logo.svg +++ b/docs/_static/logo.svg @@ -1,436 +1,436 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/conf.py b/docs/conf.py index 213ab35..9110f19 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,7 @@ } html_logo = ( - "https://raw.githubusercontent.com/buettnerlab/pytometry/docs/docs/logo.svg" + "https://raw.githubusercontent.com/buettnerlab/pytometry/docs/docs/_static/logo.svg" ) html_favicon = "../lamin_sphinx/_static/img/favicon.ico" templates_path = ["_templates", "../lamin_sphinx/_templates"] From 60693d25bead268892e1e5f00e2be4ca43afd771 Mon Sep 17 00:00:00 2001 From: mbuttner Date: Thu, 4 Aug 2022 18:57:48 +0200 Subject: [PATCH 40/40] :memo: change conv --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9110f19..be3634a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,7 @@ } html_logo = ( - "https://raw.githubusercontent.com/buettnerlab/pytometry/docs/docs/_static/logo.svg" + "https://raw.githubusercontent.com/buettnerlab/pytometry/main/_static/logo.svg" ) html_favicon = "../lamin_sphinx/_static/img/favicon.ico" templates_path = ["_templates", "../lamin_sphinx/_templates"]