Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion docs/tutorials/notebooks
Submodule notebooks updated 1 files
+1,685 −94 enrichment.ipynb
2 changes: 2 additions & 0 deletions pertpy/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
gehring_2019,
haber_2017_regions,
hagai_2018,
human_cytokine_dict,
kang_2018,
mcfarland_2020,
norman_2019,
Expand Down Expand Up @@ -84,6 +85,7 @@
"gehring_2019",
"haber_2017_regions",
"hagai_2018",
"human_cytokine_dict",
"kang_2018",
"mcfarland_2020",
"norman_2019",
Expand Down
41 changes: 41 additions & 0 deletions pertpy/data/_datasets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path

import pandas as pd
import scanpy as sc
from anndata import AnnData
from mudata import MuData
Expand Down Expand Up @@ -1598,3 +1599,43 @@ def hagai_2018() -> AnnData: # pragma: no cover
adata = sc.read_h5ad(output_file_path)

return adata


def human_cytokine_dict(exclude_well_biased_genes: bool = True) -> pd.DataFrame:
"""Human Cytokine Dictionary curated from PBMC allows you to infer differential cytokine activity.

The Human Cytokine Dictionary was created from single-cell RNA-seq of 9,697,974 human peripheral blood mononuclear cells (PBMC)
from 12 donors stimulated in vitro with 87 different cytokines.
Genes with a mean-to-stddev-ratio above 1 across all 6 wells for >10 cytokines in a given cell type and for >5 cell types are "well-biased".

Args:
exclude_well_biased_genes: Whether to exclude well-biased genes from the returned dataframe.

Comment thread
Jenniliu12 marked this conversation as resolved.
References:
Oesinghaus, L., Becker, S., Vornholz, L., Papalexi, E. et al.
A single-cell cytokine dictionary of human peripheral blood.
bioRxiv (2025). https://doi.org/10.64898/2025.12.12.693897

Returns:
:class:`~ pandas.DataFrame` object of differentially expressed genes after cytokine perturbation.

Comment thread
Jenniliu12 marked this conversation as resolved.
"""
output_file_name = "human_cytokine_dict.csv"
output_file_path = settings.datasetdir / output_file_name
if not Path(output_file_path).exists():
_download(
url="https://cdn.parsebiosciences.com/gigalab/10m/DEGs.csv",
output_file_name=output_file_name,
output_path=settings.datasetdir,
is_zip=False,
)

cytokine_dict = pd.read_csv(output_file_path, index_col=0)
revision_cytokines = ["TGF-beta1", "IL-18", "C3a"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a revision cytokine? This is a function for EVERYONE not just your paper. Why do we have this filter?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are cytokines that were annotated wrongly. The object in Parse hasn't been updated, so as a bandaid the cytokines get filtered manually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks! Please add a comment then to explain this clearly. Maybe also make this variable an upper case constant with improved naming.

cytokine_dict = cytokine_dict[~cytokine_dict["cytokine"].isin(revision_cytokines)]
cytokine_dict = cytokine_dict.reset_index(drop=True)

if exclude_well_biased_genes:
cytokine_dict = cytokine_dict.loc[~cytokine_dict.well_biased]

return cytokine_dict
Loading