Skip to content

feat: wisps bulk prediction launch#93

Merged
vtnphan merged 7 commits into
mainfrom
sbp-361
Jun 30, 2026
Merged

feat: wisps bulk prediction launch#93
vtnphan merged 7 commits into
mainfrom
sbp-361

Conversation

@vtnphan

@vtnphan vtnphan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

SBP-361 Add bulk-prediction workflow support to the WISPS pipeline, including dataset upload, workflow launch, and result settings display. Refactors interaction-screening–specific schemas and services into shared WISPS abstractions reusable across both workflows.

Changes

  • New: bulk-prediction launch support — the launch_workflow handler now branches on "interaction-screening" | "bulk-prediction" and launches both via launch_wisps_workflow, using a WISPS_WORKFLOW_MODES lookup to set mode: g1-g2 or mode: manual in paramsText.

  • New: unified dataset upload endpointPOST /datasets/{workflow_name}/upload replaces the interaction-screening–specific endpoint. Accepts Literal["interaction-screening", "bulk-prediction"] as a path parameter and routes to the correct S3 base path (/g/data/yz52/sbp-service/input/interaction_screening or .../bulk_prediction).

  • Refactored schemasSequenceItemWispsSequenceItem (group field is now optional to support bulk-prediction sequences without group); InteractionScreeningDatasetUploadRequestWispsDatasetUploadRequest; InteractionScreeningFormDataWispsFormData.

  • Refactored serviceupload_interaction_screening_csv_to_s3 merged into single upload_wisps_samplesheet_to_s3(sequences, run_id, base_path, label). Branches on group field presence: interaction-screening CSVs include id, sequence, group, type columns (query→g1, target→g2); bulk-prediction CSVs include only id, sequence, type.

  • Result settings tabGET /{run_id}/settingParams now reads paramsText and configProfiles from queued_jobs.launch_payload (parsed via yaml.safe_load) instead of workflow_runs.submitted_form_data, so the exact values sent to Seqera are always shown.

  • Dynamic WISPS modeget_wisps_default_params now accepts an explicit mode argument; the executor derives mode from form_data.workflow via WISPS_WORKFLOW_MODES dict instead of hard-coding g1-g2.

  • Tests and lint — updated all test imports (SequenceItemWispsSequenceItem, etc.), added mode arg to get_wisps_default_params call sites in tests, applied ruff import-sort and black formatting across 17 files.

  • No database migrations required for this change.

How to Test

  1. Interaction-screening (regression) — submit an interaction-screening job as before; confirm the result settings tab shows paramsText with mode: g1-g2.

  2. Bulk-prediction dataset upload:

    curl -X POST /api/workflows/datasets/bulk-prediction/upload \
      -H "Content-Type: application/json" \
      -d '{"sequences": [{"id": "seq1"}, {"id": "seq2"}], "runId": "my-run"}'

    Expect a response with s3Key, s3Uri, and splitOutputDir pointing to the bulk-prediction base path.

  3. Bulk-prediction launch — submit a bulk-prediction workflow; confirm the Seqera launch payload contains mode: manual in paramsText.

  4. Result settings — open any completed WISPS job's settings tab; paramsText should render as a structured object (not a raw YAML string), and configProfiles should be present.

  5. Unit tests and lint:

    .venv/bin/python -m pytest          # 571 passed
    .venv/bin/ruff check .              # no errors
    .venv/bin/black --check .           # no reformats needed

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added or updated documentation where necessary
  • I have run linting and unit tests locally
  • The code follows the project's style guidelines

@vtnphan vtnphan requested review from amandazhuyilan and marius-mather and removed request for marius-mather June 30, 2026 04:20
@vtnphan vtnphan marked this pull request as ready for review June 30, 2026 04:21

@marius-mather marius-mather left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good, just a couple of minor code cleanups to suggest

Comment thread app/services/datasets.py Outdated
Comment thread app/services/wisps_config.py Outdated
@vtnphan vtnphan requested a review from marius-mather June 30, 2026 05:45

@marius-mather marius-mather left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good to go, thanks!

@vtnphan vtnphan merged commit 945d711 into main Jun 30, 2026
2 checks passed
@vtnphan vtnphan deleted the sbp-361 branch June 30, 2026 23:36
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