Five hand-written GTF readers disagree on attribute parsing and malformed rows
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 10 h 11 min
- PR fusionados (30 d)
- 51
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openvax/orfdata
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
openvax/orfdata#194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
Todos los issues de openvax/orfdata
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pearu/agent-sandbox#451 ·
Los mantenedores suelen responder en 1 día
-
run_gate loads a custom tasks file from outside the working directoryPosiblemente ocupada @Ru0k3 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MakazhanAlpamys/Soup#3189 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
review developer setup docAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NYCPlanning/data-engineering#2996 ·
Los mantenedores suelen responder en 1 día