Align orfdata with the openvax stack baseline (unused runtime biotite dependency, Biopython in tools, no develop.sh)

Abierto
#194 1 comentario 0 reacciones 0 asignados Ver en GitHub

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
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend, tooling

Línea de trabajo

Start with pyproject.toml, orfdata/fasta.py, and tools/verify_riborf_native.py; compare the package imports and dependency groups with the proposed biotite and Biopython changes. Check the alignment oracle in tests/test_dog_ncorf_search.py and the sibling libraries' develop.sh scripts for project conventions. Done means the dependency declarations, documentation, verification tool, and development setup agree with the chosen approach.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

ORFdata meets the Python 3.11, pandas 3 and pyarrow baselines. Three deviations from the openvax stack remain:

  1. biotite is a runtime dependency that the package never uses, and FASTA I/O is hand-written. pyproject.toml requires biotite>=1.6,<3, and the README says a normal install includes "Biotite alignment support". But no module under orfdata/ imports biotite; only scripts/experimental/dog-ncorf-search/homology.py does, and that script is not part of the installed package. FASTA is read and written by orfdata/fasta.py and by per-source loops. #182 already proposes moving those loops onto fasta.read_fasta. This item is about what read_fasta is built on.
  2. Biopython is still imported, in a maintenance tool and a test. #131 moved the experimental dog search to biotite, and the 0.41.0 CHANGELOG keeps Biopython as a dev dependency "for independent comparisons". That rationale fits the test, which checks biotite's alignments against an independent implementation. It does not fit tools/verify_riborf_native.py, which uses Bio.SeqIO and Bio.Seq to translate RibORF ORFs. ORFdata translates with its own genetic codes, not biotite, so biotite would be just as independent there.
  3. No develop.sh (consistency). 14 of the 16 openvax/pirl-unc libraries have one. ORFdata documents python -m pip install -e '.[dev]' in docs/reference.md:367 instead.

Evidence

Read at d8ab958.

biotite / FASTA

  • pyproject.toml:21: "biotite>=1.6,<3" in [project].dependencies. rg biotite orfdata/ finds nothing. The only import is scripts/experimental/dog-ncorf-search/homology.py:3-4, and [tool.setuptools.packages.find] installs only orfdata*.
  • orfdata/fasta.py:6-40: hand-written write_fasta and read_fasta. The reader raises on an empty header, a repeated identifier and sequence before the first header.
  • Per-source loops covered by #182 include:
    • ensembl.py:110 _fasta, refseq.py:27 _proteins and proteome.py:906 ProteinSet.from_fasta;
    • sources/ncorf_mammals.py:36, sources/peptideatlas.py:76, sources/openprot.py:48, sources/pfizer.py:81 and sources/riborf_native.py:61, all named _fasta;
    • sources/riborf.py:66 and :279.
  • biotite.sequence.io.fasta.FastaFile.read_iter(file) accepts a path or an open text handle (including gzip.open(..., "rt")) and yields (header, sequence). It skips blank and ; lines, does not check for repeated headers, and silently drops lines before the first header. FastaFile.write_iter(file, items, chars_per_line) writes records.

Biopython

  • pyproject.toml:31-32: dev = [..., "biopython>=1.88,<2"], with the comment "Biopython independently checks the Biotite migration's scores and tie order."
  • tools/verify_riborf_native.py:3 says "Uses Biopython translation". Lines 16–17 have from Bio import SeqIO and from Bio.Seq import Seq.
  • tests/test_dog_ncorf_search.py:51-52,91 import Bio.Align and substitution_matrices as the oracle for biotite's local alignment.
  • CHANGELOG.md:237-239 (0.41.0): "Biopython remains a development dependency for independent comparisons".

develop.sh

  • Top level has lint.sh, test.sh, deploy.sh and docs.sh, but no develop.sh.

Suggested fix

  1. biotite / FASTA: do one of these, so the requirement matches the code.
    • Build fasta.read_fasta and write_fasta on FastaFile.read_iter and write_iter. Keep the empty-header and repeated-identifier checks, and keep a first-line check for data before the first header, since read_iter drops it. The loops that #182 consolidates then go through biotite too.
    • Or keep the hand-written reader, and move biotite from [project].dependencies to an extra used by the experimental script. Update the README sentence to match.
  2. Biopython:
    • Port tools/verify_riborf_native.py to biotite: biotite.sequence.io.fasta for reading, and NucleotideSequence(...).translate(complete=True) with an explicit codon table.
    • That leaves the alignment oracle test as Biopython's only use. Either keep it as the one sanctioned exception and say so in the dev comment, or replace it with fixed expected scores and tie orders and drop Biopython.
  3. develop.sh: add one running pip install -e '.[dev]', as the siblings do.

https://claude.ai/code/session_01JHJhwj29oDqoeu7TYd34Pi

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openvax/orfdata

Todos los issues de openvax/orfdata

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.