Thursday, May 24, 2018

Support for Additional Reactions, bug fixes, and more feedback for reaction testing

Release 2.9.1

This update was actually fun! In order to support the Reactions section introduced in the last update, much of the search engine modeling had to be overhauled. Fortunately, this overhauling also made the process of introducing support for new rule defined reactions MUCH easier. In fact, this new modeling will make the future goal of allowing the user to add support for a new rule defined reaction easier as well.

The rule defined reactions that are now supported are as follows:

With the introduction of support for the five reactions above, a few stereochemistry bugs presented themselves and needed to be fixed. One involved R/S stereochemistry found in cyclic carbon skeletons. Another involved the rendering of attachments to terminal carbons in the interface to show proper E/Z stereochemistry concerning vinyl groups ((1E)-1,2-dibromoprop-1-ene).

Finally, feedback was added to the Test Reaction part of the Reactions section to let the user know when a particular reaction could NOT be applied to the input molecule. 

Future Considerations - Fortunately the overhaul of the search engine modeling system provides an implementation path for creating a feature that allows users to generate, test, and save their OWN rule defined reactions. 

Saturday, April 14, 2018

Introduction of Reactions section including search and individual reaction view/testing

Release 2.9.0

The primary goal of this release was to add an interactive, visual representation of the reaction modeling used by the search engine to the interface. This goal was accomplished by adding two new sections: 1) a search page where the user can provide parameters and keywords to search both name defined reactions and rule defined reactions (see below) 2) a page where the user can then view the details about one specific reaction.

A clarification of the difference between the two types of reactions that are used by the search engine follows. The first type of reaction, the name defined reaction, is modeled by using the IUPAC names of both the start and end molecules, along with the name of a reagant or catalyst used for the reaction, and any additional reactant or product molecules. It is meant to apply SPECIFICALLY to the one molecule named as the starting molecule. An example of a reaction modeled this way is the first reaction of the Calvin cycle. This particular reaction can only be applied to Ribulose 5-phosphate. In general the pattern of this reaction type is used for specific biochemical life reactions. It is also a MUCH simpler type of reaction to model because the search engine will only need to look for reactions with a matching start molecule name.

The second type of reaction, the rule defined reaction, is modeled as two sets of two types of rules and is more complex. The first type of rule, the location rule, determines whether or not the particular reaction can be applied to a particular molecule. The criteria used to make this conclusion are that the particular molecule contains all of the special conditions listed in the location rule (such as that the molecule is aromatic) and that the molecule contains one or more of the functional groups listed in the rule. The location rule allows the reaction type to apply to a BROAD class of molecules as opposed to just one molecule like the first type of reaction.

The second type of rule for the rule based type of reaction, the reaction rule, defines what applying the reaction to a particular molecule actually does (as opposed to simply listing the name of the product molecule). It consists of four parts: 1) an action verb, such as "add", "replace", or "remove" describing the overall action of the rule, 2) the first functional group involved in the reaction including the type of Carbon that functional group is found on, 3) any specific location instructions for the action, and an optional 4) second functional group involved in the reaction (for the "replace" action this is the functional group that will replace the functional group from the second part).

This second type of reaction, based on the two previously explained rules, can contain one or more instances of both types of rules. An example of a reaction modeled using the second type is the oxidation reaction involving Potassium Permanganate. The location rule for the oxidation reaction in this case is to find any molecule containing a primary alcohol. The reaction rule for the reaction is to replace any primary alcohol with a carboxylic acid functional group. As this type of reaction requires the search engine to match a molecule by rules (in this case a molecule containing a primary alcohol) rather than by name, this process is more complex. This second type of reaction ALSO is modeled additionally by keeping track of any reagants/catalysts used.

The page to view the details of the first type of reaction, one example being the first reaction of the Calvin cycle, is pretty self explanatory. It contains all information involved in the reaction including the IUPAC names of the start and end molecules. It is also possible to view the molecules involved in the reaction by clicking the "View Reaction" button at the bottom of the screen.

The page to view the second type of reaction, one example again being the oxidation reaction involving Potassium Permanganate, is slightly more involved. In addition to being able to view the details, you are able to view further details about each rule involved by clicking on the particular rule. This further granularity was added to the interface anticipating support for a user to edit and add rules of both the location and reaction types in the future. Also, the page supports a functionality to test the reaction. By clicking on the "Test Reaction" button the user is able to enter a molecule name, click the search icon to view it, and then click the reaction icon (beaker) to view the molecule resulting from applying the reaction.

Standards - IUPAC naming standards again were followed. No further new standards have been applied for this update.

Controls - Use of the search page is generally self-explanatory. It was designed to use functionality similar to search bars found in other modern web sites. The user is also able to refine a search by the type of category of the reaction and the reagant used in the reaction. Clicking on the pencil/edit icon allows the user to view the more detailed view page of each rule. Use of the view page is also pretty straightforward. For the type of rule based on the start and end IUPAC names of molecules, the user can click on the "View Reaction" to see a visualization of the molecules involved. For the type of rule based on the location and reaction rules, the user can click on each location and reaction rule for further detail. The user can also click on "Test Reaction" to view the result of applying the particular reaction to a molecule.

Future Considerations - An obvious future plan is to allow the user not only to view reactions of both types, but also edit them and create NEW reactions. The "Test Reaction" functionality in this case will provide useful for exploring how a new rule will apply to a particular molecule. Finally, I anticipate refining the search page a bit more.









Friday, November 17, 2017

Support for ethers, alkoxy side chains of hydrocarbon rings, additional reactions, pathway of aspirin (2-acetoxybenzoic acid) production, introduction of Google and PubChem cross-referencing, improvement of drag and drop feedback, and minor bug fix

Release 2.8.0

The main driving motivation of this update was to introduce interface support for another commonly used pharmaceutical drug, aspirin (2-acetoxybenzoic acid), as well as two new reactions so the pathway generator could again "discover" a well-known, existing synthesis pathway for aspirin. Aspirin was chosen because, similar to the already supported Tylenol (generically paracetamol or acetaminophen), aspirin can be synthesized as a derivative of phenol. Furthermore, aspirin, like Tylenol, is also on the World Health Organization's list of essential medicines.

In order for the interface to support the aspirin molecule, basic support for ethers needed to be introduced.* One particularly challenging aspect of adding support for nomenclature of ethers was the case where the user modifies the molecule enough to change which of the two alkane chains attached to the Oxygen should be regarded as the main chain. For example, if the user were to create the molecule 2-methoxyethane then add an ethyl group to the methyl side chain, thus expanding it to become a propyl chain, the interface would need to properly update the IUPAC name to 1-ethoxypropane, reflecting that the propyl chain is now the main chain per IUPAC rules.

Once ether support was in place, the benzoic acid and acetyl common IUPAC naming substitutions were added to the interface naming engine. Afterwards, the interface fully supported aspirin and the intermediates in an existing synthesis pathway.

The synthesis pathway to be "discovered" by the pathway generator involved two reactions: 1) carboxylation of phenol to produce salicylic acid (coincidentally also on the WHO's list of essential medicines), known as the Kolbe-Schmitt reaction, and 2) acetylation of salicylic acid to produce 2-acetoxybenzoic acid. Fortunately, providing support for the acetylation reaction was straightforward enough by simply adding a new rule to the existing acetylation reaction used in the synthesis of Tylenol to allow acetylation of a hydroxyl group. The Kolbe-Schmitt reaction was modeled to introduce a carboxyl group at an ortho position to the hydroxyl group in phenol.

With support for the two new reactions in place, the pathway generator could now officially solve for a pathway between phenol and aspirin!

During this process, it occurred to me that a convenient feature would be to search either Google or the Pub Chem database for information about the molecule as the user was creating it in the interface. Therefore, I added two buttons in the "Molecule Properties" section that can be clicked to perform a cross-reference search. In fact, if the user clicks the Google icon button while viewing 2-acetoxybenzoic acid, the user will indeed see links to articles about aspirin.

Finally, two minor interface tweaks were implemented. One involves a more correct highlighting feedback of the atom to which a dragged skeletal element will be attached as it is dragged over that atom. The other involves cleaning up a previously occurring "ghost trace" phenomenon for the dragging of large molecules. Dragging the position of the molecule in the workspace is now clean.

Standards- Per normal, IUPAC nomenclature standards were followed. Of particular interest, the following substitution of common IUPAC names were introduced: "benzene-1-carboxylic acid" and "benzenecarboxylic acid" are now substituted with "benzoic acid" and "(1-formylethoxy)" is substituted with "acetoxy". The length of both chains is used for determining the main chain and the side chain in an ether linkage between two chains. In the future, more complicated rules may be introduced as tiebreakers and for molecules with multiple ether linkages.

Controls- The user feedback in the form of highlighting of the atom to be attached to when the user drags a skeletal attachment over an atom has been improved to be more accurate. Also, two new icon buttons are present: a Google icon button and a Pub Chem icon button. Clicking either will cause a search of the respective engine in a new browser window.

Future Considerations- Support for ester linkages will certainly be upcoming soon. Also with more and more reactions being supported now by the pathway search engine, it is apparent that a page in the interface to view the rules followed by these reactions would be very helpful for further understanding. Finally, per a previous future consideration, it is again apparent that the ability to add more complex radicals to a molecule in the interface would be very helpful. Aspirin could be created, for example, by dropping a phenol in the workspace, then dropping an acetyl group on the Oxygen, and finally dropping a carboxylic acid group on a carbon in benzene adjacent to the one containing the ether linkage.


* Note: As the IUPAC naming for aspirin considers the molecule as an acetyl group bonded by an ether linkage to benzoic acid as opposed to an ester linkage between a benzoic acid and an ethyl group, we do NOT need to add support for esters in this update. Ester support will be done in the future, certainly. 

Tuesday, August 1, 2017

Expansion to support common names for Home Page, Interface tweak to clarify reactant(s) and product(s) in pathway search engine

Release 2.7.3

Two minor updates have been made for this release. The drawing by molecule name feature of the Explore section of the Home Page was expanded to be more robust. The user can now enter common molecule names as well as the already supported IUPAC molecule names. There is now also feedback if the user enters a name that can neither be parsed as an IUPAC name nor is recognized as a common name for a molecule. The motivation was to encourage the user to explore molecules known more readily by common names, such as acetaminophen or Pyruvate, without needing to look up the IUPAC name. The second change was merely an interface clarification: the interface for the pathway solver now clearly marks which molecule is the product and which is the reactant for when the pathway search is performed.

Future Considerations - Currently the drawing by molecule name feature first attempts to parse the name as a valid IUPAC name. If this fails, it then searches the local system for a mapping of the name as a common name to an IUPAC name. In seems reasonable as a next step to expand the search to utilize a third party site for the common to IUPAC name mapping.



Tuesday, July 25, 2017

Introduction of Inspector docking mode and minor Interface tweak

Release 2.7.2

Per some user feedback, two changes have been made to the interface. The first change: the inspector has now been given a docking mode to allow the user to dock the inspector to the right of the workspace. The motivation being to match the preferences both of the user who wants the inspector to be tightly coupled with the atom it is currently viewing and the user who wants it to not be distracting to their process of interacting with the molecule. The second change is more of a tweak: after dragging and dropping a skeleton or addition segment on the workspace, the animation of it snapping back to its origin has been removed to reduce clutter.

Controls - The inspector can now be docked on the right of the workspace by clicking the right arrow in the top-right section. It can be un-docked (back to being displayed near the atom hovered over) by clicking on the left arrow when it is docked.

Friday, July 21, 2017

Addition of Discover section to Home Page

Release 2.7.1

The Discover section in the Home Page was implemented. In this section the user can select a reactant from a list of common organic molecules, select a reaction to perform on the reactant, and then click on the beaker to see the result of the reaction. The motivation of this feature is to show a light-weight implementation of what will eventually become a full-fledged feature: exploring hypothetical products created when specified reactions are applied to a reactant(s).

Standards - No new standards have been applied for this update: Standard IUPAC naming rules are still followed.

Controls - The Discover section was designed to be intuitive. The user selects a starting molecule from the drop-up list, selects a reaction from the drop-up list, and finally clicks the beaker icon to see the result.

Future considerations - The full-fledged feature will be designed to work with all reactants and reactions supported by the interface and the pathway search engine. Additionally, support for multiple products of the reaction and expected percentage of each will be in place.

Monday, July 3, 2017

Introduction of visual feedback for attaching atoms via drag and drop, Allowing attachment of skeletons, Minor bug fix

Release 2.7.0

The motivation of this update was to lay the groundwork for the user to create more complex molecules in the interface. One motivating example, in particular, was the creation of Tylenol.

The first feature comes in the form of a visual cue: the user will now have feedback when dragging an attachment over an atom as the atom to be attached to will change color. This color will be a hybrid of the particular atom's color and gray. The goal of this feature is to make it clear a) when a user has dragged an atom to the proper position and b) to which atom the new attachment will be attached. This is useful, for example when creating Tylenol as the attachments to the benzene are oriented at the para position, so it needs to be clear which Carbons in the benzene are being used.

The second feature is that users can now attach basic Carbon skeletons to the molecule as radicals. In the previous creation of Tylenol, the user would have to drag two consecutive Carbon atoms to create the acetyl group attached to the amine group. Now the user can simply drag one ethyl radical to the amine group from the alkanes section of the Skeleton panel on the left. In the future we plan to allow more complex groups/radicals to be attached as well.

Finally, a bug was fixed that occurred when extending a skeleton length from the right side of the skeleton.

Standards - No new standards have been applied for this update: Standard IUPAC naming rules are still followed with attachment of basic Carbon skeletons.

Controls - The controls hopefully have been simplified with this update. Users can now attach both skeletons from the left panel and individual atoms from the bottom panel. The visual cue should also make correct positioning of attachments easier.

Future Considerations - The exact detection of an attachment hovering over an atom MIGHT be changed in the future. Right now it's skewed a bit to the down right direction in order to allow the user to still see the atom to which the new attachment will be attached. This may be tweaked in the future. Plans are in place to allow even more complex radicals and potentially custom radicals to be attached. One motivating case would be allowing a Phenol group to be attached to simplify the creation of the Tylenol molecule even further.

Introduction of Bond Addition Tool

Release 4.6.1 With this update, the user is now able to add bonds of the single, double, and triple variety to the molecule as well as updat...