Skip to content

Add a method slot to Feature for the annotation method behind a hit - #6

Open
turbomam wants to merge 22 commits into
ber-data:mainfrom
turbomam:feature-method-slot
Open

turbomam wants to merge 22 commits into
ber-data:mainfrom
turbomam:feature-method-slot

Conversation

@turbomam

@turbomam turbomam commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #5 (Add the BER feature model as an imported module); review that first.

Why

A feature table that holds every annotation method's hits needs the method as a column, so a query or partition can select "all Pfam hits". Until now the method could only be read out of feature_id, which has no required format, and two converters spell one method differently: feature-table-corpus writes supfam and nmdc-lakehouse writes superfamily for SUPERFAMILY hits. An enum catches that kind of split when data is validated.

The same slot is in the source model, merged in turbomam/feature-table-corpus#169 (Add a method slot to Feature, so one table of hits can be filtered by method), so this copy and the next feature-table-corpus release match.

What changed

  • Feature gets an optional method slot with range MethodEnum, separate from source (tool and version) and generated_by (the run). It's for evidence hits, and is left unset on gene and RNA calls.
  • MethodEnum has nine values: pfam, cog, tigrfam, smart, supfam, cath_funfam, ko_ec, tmhmm, signalp. The first seven are the names feature-table-corpus's IMG per-method converter already uses in feature_id; its IMG TMHMM and SignalP converter writes IMG's file suffixes tmh and cleavage_sites there instead. The values have descriptions and links but no meaning mappings yet.
  • The three Pfam hits in tests/data/valid/Dataset-001.yaml carry method: pfam. A new tests/data/invalid/Dataset-invalid-method.yaml uses superfamily.
  • tests/test_data.py now checks that every file in tests/data/invalid fails validation.
  • The module version is 0.1.0-bridge.2.

Validation

  • uv run pytest -q: 16 passed.
  • The new invalid example is rejected because superfamily is not a MethodEnum value.

Copied from turbomam/feature-table-corpus at 4aaca94 (ber_feature_model.yaml 0.1.0 and
attributes.yaml), following the measurements module's pattern. Two changes from the copy, both
needed for this repository's build: the name slot becomes display_name with alias name, since
the root schema defines name; and the EDAM.DATA prefix becomes EDAM, which gen-python can emit.
MIXS and EDAM are also declared in the root so the generated Python defines them.
Remove notes, comments and description wording that describe the
feature-table-corpus conversion tooling or cite files in that repository,
which do not exist here. Keep short notes that define the model itself,
and point to the v0.1.0 release for the evidence behind each element.

Drop tree_root from Dataset so the imported module does not set the root
class for the whole central schema.
MethodEnum lists the nine methods the feature-table-corpus converters already
name inside feature_id. The three Pfam hits in the valid example now carry
method: pfam; a new invalid example uses NMDC's current spelling superfamily.
…FF symbols as deliberate in lint

feature-table-corpus spells the prefix EDAM_DATA since turbomam/feature-table-corpus#163; the IRIs
are unchanged. .linkmllint.yaml excludes the four GFF3 strand symbols from standard_naming.
Lint still reports EDAM_DATA, because the canonical EDAM.DATA can't be emitted by gen-python
(linkml/linkml#3458).
…re-method-slot

# Conflicts:
#	src/ber_central_schema/schema/ber_feature_model.yaml

This comment was marked as resolved.

This comment was marked as resolved.

@turbomam
turbomam requested a balanced review from Copilot October 6, 2026 01:12
@turbomam

This comment was marked as resolved.

This comment was marked as resolved.

The valid examples are real data converted by the model's own profiles: an NMDC run with its
contig collection, phiX174 with joined and origin-crossing locations, and Pfam hits with their
alignment targets. Each invalid example breaks one constraint and is named for it.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@turbomam

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The schema additions, examples, and invalid-fixture validation are coherent with no unresolved correctness issues.

0 open findings

🧠 Review effort: Balanced

@turbomam

Copy link
Copy Markdown
Contributor Author

I'm going to update this PR's description now and hide resolved bot reviews

@turbomam
turbomam marked this pull request as ready for review October 14, 2026 15:35

This branch has not been deployed

No deployments
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.

2 participants