Skip to content

Give each analysis type its own reading, and stop guessing which they are - #282

Merged
adamjohnwright merged 1 commit into
mainfrom
011-phase6-analysis-types
Sep 20, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
011-phase6-analysis-types

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 011 Phase 6.

The type enum, read rather than guessed

SPECIES_COMPARISON, OVERREPRESENTATION, EXPRESSION, GSA_REGULATION, GSA_STATISTICS, GSVA. Three are summarised; the three GSA ones are declined.

Reading it closed a gap in Phase 2. is_gsa recognised ReactomeGSA by its gsaMethod field alone — so a result carrying GSA_REGULATION, GSA_STATISTICS or GSVA without that field would have been summarised confidently. That is exactly the outcome D8 exists to prevent, and it was sitting in code I wrote and reviewed two phases ago.

Both signals are checked now. Neither is known to be sufficient alone, and checking both is free.

Each type says what it supports

A summary that ignores the type is likelier to say something wrong than nothing:

  • expression carries per-pathway values across columns and must describe behaviour across them — and must not guess what the columns are, since their labels are user-supplied text and are never sent
  • species comparison must say findings are inferred by orthology, not observed
  • over-representation must not use direction language at all, because that result cannot support up, down, increased or activated

exp joins the allow-list for the expression reading — aggregated per pathway rather than the reader's raw measurements, with the column labels that would make it identifying still excluded. Numbers without labels, which is the point.

Testing

On the served path, because the branch lives in the endpoint: each type gets its own reading and not another's. Verified by sabotage, with the sabotage asserted to have applied first.

All checks gated with set -e.

🤖 Generated with Claude Code

… are

Spec 011 Phase 6.

The type enum is read from the API rather than inferred: SPECIES_COMPARISON,
OVERREPRESENTATION, EXPRESSION, GSA_REGULATION, GSA_STATISTICS, GSVA. Three
are summarised and the three GSA ones declined.

Reading it closed a gap in Phase 2. `is_gsa` recognised ReactomeGSA by its
`gsaMethod` field alone, so a result carrying GSA_REGULATION, GSA_STATISTICS
or GSVA *without* that field would have been summarised confidently -- which
is exactly the outcome D8 exists to prevent. Both signals are checked now,
because neither is known to be sufficient alone and checking both is free.

Each summarised type gets an instruction saying what it supports and what it
does not, since a summary that ignores the type is likelier to say something
wrong than nothing:

- expression carries per-pathway values across columns and must describe
  behaviour across them -- and must not guess what the columns are, because
  their labels are user-supplied text and are never sent
- species comparison must say findings are inferred by orthology rather than
  observed
- over-representation must not use direction language at all, because that
  result cannot support up, down, increased or activated

`exp` joins the allow-list for the expression reading. It is aggregated per
pathway rather than the reader's raw measurements, and the column labels that
would make it identifying stay excluded -- numbers without labels, which is
the point.

Tested on the served path, because the branch lives in the endpoint: each
type is given its own reading and not another's. Verified by sabotage, with
the sabotage asserted to have applied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit de38fe6 into main Sep 20, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the 011-phase6-analysis-types branch September 20, 2026 18:27
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