Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3498371
:memo: update index
mbuttner Aug 3, 2022
0cba710
:fire: remove test for example
mbuttner Aug 3, 2022
bf50137
:memo: update quickstart
mbuttner Aug 3, 2022
e51ca12
:white_check_mark: Test read function
mbuttner Aug 3, 2022
c7c56bf
:see_no_evil: update gitignore
mbuttner Aug 3, 2022
168628a
:white_check_mark: modify test
mbuttner Aug 3, 2022
76cdc04
:memo: update refs
mbuttner Aug 3, 2022
40b6e8e
:memo: strip docs
mbuttner Aug 3, 2022
a97889f
:fire: remove example notebooks
mbuttner Aug 3, 2022
2593829
:fire: more cleanup
mbuttner Aug 3, 2022
e06074b
:memo: add doc
mbuttner Aug 3, 2022
bdc7c80
:memo: update dependency
mbuttner Aug 3, 2022
b0f2a63
:memo: more fixes
mbuttner Aug 3, 2022
f721ea3
:memo: add return for all functions
mbuttner Aug 3, 2022
5ca8c46
:memo: add all functions to API
mbuttner Aug 3, 2022
7705791
:pencil2: fix typo
mbuttner Aug 3, 2022
a308497
:pencil2: fix docu
mbuttner Aug 3, 2022
ba2f99c
:memo: fix docs
mbuttner Aug 3, 2022
69ad390
:memo: Fix docs
mbuttner Aug 3, 2022
e436d97
:memo: indent fix
mbuttner Aug 3, 2022
2efd88e
:pencil2: typo
mbuttner Aug 3, 2022
b8fb8d6
:memo: fix deps
mbuttner Aug 3, 2022
0b38291
:memo: reduce docs
mbuttner Aug 3, 2022
1b488a8
:memo: update docs for normalisation
mbuttner Aug 4, 2022
2fc5c21
:memo: update init
mbuttner Aug 4, 2022
8a1b66f
:memo: fix docs
mbuttner Aug 4, 2022
a7616a1
:memo: fix docs
mbuttner Aug 4, 2022
a5fc2c0
:memo: more fixes
mbuttner Aug 4, 2022
6d5bc7a
:memo: no clue why it fails
mbuttner Aug 4, 2022
a9e869e
:memo: remove anndata from docs
mbuttner Aug 4, 2022
afb7dc4
:memo: more fixes
mbuttner Aug 4, 2022
6dd2fcd
:memo: remove typing
mbuttner Aug 4, 2022
13649f1
:lipstick: add stars on readme
mbuttner Aug 4, 2022
fe44c46
:lipstick: add logo
mbuttner Aug 4, 2022
8f69f4c
:fire: delete logo
mbuttner Aug 4, 2022
5069222
:lipstick: change logo size
mbuttner Aug 4, 2022
f2b24ed
change logo
mbuttner Aug 4, 2022
c285482
:see_no_evil: gitignore logo
mbuttner Aug 4, 2022
b8e6056
:truck: move logo
mbuttner Aug 4, 2022
60693d2
:memo: change conv
mbuttner Aug 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ _build
docs/pytometry.*
lamin_sphinx
docs/conf.py
docs/_static/logo.svg

# data
docs/tutorials/*.fcs
docs/tutorials/*.h5ad
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Stars](https://img.shields.io/github/stars/buettnerlab/pytometry?logo=GitHub&color=yellow)](https://github.com/buettnerlab/pytometry/stargazers)
<a href="https://gitmoji.dev">
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
</a>

# Pytometry: Flow & mass cytometry analytics
Expand Down
436 changes: 436 additions & 0 deletions docs/_static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

html_logo = (
"https://raw.githubusercontent.com/laminlabs/lamin-profile/main/assets/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"]
43 changes: 0 additions & 43 deletions docs/examples/YYYY-MM-DD-task-slug.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ The notebooks do **not** get executed in CI for testing because they involve lar
:glob:
:reversed:

*
```
55 changes: 0 additions & 55 deletions docs/guides/curate-data.ipynb

This file was deleted.

4 changes: 2 additions & 2 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
@@ -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

```
43 changes: 0 additions & 43 deletions docs/notes/YYYY-MM-DD-my-design-choice.ipynb

This file was deleted.

5 changes: 1 addition & 4 deletions docs/notes/index.md
Original file line number Diff line number Diff line change
@@ -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:

*
```
47 changes: 41 additions & 6 deletions docs/tutorials/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand All @@ -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\")"
]
},
{
Expand All @@ -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."
]
},
{
Expand All @@ -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"
},
Expand All @@ -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,
Expand Down
14 changes: 11 additions & 3 deletions pytometry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@
This is the complete API reference:

.. autosummary::
:recursive:
:toctree: .

example_function
ExampleClass
read_write.read_fcs
preprocessing.split_signal
preprocessing.compensate
preprocessing.find_indexes
tools.normalize_arcsinh
tools.normalize_logicle
tools.normalize_biExp

"""

__version__ = "0.0.1" # denote a pre-release for 0.1.0 with 0.1a1

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
18 changes: 8 additions & 10 deletions pytometry/preprocessing/_process_data.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,7 +14,7 @@
# import os.path


def create_comp_mat(spillmat, relevant_data=""):
def create_comp_mat(spillmat: pd.DataFrame, relevant_data: str = "") -> pd.DataFrame:
"""Creates a compensation matrix from a spillover matrix.

Args:
Expand All @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -108,7 +106,7 @@ def compensate(
comp_matrix=None,
matrix_type="spillover",
copy: bool = False,
):
) -> Optional[AnnData]:
"""Computes compensation for data channels.

Args:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
Loading