Save Name and Reaction Conditions to RDF Metadata #2404
Labels
Cascade reactions
Feature
MMPK
Scope for Pathway reactions, View-only mode, Static images, Custom buttons and Ketcher API changes
Milestone
Background
Currently, the system lacks the capability to automatically detect and incorporate text annotations (Name and Reaction Conditions) located above reaction arrows into the RDF metadata. Implementing this feature will allow for a more comprehensive representation of reaction diagrams, including textual annotations directly associated with specific reactions and opening them in other applications with RDF support.
Solution
Text Detection:
Objective: Develop an automated feature in the system that detects text placed above reaction arrows and associates this text with the corresponding reaction.
Details: Utilize text recognition algorithms to identify text blocks positioned strategically above reaction arrows on the canvas.
If a KET text block will be within TEXTBLOCK_WIDTH/2 x TEXTBLOCK_HEIGHT/2, than this text must be understand as reaction's text.
Multi-tailed arrow:
Bottom left point of the text must be positioned inside the box. The box must be stick to spain.
Simple arrow:
Bottom center point of the text must be positioned inside the box. The box must be centred.
If there are several text objects in the rectangle, than we should take the closest one: bottom-left point to head arrow x spine and bottom-center point to center of a simple arrow.
Text parsing:
Objective: Develop text parsing to recognise reaction's Name and Reaction Conditions.
Details: We should read KET text object and understand text before the first empty line as Name and after, as Reaction Conditions.
If there is no empty line, than we should understand this text as Name only.
If there is an empty line at the very beginning, than we should understand text as Reaction Conditions.
If there are several empty lines in the text block, that we should understand all empty lines after the first one as a part of Reaction Conditions.
Insert Name and Reaction Conditions to RDF's metadata
Objective: Name and Reaction Conditions should be added to reaction's metadata while saving to RDF format.
Details: When user saves reactions to RDF, reaction's Name and Reaction Conditions should be added to reaction's metadata as a plain text. Metadata fields should be added after each reaction (RXN) inside RDF in $DTYPE - $DATUM pairs, where $DTYPE is a name of a field and $DATUM is a plain text information.
If there is no Name or Reaction Condition, than $DATUM field should be "Not available"
The text was updated successfully, but these errors were encountered: