Skip to content

feat(np-classifier): store pathway/superclass/class as jsonb arrays#802

Open
vcnainala wants to merge 10 commits into
developmentfrom
feat/np-classifier-jsonb-arrays
Open

feat(np-classifier): store pathway/superclass/class as jsonb arrays#802
vcnainala wants to merge 10 commits into
developmentfrom
feat/np-classifier-jsonb-arrays

Conversation

@vcnainala

@vcnainala vcnainala commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Store NP Classifier pathway, superclass, and class as PostgreSQL jsonb string arrays so all API labels are retained per molecule (not only the first result).
  • Add NpClassifierResults helper, migration, updated classification jobs/commands, --force reclassification, jsonb-aware search filters, UI updates, and report generator fixes.
  • Document REST/search array semantics and add unit + feature test coverage.

Test plan

  • Run php artisan migrate and verify properties.np_classifier_* columns are jsonb
  • Run php artisan test --filter=NpClassifier
  • Search by np_pathway:, np_superclass:, and np_class: filters against a molecule with multiple labels
  • Confirm molecule details page shows comma-separated classifier links
  • After deploy, run php artisan coconut:npclassify --all --force to refresh existing molecules

Resolves

Closes #782

sriramkanakam87 and others added 10 commits February 19, 2026 19:04
…b arrays

Introduce NpClassifierResults for normalizing API and import payloads, add a
PostgreSQL migration to convert existing text values, and cast model attributes
as arrays so all classifier labels are retained per molecule.
…ification

Update classification jobs and artisan commands to store complete API result
arrays via NpClassifierResults, and add a --force option to refresh molecules
that already have classifier data after deploy.
Expand np_pathway, np_superclass, and np_class filter queries to search any
stored label in the jsonb array instead of a single scalar value.
Render pathway, superclass, and class as comma-separated search links so
molecules with multiple classifier assignments show every stored label.
Update bubble frequency, stacked bar, and properties JSON commands to unnest
jsonb classifier arrays when building unique value lists and frequency counts.
Clarify REST and search documentation that pathway, superclass, and class
values may contain multiple labels per molecule after the jsonb migration.
…and search

Cover NpClassifierResults normalization/import parsing and verify filter
search matches any pathway stored in a molecule jsonb array.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.28571% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.54%. Comparing base (e7e52fa) to head (a911de4).
⚠️ Report is 3 commits behind head on development.

Files with missing lines Patch % Lines
app/Jobs/ClassifyMoleculeAuto.php 0.00% 8 Missing ⚠️
app/Support/NpClassifierResults.php 85.71% 5 Missing ⚠️
app/Jobs/ClassifyMoleculeBatch.php 0.00% 3 Missing ⚠️
app/Providers/RestDocumentationServiceProvider.php 0.00% 3 Missing ⚠️
app/Actions/Coconut/SearchMolecule.php 85.71% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             development    #802      +/-   ##
================================================
+ Coverage           6.14%   7.54%   +1.39%     
- Complexity          1736    1746      +10     
================================================
  Files                227     228       +1     
  Lines               8945    8996      +51     
================================================
+ Hits                 550     679     +129     
+ Misses              8395    8317      -78     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants