Wednesday, July 2, 2014

Calculating ReactionGlyph position in CellDesigner and new Plugin

CellDesigner does not make its Reaction position data available for developers to access. Therefore, we need to figure out how to determine Reaction size and position using our own algorithms.

We have two choices:

1. Create a BoundingBox with x,y, height and width. 
2. Create a Curve for both the ReactionGlyph and the SpeciesReferenceGlyphs. 
     -ReactionGlyph curve segment will be in the middle of the Reaction.
     -SpeciesReferenceGlyph curve segments will be coming off the center curve segment and pointing to SpeciesGlyphs, be it product, reactant, or modifier. 

The image above shows the difference between a ReactionGlyph and a SpeciesReferenceGlyph. The ReactionGlyph is the entire Reaction shape, while there are three SpeciesReferenceGlyphs which are separated by the small black circle, each leading to a SpeciesGlyph.

Reaction position would be trivial if all reactions looked like the one above. However, reactions that make up a CellDesigner model can come in any and all orientations and positions, like the image below.

As one can see, reactants, products, and modifiers are in all orientations respective to one another, which makes it very difficult to produce accurate position measurements. I have been working on this problem for a few days and still working on it.

While doing this, I have also started on writing a plugin that prints out CellDesigner information(PropertyChangeEvents). This also does not work as of now. However, I have my weekly group meeting tomorrow at 15:00 UTC which will hopefully put me on the right track regarding these issues.

No comments:

Post a Comment