Skip to content
Merged
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 src/cell_eval/_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def build_base_mean_adata(

if output_path is not None:
logger.info(f"Saving baseline data to {output_path}")
baseline_adata.write_h5ad(output_path) # ty: ignore[invalid-argument-type]
baseline_adata.write_h5ad(output_path)

if output_de_path is not None:
logger.info("Calculating differential expression")
Expand Down
2 changes: 1 addition & 1 deletion src/cell_eval/_cli/_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def strip_anndata(

# Write the h5ad file
logger.info(f"Writing h5ad output to {tmp_h5ad}")
minimal.write_h5ad(tmp_h5ad) # ty: ignore[invalid-argument-type]
minimal.write_h5ad(tmp_h5ad)

# Zstd compress the h5ad file (will create pred.h5ad.zst)
logger.info(f"Zstd compressing {tmp_h5ad}")
Expand Down
19 changes: 17 additions & 2 deletions src/cell_eval/_cli/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import importlib.metadata
import logging
import os
from typing import Any

from .. import KNOWN_PROFILES
from ._const import DEFAULT_CTRL, DEFAULT_OUTDIR, DEFAULT_PERT_COL
Expand Down Expand Up @@ -118,6 +119,14 @@ def parse_args_run(parser: ap.ArgumentParser):
"the reference, removing the below-detection floor. OFF by default (default DE "
"behavior unchanged); pass e.g. 5 to enable (T is dataset-dependent).",
)
parser.add_argument(
"--epsilon",
type=float,
default=0.0,
help="Epsilon (pseudocount) forwarded to pdex for the log fold-change "
"denominator [default: %(default)s]. Pass e.g. 1e-9 to match pdex>=0.2.5 "
"behavior.",
)
parser.add_argument(
"--version",
action="version",
Expand Down Expand Up @@ -154,6 +163,12 @@ def run_evaluation(args: ap.Namespace):

skip_metrics = args.skip_metrics.split(",") if args.skip_metrics else None

# DE knobs forwarded to pdex (cpm_filter off by default; epsilon default 0.0).
pdex_kwargs: dict[str, Any] = {
"cpm_filter": args.cpm_filter,
"epsilon": args.epsilon,
}
Comment thread
LeonHafner marked this conversation as resolved.

if args.celltype_col is not None:
real = ad.read_h5ad(args.adata_real)
pred = ad.read_h5ad(args.adata_pred)
Expand Down Expand Up @@ -181,7 +196,7 @@ def run_evaluation(args: ap.Namespace):
allow_discrete=args.allow_discrete,
prefix=ct,
skip_de=args.profile == "pds",
pdex_kwargs={"cpm_filter": args.cpm_filter},
pdex_kwargs=pdex_kwargs,
)
evaluator.compute(
profile=args.profile,
Expand Down Expand Up @@ -210,7 +225,7 @@ def run_evaluation(args: ap.Namespace):
outdir=args.outdir,
allow_discrete=args.allow_discrete,
skip_de=args.profile == "pds",
pdex_kwargs={"cpm_filter": args.cpm_filter},
pdex_kwargs=pdex_kwargs,
)
evaluator.compute(
profile=args.profile,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/vcc/vcc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
"id": "386ee994",
"metadata": {},
"outputs": [],
"source": "adata.write_h5ad(\"./example.h5ad\") # ty: ignore[invalid-argument-type]"
"source": "adata.write_h5ad(\"./example.h5ad\")"
},
{
"cell_type": "markdown",
Expand Down
Loading