Five hand-written GTF readers disagree on attribute parsing and malformed rows
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 1
- Merge trung bình
- 10 giờ 11 phút
- Pull request đã merge (30 ngày)
- 51
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 openvax/orfdata
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
openvax/orfdata#194 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của openvax/orfdata
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/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 72/100
pearu/agent-sandbox#451 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
run_gate loads a custom tasks file from outside the working directoryCó thể đã có người làm @Ru0k3 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MakazhanAlpamys/Soup#3189 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review developer setup docĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NYCPlanning/data-engineering#2996 ·
Maintainer thường phản hồi trong vòng 1 ngày