v1
latestOpenAPI 3.0.22026-07-17171545.4 KBValidateselection
Checks whether specific atom/bond selections will lead to an illegal query, or will conflict with already selected atoms/bonds
Typical use case: set selected atoms/bonds as either variable or environment
"Autocorrects" illegal selections to prevent most such selections that would never lead to results.
For example, an exact search for a variable fragment that is a subsection of a ring: this search would not find any results, for typical use cases where MMPs were defined with 'fragment and index' algorithms that do not cut cyclic bonds. Therefore, validateSelection would automatically grow the variable selection to be the entire ring, instead of just the subsection of the ring.
Another example: When trying to set selected atoms as variable atoms, but if some of these atoms were previously set as environment atoms, all environment labels will be cleared due to the overlap.
In addition, for "variable" selections, this endpoint will automatically select single neighboring atom(s) (relative to "variable" selection) as an "environment" selection (radius 1).
The matcher frontend buttons labeled "Set variable atoms" (i.e. variable_atoms) and "Set constant atoms" (i.e. environment_atoms) call this endpoint
Parameters:
(note that all atom/bond indices are provided as strings of comma-separated integers, e.g. "1,2,7")
- selection_type: "variable" or "environment", the category to which the selected atom indices will be added in sketched_content, after successful validation
- sketched_content: chemical structure constraints of left-hand-side and right-hand-side portions of the MMP transform and environment. The variable/environment atoms/bonds refer to PREVIOUSLY validated selections. sketched_content is an object with below items:
- mol1_molfile: MDL molfile string of the 'starting', 'left-hand-side' structure in the query (if any)
- mol1_variable_atoms: indices of atoms in the variable fragment (which change as part of the transform). The order of atoms in the molfile defines the atom indices, starting from 0
- mol1_variable_bonds: indices of bonds in the variable fragment. The order of bonds in the molfile defines the bond indices, starting from 0
- mol1_environment_atoms: indices of atoms in the environment fragment (which do not change as part of the transform)
- mol1_environment_bonds: indices of bonds in the environment fragment
- mol2_molfile: MDL molfile string of the 'ending', 'right-hand-side' structure in the query (if any)
- mol2_variable_atoms: indices of atoms in the variable fragment (which change as part of the transform). The order of atoms in the molfile defines the atom indices, starting from 0
- mol2_variable_bonds: indices of bonds in the variable fragment. The order of bonds in the molfile defines the bond indices, starting from 0
- mol2_environment_atoms: indices of atoms in the environment fragment (which do not change as part of the transform)
- mol2_environment_bonds: indices of bonds in the environment fragment
- mol1_selected_atoms: indices of atoms in mol1 selected by the user, which are about to undergo validation
- mol1_selected_bonds: indices of bonds in mol1 selected by the user, which are about to undergo validation
- mol2_selected_atoms: indices of atoms in mol2 selected by the user, which are about to undergo validation
- mol2_selected_bonds: indices of bonds in mol2 selected by the user, which are about to undergo validation
Returns JSON with validated variable and environment atom/bond indices:
- mol1_variable_atoms: array of integers
- mol1_variable_bonds: array of integers
- mol1_environment_atoms: array of integers
- mol1_environment_bonds: array of integers
- mol1_entire_molecule_selected: "True" or "False": Used to signal whether the entire structure was selected as a variable fragment. If "True", the query will return no results, because matcher relies on detection of borders between variable and non-variable atoms to determine point of attachment of the variable atoms.
- mol2_variable_atoms: array of integers
- mol2_variable_bonds: array of integers
- mol2_environment_atoms: array of integers
- mol2_environment_bonds: array of integers
- mol2_entire_molecule_selected: "True" or "False": Used to signal whether the entire structure was selected as a variable fragment. If "True", the query will return no results, because matcher relies on detection of borders between variable and non-variable atoms to determine point of attachment of the variable atoms.
Request body
Example request
{
"selection_type": "variable",
"sketched_content": {
"mol1_molfile": "\n Ketcher 8112214332D 1 1.00000 0.00000 0\n\n 7 7 0 0 0 0 999 V2000\n 6.1042 -4.2292 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 6.9702 -4.7292 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 6.9702 -5.7292 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 6.1042 -6.2292 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 5.2382 -5.7292 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 5.2382 -4.7292 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 6.1042 -3.2292 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 2 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 6 1 0 0 0\n 6 1 2 0 0 0\n 1 7 1 0 0 0\nM END\n",
"mol1_variable_atoms": "",
"mol1_variable_bonds": "",
"mol1_environment_atoms": "",
"mol1_environment_bonds": "",
"mol2_molfile": "\n Ketcher 8112214352D 1 1.00000 0.00000 0\n\n 7 7 0 0 0 0 999 V2000\n 6.4583 -4.4792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 7.3243 -4.9792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 7.3243 -5.9792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 6.4583 -6.4792 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 5.5923 -5.9792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 5.5923 -4.9792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 6.4583 -3.4792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 2 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 6 1 0 0 0\n 6 1 2 0 0 0\n 1 7 1 0 0 0\nM END\n",
"mol2_variable_atoms": "",
"mol2_variable_bonds": "",
"mol2_environment_atoms": "",
"mol2_environment_bonds": ""
},
"mol1_selected_atoms": "6",
"mol1_selected_bonds": "",
"mol2_selected_atoms": "6",
"mol2_selected_bonds": ""
}Response
Successful Response