docs(tutorials): add the FASTA-to-scikit-learn upstream bridge recipe - #595
Open
breimanntools wants to merge 1 commit into
Open
breimanntools wants to merge 1 commit into
breimanntools wants to merge 1 commit into
Conversation
The upstream adapters ship as code, but no notebook carried another tool's output end to end, and the only runnable scikit-learn pipeline lived inside tests/integration/test_sklearn_pipeline_compat.py. Protocol 8 shows one too, but only as an unexecuted fenced block in a markdown cell, so a reader could not run it. Adds tutorials/tutorial8_upstream_bridge.ipynb: a FASTA file from an upstream tool through read_fasta, get_df_parts and SequenceFeatureTransformer into a real sklearn Pipeline, cross-validated leak-free, with the CPP feature ids preserved through get_feature_names_out and a second unlabeled delivery scored end to end. Every public parameter of read_fasta, to_fasta and SequenceFeatureTransformer (constructor plus fit / transform / get_feature_names_out) is passed by name. Runs offline on the bundled DOM_GSEC benchmark and adds no dependency (scikit-learn is already core). Wired into docs/source/tutorials.rst under a new Interoperability section, with a gallery thumbnail. One bridge only, per the issue's scope note; the embedding and structure bridges stay with the Embeddings & AlphaFold tutorial. Gates: nbmake 1 passed in 64s (timeout 120); docs build 0 errors, critical at baseline 167; tests/unit/api_tests 341 passed. Refs #555 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #595 +/- ##
=======================================
Coverage 95.39% 95.39%
=======================================
Files 222 222
Lines 23387 23387
Branches 4073 4073
=======================================
Hits 22309 22309
Misses 631 631
Partials 447 447 see 2 files with indirect coverage changes
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The upstream adapters exist as code but none was documented as an end-to-end bridge.
tutorials/tutorial8_upstream_bridge.ipynbtakes a user from another tool's output to a fitted model.FASTA in →
read_fasta→get_df_parts→ a genuinePipeline([SequenceFeatureTransformer, StandardScaler, RandomForestClassifier])undercross_val_score→get_feature_names_outshowing the CPP feature ids survive into RF importances → a second unlabeled FASTA throughtransform/predict.Zero library code touched — 3 files: the notebook, a gallery tile, and the
tutorials.rstentry under a new Interoperability section.Two judgement calls
SequenceFeatureTransformer, notaa_composition. Codex proposed the latter, which is a trivial pipeline that dodges the actual gap: the leak-free CPP-selection-inside-CV pipeline that today exists only intests/integration/test_sklearn_pipeline_compat.py. The recipe is lifted out of that test — which is what the issue asks for, since it notes the only runnable pipeline lives in a test file.DOM_GSEC(40 records) to a real FASTA rather than hand-writing six mock records, so the 5-fold CV is meaningful rather than decorative. Still offline, still no new dependency.The one-bridge-versus-every-bridge contradiction in the issue is resolved in favour of one, matching its own Scope / non-goals line — and resolved inside the docs, so the next reader does not rediscover it: the notebook and the new section both say only the FASTA hand-off is covered and point at the embeddings/AlphaFold tutorial for the others.
Verification
Docs build before and after:
0 error · 167 criticalboth times, critical did not move, and the new page was confirmed built (41 KB RST, 85 KB HTML, 5 tables, the figure rendered).pytest --nbmakeon the notebook: 1 passed in 64s — re-run independently here at 98s. 341api_testspass.One open item
tutorials/is not executed in CI at all — the notebook gate covers anexamples/subset plus all ofprotocols/. So this notebook has no blocking execution gate. Closing that is a one-line workflow addition (~65s to that job), left for you since.github/workflows/*is CONFIRM-FIRST.Refs #555.
🤖 Generated with Claude Code