Skip to content

fix: adapter review findings (BrAPI/ISA-Tab/PRIDE/ENA correctness)#94

Merged
sorenwacker merged 4 commits into
mainfrom
fix-review-adapters
Jun 29, 2026
Merged

fix: adapter review findings (BrAPI/ISA-Tab/PRIDE/ENA correctness)#94
sorenwacker merged 4 commits into
mainfrom
fix-review-adapters

Conversation

@sorenwacker

Copy link
Copy Markdown
Owner

Fixes every confirmed finding from the integration-adapter code review, each with the fixture corrected to the real API shape so the tests actually guard the fix.

  • BrAPI (HIGH + 2 med): observationLevel is nested in observationUnitPosition and block/replicate live in observationLevelRelationships in BrAPI v2 — the mapper read them from the wrong place (silent field loss on every conformant server) and the export mirrored it. Fixed both; live-verified the test server now yields observation_level/code/block/replicate.
  • ISA-Tab (2 med): the writer duplicated every study's factors/protocols/assays/samples into all studies and dropped investigation contacts. Now partitions children per study via the dataset tree; guarded with a multi-study test.
  • PRIDE (med + low): submission.px now emits the FMH header and the px column order file_id, file_type, file_path (was unloadable), plus lab-head email/affiliation.
  • ENA (low): pair fastq_ftp/fastq_md5 positionally so an empty URL segment can't misalign checksums.
  • Doc-accuracy: MAF m_*.tsv, ISA-Tab writer scoped to the codenames it reads.

Root cause throughout: fixtures encoding the mapper's assumptions, so hermetic tests passed while real data broke. 1701 tests pass; ruff / strict mypy / vulture green.

🤖 Generated with Claude Code

…ation

In BrAPI v2 observationLevel nests inside observationUnitPosition and
block/replicate live in observationLevelRelationships, not as top-level/position
keys. The mapper read them from the wrong place, so observation_level,
observation_level_code, block and replicate were silently dropped for every
observation unit on every conformant server; the export mirrored the mistake.
The fixture had been hand-built to the buggy shape, masking it — now corrected to
the real v2 structure and the tests assert the fields. Live-verified.
…tion)

to_isatab passed all factors/protocols/assays/samples and study-level
people/publications to every study, and hardcoded investigation contacts to
empty. For a multi-study investigation this duplicated every child into every
study and dropped investigation-level contacts. Partition each entity to its
owning study via the dataset tree (the flat serialization carries no parent
link).
The file-mapping section lacked the FMH header row and ordered FME columns as
index/filename/file_type instead of the px-spec file_id/file_type/file_path, so
it would not load as a real submission. Also emit lab_head_email and
lab_head_affiliation (dropped before, required by px).
Pair fastq_ftp/fastq_md5 positionally (zip_longest) so an empty URL segment no
longer shifts checksums. Correct the MAF docstring (m_*.tsv, not .txt) and scope
the ISA-Tab writer's docstring to the metabolights codenames it actually reads
(review low findings).
@sorenwacker
sorenwacker merged commit 649da27 into main Jun 29, 2026
2 checks passed
@sorenwacker
sorenwacker deleted the fix-review-adapters branch June 29, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant