Skip to content

Add /api/stability endpoint with stability models and tighten sequence validation#5

Merged
Siddharthakhandelwal merged 4 commits into
mainfrom
codex/read-project-documentation-and-backend-code
Mar 12, 2026
Merged

Add /api/stability endpoint with stability models and tighten sequence validation#5
Siddharthakhandelwal merged 4 commits into
mainfrom
codex/read-project-documentation-and-backend-code

Conversation

@Siddharthakhandelwal

@Siddharthakhandelwal Siddharthakhandelwal commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a simple MVP stability scoring endpoint to estimate protein stability from sequence-derived features.
  • Ensure sequence validators enforce length bounds after cleaning to avoid downstream errors.
  • Slightly adjust request signature for the solubility search endpoint to accept the Request object for consistency with other endpoints.

Description

  • Added StabilityRequest and StabilityResponse Pydantic models to backend/main.py with the same cleaning/validation as other sequence requests and enforced post-cleaning length checks.
  • Implemented POST /api/stability (measure_stability) which computes aromaticity, an aliphatic index approximation, charge density, disorder fraction, an instability_index, and a stability_score and returns a classified stability_class with details; the model is a deterministic heuristic for MVP screening.
  • Tightened sequence validation in PredictRequest.validate_amino_acids to check cleaned sequence length is between 10 and 2000 and raise a ValueError if not.
  • Changed search_solubility signature to async def search_solubility(request: Request, ...) to accept the Request object similarly to other endpoints.

Testing

  • Ran existing unit tests for request validation and API endpoints with pytest and all tests passed.
  • Executed integration-style tests against the new POST /api/stability endpoint verifying response schema and basic score ranges and they passed.
  • Ran linting/type checks and no new issues were reported.

closes #4
@codex

@Siddharthakhandelwal Siddharthakhandelwal marked this pull request as ready for review March 12, 2026 04:59
@Siddharthakhandelwal

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10809724ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/main.py Outdated
@Siddharthakhandelwal

Copy link
Copy Markdown
Collaborator Author

@codex review

@raiden9420 raiden9420 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.

looking all good , need to use uniprot

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Siddharthakhandelwal Siddharthakhandelwal merged commit 4059561 into main Mar 12, 2026
7 checks passed
Siddharthakhandelwal added a commit that referenced this pull request Mar 18, 2026
* started the work on backend

* Add confidence metrics module and update requirements

* added the docs and rearranged the files

* Add /api/stability endpoint with stability models and tighten sequence validation (#5)

* Remove issue markdown file and provide issue text inline

* Modularize stability computation with isolated service logic

* Add detailed backend feature and architecture docs

* Fix stability request length validation after cleaning

---------

Co-authored-by: jyotsana15 <jyotsanab15@gmail.com>
@Siddharthakhandelwal Siddharthakhandelwal deleted the codex/read-project-documentation-and-backend-code branch March 18, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Protein Stability Estimation API

2 participants