#8856 – Defining other monomer properties - presets in the monomer creation wizard#8900
Merged
Merged
Conversation
- Add hasAllMandatoryPropertiesFilled() to check if user filled in properties - Add autoAssignPropertiesForHiddenMonomer() to generate default properties - Auto-generate Code: presetCode + suffix (B/S/P) - Auto-generate Name: same as Code - Auto-assign Natural analogue for bases: 'X' by default - Modify validation logic to skip when properties are not filled - Only mark monomers as hidden when properties were auto-assigned - Monomers with user-filled properties are saved as normal (visible) monomers Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
- Modify assignConnectionPointAtom() to accept leavingAtomLabel parameter - Auto-assign leaving groups based on component type and attachment point: - Base R1: H (hydrogen) - Sugar R2: H (hydrogen) - Sugar R3: O (oxygen, representing OH) - Phosphate R1: O (oxygen, representing OH) - This ensures RNA preset components have correct leaving groups as per requirement 2.3.2.2 Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
- Add JSDoc documentation to hasAllMandatoryPropertiesFilled() explaining why 'name' is not checked - Create getLeavingAtomForAttachmentPoint() helper function to centralize leaving atom logic - Replace hardcoded AtomLabel values with helper function calls for better maintainability - Add inline comments to clarify whitespace handling in autoAssignPropertiesForHiddenMonomer() - Fix naturalAnalogue handling to consistently apply trim() in all cases Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add presets for defining monomer properties in creation wizard
#8856 – Defining other monomer properties - presets in the monomer creation wizard
Dec 10, 2025
rrodionov91
approved these changes
Dec 10, 2025
AlexeyGirin
added a commit
that referenced
this pull request
Jan 3, 2026
…eation wizard (#8900) * Initial plan * Implement auto-property assignment for hidden RNA preset monomers - Add hasAllMandatoryPropertiesFilled() to check if user filled in properties - Add autoAssignPropertiesForHiddenMonomer() to generate default properties - Auto-generate Code: presetCode + suffix (B/S/P) - Auto-generate Name: same as Code - Auto-assign Natural analogue for bases: 'X' by default - Modify validation logic to skip when properties are not filled - Only mark monomers as hidden when properties were auto-assigned - Monomers with user-filled properties are saved as normal (visible) monomers Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com> * Add auto-assignment of attachment point leaving groups for RNA presets - Modify assignConnectionPointAtom() to accept leavingAtomLabel parameter - Auto-assign leaving groups based on component type and attachment point: - Base R1: H (hydrogen) - Sugar R2: H (hydrogen) - Sugar R3: O (oxygen, representing OH) - Phosphate R1: O (oxygen, representing OH) - This ensures RNA preset components have correct leaving groups as per requirement 2.3.2.2 Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com> * Address code review feedback - improve code maintainability - Add JSDoc documentation to hasAllMandatoryPropertiesFilled() explaining why 'name' is not checked - Create getLeavingAtomForAttachmentPoint() helper function to centralize leaving atom logic - Replace hardcoded AtomLabel values with helper function calls for better maintainability - Add inline comments to clarify whitespace handling in autoAssignPropertiesForHiddenMonomer() - Fix naturalAnalogue handling to consistently apply trim() in all cases Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com> * - fixed tests --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com> Co-authored-by: Roman Rodionov <roman_rodionov@epam.com>
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.
How the feature works? / How did you fix the issue?
Implements auto-property assignment for RNA preset components when mandatory fields are not user-provided (requirement 2.3.2.2).
Core Logic
Property Auto-Assignment
{presetCode}{suffix}where suffix = B (base), S (sugar), P (phosphate)Hidden vs Visible Monomers
hidden: trueonly when properties are auto-assignedAttachment Point Leaving Groups
Implementation
Added helper functions:
hasAllMandatoryPropertiesFilled(): Checks Code + Natural Analogue (if required)autoAssignPropertiesForHiddenMonomer(): Generates defaultsgetLeavingAtomForAttachmentPoint(): Maps component type + AP → leaving atomModified:
validateRnaPresetWizard(): Skips validation when properties absent (allows auto-assignment)assignConnectionPointAtom(): AddedleavingAtomLabelparameterCheck list
#1234 – issue nameOriginal prompt
This section details on the original issue you should resolve
<issue_title>Defining other monomer properties - presets in the monomer creation wizard</issue_title>
<issue_description>## Background
This is an improvement to the previous logic contained in this ticket.
Requirements
❗ The requirements for this section contained in a separate ticket. ❗
❗ The requirements for this section contained in a separate ticket. ❗
❗ The requirements for this section contained in a separate ticket. ❗
❗ The requirements for this section contained in a separate ticket. ❗
2.3. The user can choose not to define some (all except the structure) properties for some (or all) components.
2.3.1. If for a monomer component all mandatory properties are filled, that monomer will also be saved to the library (in addition to the preset).
2.3.2. If all mandatory properties are not defined, that monomer gets saved to the library with user-assigned and default-assigned properties, but is "hidden" from the user.
2.3.2.1. Any properties of the "hidden" monomers should not be used for uniqueness, or any other checks, in regards to creating and editing monomers.
2.3.2.2. The following monomer properties will be assigned automatically:
Monomer type - based on if the user marked the monomer as
base,sugar, orphosphate.Code - constructed from the preset code (for example abc) as abcB (for bases), abcS (for sugars), and abcP (for phosphates).
Name - same as code.
Natural analogue (for base only) -
Xby default.Attachment points:
If a base is present, the connection between sugar and base is formed between two APs: R1 with LGA H for the base, and R3 with LGA OH for the sugar.
If phosphate is present, the connection between sugar and phosphate is formed between two APs: R1 with LGA OH for the phosphate, and R2 with LGA H for the sugar.
Structure - based on the structure marked as belonging to that monomer.
Expand for the step-by-step assignment of the APs
There are three types of presets: sugar(base)phosphate (1), sugar()phosphate (2), and sugar(base) (3).
1.1. Start by defining the phosphate and then base
Select the phosphate -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA OH.
Select the base -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA H.
Select the sugar -> it has two internal APs that we know are with the phosphate and the base -> Assign that AP with the phosphate as R2 with LGA H, and the AP with the base as R3 with LGA OH.
1.2. Start by defining the base and then phosphate
First and second steps from the previous workflow flipped.
1.3. Start by defining the phosphate then sugar
Select the phosphate -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA OH.
Select the sugar -> it has two internal APs, we know which is with the phosphate so we assign it as R2 with LGA H. The other one must be with a base so it is assigned as R3 with LGA OH.
Select the base -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA H.
1.4. Start by defining the base then sugar
Same logic as the previous workflow - we know what APs the sugar will have because one of the components is known.
1.5. Start by defining the sugar then phosphate
Select the sugar -> It has two internal APs, but we don't know which is used for base and which for phosphate. Assign the first one R2 with LGA H based on the number of the AA in the KET file, and the other one R3 with LGA OH.
Select the phosphate -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA OH.
If the bond between sugar and phosphate is not R2(H)-R1(OH), the APs of the sugar must be flipped.
Select the base -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA H.
1.6. Start by defining the sugar then base
Same logic from the previous workflow - the sugar APs are assigned by default, and then flipped after the base is defined if the bond between sugar and base is not R3(OH)-R1(H).
2.1. Start by defining the phosphate
Select the phosphate -> it has one internal AP that can only be with a sugar -> Assign that AP as R1 with LGA OH.
Select the sugar -> it has one internal AP that we know is with the phosphate -> Assign that AP as R2 with LGA H.
2.2. Star...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.