Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #411 +/- ##
=======================================
Coverage 97.03% 97.04%
=======================================
Files 31 31
Lines 1959 1962 +3
=======================================
+ Hits 1901 1904 +3
Misses 58 58
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| if len(enzymes) > 0 and sort_by_recognition_sites: | ||
| enzyme = parse_restriction_enzymes([source.restriction_enzymes[0]]) | ||
| products.sort(key=lambda x: len(x.seq.get_cutsites(enzyme))) |
There was a problem hiding this comment.
Inconsistent get_cutsites calling convention
Medium Severity
The new code calls x.seq.get_cutsites(enzyme) where enzyme is a RestrictionBatch, but the only other usage of get_cutsites in the codebase (no_assembly.py) always unpacks the batch with *enzymes. If get_cutsites expects individual enzyme objects as variadic arguments (as implied by the existing convention), passing the entire RestrictionBatch as a single argument would produce incorrect cut site counts, making the sort a no-op or incorrect — silently breaking the sorting feature without any error.


Backend part of manulera/OpenCloning_frontend#647
Note
Low Risk
Low risk: adds an optional query param that only affects the ordering of returned
restriction_and_ligationproducts when enabled; core assembly generation is unchanged.Overview
Adds an optional
sort_by_recognition_sitesquery parameter to the/restriction_and_ligationendpoint to sort returned products by how many cut/recognition sites remain for the first restriction enzyme (useful for Golden Gate workflows).Extends endpoint tests to validate that enabling sorting yields stable product ordering even when inputs are sequence-shifted, while disabling it preserves the previous (order-dependent) behavior.
Written by Cursor Bugbot for commit 5d9765a. This will update automatically on new commits. Configure here.