One-sided and `lessAbs` p-values are 0.5 for every gene on the far side of the threshold
Maintainer thường phản hồi trong vòng 1 ngày
@arashmparsa đang làm issue này rồi.
Từ ngày 27/11/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- numpy, python
- Lĩnh vực
- bioinformatics
Hướng nghiên cứu
Start in pydeseq2/glm.py, in glm.wald_test around lines 249-267, and compare how the clipped statistic feeds the p-value with the unclipped (lfc - lfc_null) / wald_se. Run the reproduction in the issue, then inspect tests/data/single_factor/r_test_res_greater.csv and test_alt_hypothesis, which currently skips genes with statistic 0. Done means greater, less and lessAbs p-values match DESeq2's upper-tail formulas, less_abs no longer returns a signed statistic, and the test covers statistic-0 genes; #483 is separate.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
With alt_hypothesis set to "greater", "less" or "lessAbs", every gene whose statistic is clipped to 0 gets p-value 0.5: in the reproduction 74, 72 and 54 genes do, where DESeq2's formulas on the same log2 fold changes and standard errors give 0.5498 to 1, 0.5453 to 1 and 0.5015 to 1; DESeq2's results() clips the statistic but takes the p-value from the unclipped upper tail (pfunc((LFC - T)/SE) for greater, pfunc((-T - LFC)/SE) for less, the larger of pfunc((T - LFC)/SE) and pfunc((LFC + T)/SE) for lessAbs).
The repository's fixture tests/data/single_factor/r_test_res_greater.csv has p-value 0.999938 for gene3, whose statistic is 0, and test_alt_hypothesis compares p-values only where the statistic is not 0.
greater, less and less_abs in glm.wald_test (glm.py:249-267) take the p-value of the clipped statistic; computing it from the unclipped (lfc - lfc_null) / wald_se would fix it (less_abs also reports a signed statistic where DESeq2's is never negative).
Related: #483 (lfc_null and alt_hypothesis applied per coefficient), a separate bug in the same function.
Source line numbers refer to commit 2ca3b74.
Reproduction
import numpy as np
import pandas as pd
from pydeseq2.dds import DeseqDataSet
def simulate(n_genes=200, groups=(4, 4), seed=0):
"""Counts (samples x genes) and metadata; dispersion 0.05 + 1 / mean."""
rng = np.random.default_rng(seed)
group = np.repeat(np.arange(len(groups)), groups)
base = rng.lognormal(4, 1.5, n_genes)
lfc = rng.normal(0, 0.5, (len(groups), n_genes))
lfc[0] = 0
mu = base * np.exp(lfc[group])
disp = 0.05 + 1 / base
counts = rng.negative_binomial(1 / disp, 1 / (1 + disp * mu))
samples = [f"s{i}" for i in range(len(group))]
counts = pd.DataFrame(counts, index=samples, columns=[f"g{j}" for j in range(n_genes)])
metadata = pd.DataFrame({"condition": np.array(list("ABCDEF"))[group]}, index=samples)
return counts, metadata
def dataset(counts, metadata, **kwargs):
return DeseqDataSet(counts=counts, metadata=metadata, n_cpus=1, quiet=True, **kwargs)
import numpy as np
from scipy.stats import norm
from pydeseq2.ds import DeseqStats
dds = dataset(*simulate(n_genes=100, groups=(4, 4), seed=3))
dds.deseq2()
for alternative, lfc_null in [("greater", 0.5), ("less", -0.5), ("lessAbs", 0.5)]:
ds = DeseqStats(dds, contrast=["condition", "B", "A"], lfc_null=lfc_null, alt_hypothesis=alternative, n_cpus=1, quiet=True)
ds.summary()
res = ds.results_df
lfc, se, t = res["log2FoldChange"], res["lfcSE"], abs(lfc_null)
deseq2 = {"greater": norm.sf((lfc - t) / se), "less": norm.sf((-t - lfc) / se),
"lessAbs": np.maximum(norm.sf((t - lfc) / se), norm.sf((lfc + t) / se))}[alternative]
zero = (res["stat"] == 0).to_numpy()
print(f"{alternative}: {zero.sum()} genes with stat 0, pvalue {sorted(set(res['pvalue'][zero].round(4)))},",
f"DESeq2's formula {deseq2[zero].min():.4f} to {deseq2[zero].max():.4f}")
Expected: p-values equal to DESeq2's formula, between 0.5 and 1, for the genes with statistic 0.
Actual, with PyDESeq2 0.6.0:
greater: 74 genes with stat 0, pvalue [0.5], DESeq2's formula 0.5498 to 1.0000
less: 72 genes with stat 0, pvalue [0.5], DESeq2's formula 0.5453 to 1.0000
lessAbs: 54 genes with stat 0, pvalue [0.5], DESeq2's formula 0.5015 to 1.0000
Split out from #491.
- Ngôn ngữ chính
- Python
- Star
- 770
- Fork
- 98
- Merge trung bình
- 19 giờ 55 phút
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của scverse/PyDESeq2
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`lowess` returns 0 for points of an exact fit after robustness iterationsCó thể làm lại được @aviralgarg05 đã nhận 15 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
scverse/PyDESeq2#520 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`irls_solver` does not enforce `min_beta` when IRLS converges, and documents `max_beta`'s default as -30Có thể làm lại được @aviralgarg05 đã nhận 15 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
scverse/PyDESeq2#521 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`MAP_dispersions` of refitted genes keep the value from before outlier replacementCó thể làm lại được @aviralgarg05 đã nhận 15 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
scverse/PyDESeq2#519 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của scverse/PyDESeq2
Issue tương tự
-
[Doc]: Feedback for `/zh-cn/v0.30.0/tutorials/models/Qwen3.6-35B-A3B.html`A3社区配置和基线不一致,社区配置也达不到基线Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
vllm-project/vllm-ascend#24429 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
simnJS/AnyPS5#735 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sqlreview.sh: `remap` with no review draft seeds one, and `delta` prints the diff then exits 2Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
nq-rdl/agent-extensions#623 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vortex-data/vortex#12633 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gke-labs/kube-agents#7955 ·
Maintainer thường phản hồi trong vòng 1 ngày