create_missing_features: opt-in / configurable strictness for synthesized parent rows
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
gtfparse.create_missing_features から始め、pyensembl の transcript.py にある下流の例を確認します。これには column_exists("exon", "exon_id") のチェックと Transcript.coding_sequence の動作が含まれます。提案されている strict/policy オプションと required_attributes_per_feature の設計を比較し、デフォルトでは best-effort の動作を維持します。合成された parent 属性が不十分な場合に、呼び出し側が例外を発生させるか、警告してスキップするかを選択でき、既存のデフォルトが変更されていなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Observation
pyensembl calls gtfparse.create_missing_features to backfill transcript and gene rows that the GTF omits (legitimate when the upstream only emits exon / CDS). The synthesizer derives the parent feature from the child rows it sees, which is usually correct — but when the input GTF deviates in ways the synthesizer doesn't anticipate, downstream consumers have to clean up.
Two recent pyensembl issues are downstream of this:
- openvax/pyensembl#331 / v2.6.4 — older Ensembl releases (e.g. release 54) omit
exon_id.create_missing_featuressynthesizestranscriptrows that don't carryexon_ideither, and pyensembl'sTranscript.exonsthen crashed withsqlite3.OperationalError: no such column: exon_id. Workaround lives in pyensembl: acolumn_exists("exon", "exon_id")check attranscript.py:149. - openvax/pyensembl#252 / v2.6.4 — TAIR
chr_patch_hapl_scafffragments containCDSrows without matchingstart_codon/stop_codon. After feature synthesis the transcript row exists butcoding_sequencecouldn't compute its endpoints. Workaround in pyensembl:Transcript.coding_sequencereturnsNonerather than raising.
In both cases the inconsistency is structural to the input GTF rather than to gtfparse's logic, but a caller-side knob would help.
Proposal
Add a strict / policy kwarg to create_missing_features:
strict="raise"— when a child row lacks attributes the synthesizer would need to faithfully build the parent, raise.strict="warn"— log + skip the synthesized row.strict="best_effort"— current behavior; synthesize whatever we can, fill missing attrs with None.
Or more granularly: a required_attributes_per_feature: dict[str, set[str]] knob so callers can pin "if you're going to synthesize a transcript row, only do so when the child exon carries exon_id".
Why it'd help
The two issues above both look like "pyensembl handles partial GTFs" but the upstream signal that something's off (exon_id missing, start_codon missing) gets eaten by the synthesizer and lives later as a crash at query time.
Scope guard
- Existing default behavior should stay best-effort. This is purely additive.
- Bacteria/archaea GFFs with their own synthesis quirks are out of scope for this issue (separate parser ecosystem).
- 主要言語
- Python
- スター
- 130
- フォーク
- 34
- 平均マージ
- 23時間 45分
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openvax/gtfparse のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
openvax/gtfparse の issue をすべて見る
似ている issue
-
[Bug]: DoubleMLData.from_arrays checks the treatment d with force_all_x_finite instead of force_all_d_finite対応中かも @leninworld が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
DoubleML/doubleml-for-py#471 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
python-pillow/Pillow#10590 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
BUG: ZarrTrace fails in init_trace for models with datetime coordinates (object dtype coord array)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信