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 pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cell-eval"
version = "0.6.6"
version = "0.6.7"
description = "Evaluation metrics for single-cell perturbation predictions"
readme = "README.md"
authors = [
Expand Down
4 changes: 2 additions & 2 deletions src/cell_eval/metrics/_de.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def __call__(self, data: DEComparison) -> dict[str, float]:
)
.agg(
pl.corr(
pl.col(data.real.fold_change_col),
pl.col(f"{data.real.fold_change_col}_pred"),
pl.col(data.real.fold_change_col).cast(pl.Float64),
pl.col(f"{data.real.fold_change_col}_pred").cast(pl.Float64),
Comment on lines +132 to +133
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The class DESpearmanLFC and its docstrings state that it computes the Spearman correlation on log fold changes. However, the code is using data.real.fold_change_col. This seems to be a discrepancy. To align with the documented intent and for correctness of the metric, you should use data.real.log2_fold_change_col instead.

Suggested change
pl.col(data.real.fold_change_col).cast(pl.Float64),
pl.col(f"{data.real.fold_change_col}_pred").cast(pl.Float64),
pl.col(data.real.log2_fold_change_col).cast(pl.Float64),
pl.col(f"{data.real.log2_fold_change_col}_pred").cast(pl.Float64),

method="spearman",
).alias("spearman_corr"),
)
Expand Down