"All" pathway semantics behave as "any": HAVING compares a per-gene group count to a total row count
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in Model/lib/wdk/model/questions/queries/pathwayQueries.xml and inspect the all branches of PathwaysByGeneList, PathwaysByGeneIds, and PathwaysByCompounds. Confirm the UI’s intended meaning of “all,” then compare any and all using the five-gene example from the issue. Done means all returns only pathways satisfying that meaning rather than the any result set across the affected queries.
索引モデルが issue の本文から書いたものです。
説明
In Model/lib/wdk/model/questions/queries/pathwayQueries.xml, the any_or_all_pathway "all" branch does not implement "all". It is a no-op in at least one search and probably close to one in the others.
The defect
Take PathwaysByGeneList:
GROUP BY tp.pathway_source_id, tp.pathway_source, tp.gene_source_id, tp.ec_number_gene, tp.ec_number_pathway
HAVING (
('$$any_or_all_pathway$$' = 'any')
OR (count(*) <= (SELECT count (*)
FROM apidbtuning.TranscriptPathway tp , dsGene ds
WHERE tp.gene_source_id = ds.gene
)
))
The GROUP BY includes tp.gene_source_id, so each group is one gene in one pathway with one EC pair — count(*) per group is typically 1. The subquery counts every pathway-gene row for the entire input list. So the comparison is roughly 1 <= (large number), which is true for every group. The all branch filters nothing.
For "pathways containing all of these genes", the comparison needs to be at the pathway level — something like count(distinct gene_source_id) = <number of input genes> after grouping by pathway alone, not per gene.
Evidence
EXPLAIN ANALYZE of PathwaysByGeneList against genomicsdb_071n, 5-gene input (PF3D7_0103700, PF3D7_0109500, PF3D7_0109850, PF3D7_0110600, PF3D7_0202900), pathways_source=1, exclude_incomplete_ec=0, exact_match_only=0:
| mode | rows out |
|---|---|
any |
3687 |
all |
3687 |
Identical. With any the planner constant-folds ('any' = 'any') and drops the subquery entirely; with all it evaluates it as an InitPlan and every group still passes.
Affected sites
| Query | Line (approx) | Comparison |
|---|---|---|
PathwaysByGeneList |
~234 | count(*) <= — never filters |
PathwaysByGeneIds |
~414 | count(*) = — same grouping problem, also grouped per gene |
PathwaysByCompounds |
~307 | count(*) = — same shape, worth checking against compound grouping |
The <= in PathwaysByGeneList is the most clearly wrong; the = variants may filter something, but not the intended thing, since the group is still per-gene.
Why this wasn't caught
It fails open. "All" silently returns the "any" result set, which is a superset containing the correct answer — so results look plausible and nothing errors. Only a count comparison between the two modes reveals it.
Not in scope of #227
Noticed while fixing the gene-alias resolution in these same queries (#227), and deliberately left untouched there — it is pre-existing and needs a semantics decision, not a mechanical fix. Someone should confirm what "all" is meant to mean in the UI before rewriting the grouping.
🤖 Generated with Claude Code
- 主要言語
- Perl
- スター
- 1
- フォーク
- 1
- 平均マージ
- 2日 10分
- マージ済み PR(30日)
- 15
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
VEuPathDB/ApiCommonModel のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
VEuPathDB/ApiCommonModel#260 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
VEuPathDB/ApiCommonModel#225 ·
メンテナーはふだん 1 日以内に返信
-
[Performance] Fix CompoundID vocabulary query project filtering再び着手できるかも @bgajria が 39 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
VEuPathDB/ApiCommonModel#236 · コメント 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
VEuPathDB/ApiCommonModel#229 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
VEuPathDB/ApiCommonModel#221 ·
メンテナーはふだん 1 日以内に返信
VEuPathDB/ApiCommonModel の issue をすべて見る
似ている issue
-
area:io area:warnings bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
fglock/PerlOnJava#2024 ·
メンテナーはふだん 1 日以内に返信
-
radius: unknown MFA in a source action crashes the RADIUS request対応中かも @jrouzierinverse が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
inverse-inc/packetfence#9665 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ibmdb/perl_DBD-DB2#21 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
`config --theme` can't find theme files when the `~/Documents/Themes` directory is a symbolic linkオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信