Five hand-written GTF readers disagree on attribute parsing and malformed rows
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading orfdata/gtf.py and the five reader loops named in the issue, along with the existing GTF tests. Compare their row validation, attribute parsing, and header handling, then check how PyEnsembl provides gtfparse. Done means the five readers use one shared reader and tests cover malformed rows and quoted attribute values consistently.
索引モデルが issue の本文から書いたものです。
説明
Problem
ORFdata reads GTF files with five separate hand-written loops, each with its own attribute regex, row validation and header handling. They disagree on malformed input. A row without nine tab-separated fields is an error in three of them and is silently skipped in two. Attribute parsing uses three different patterns. A fix to any of them (for example the quote handling from #179) lands in one reader only. This is the GTF counterpart of #182 for FASTA. The stack's GTF reader, gtfparse, is already installed through PyEnsembl.
Evidence
Read at d8ab958.
| Reader | Rows read | Attribute pattern | Row with ≠ 9 fields |
|---|---|---|---|
orfdata/gtf.py:145 read_exons (used by viral_installed.py:73) |
exon |
(\w+) "([^"]*)" (gtf.py:19) |
raises |
orfdata/ensembl.py:69 _annotation |
transcript, CDS; reads #!genome-build-accession |
(\w+) "([^"]*)" |
raises |
orfdata/sources/wang.py:115 _annotation |
all; reads #! headers |
(\w+) "([^\"]*)"; (needs the ;) |
raises |
orfdata/sources/ncorf_mammals.py:61 _transcripts (also used by sources/riborf.py:135,201) |
exon |
(\S+) "([^"]*)" (ncorf_mammals.py:33) |
skipped (len(fields) < 9) |
orfdata/sources/riborf_native.py:23 _annotations |
exon |
imports ncorf_mammals._ATTRIBUTE |
skipped (len(fields) != 9) |
Each loop also opens the file itself: gzip.open in the three source modules, plain open in gtf.read_exons, and ensembl._source in ensembl.py.
Suggested fix
- Add one public reader to
orfdata/gtf.py. For example,read_gtf_rows(path, features=None)would yield(seqname, feature, start, end, strand, attributes)plus the#!header mapping, open plain or gzipped files, use one attribute parser (the inverse ofgtf.attributes), and raise on malformed rows with path and line number. Alternatively, build it ongtfparse.read_gtf(..., features=...)and read the#!header lines separately. - Rewrite the five loops on top of it, keeping only their source-specific grouping and checks.
- Add a test with one malformed row and one quoted attribute value that every caller must handle the same way.
- 主要言語
- Python
- スター
- 1
- フォーク
- 1
- 平均マージ
- 10時間 11分
- マージ済み PR(30日)
- 51
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openvax/orfdata のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
openvax/orfdata#194 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
openvax/orfdata の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pearu/agent-sandbox#451 ·
メンテナーはふだん 1 日以内に返信
-
run_gate loads a custom tasks file from outside the working directory対応中かも @Ru0k3 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MakazhanAlpamys/Soup#3189 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NYCPlanning/data-engineering#2996 ·
メンテナーはふだん 1 日以内に返信