Saturday, August 23, 2014

Project Completion

I am very excited to say that my project for GSoC is complete! :)

I spent 5 days in Los Angeles at COMBINE 2014. I presented on August the 20th. Presentation link and video link are below.

Tuesday, August 5, 2014

The Final Week is here!

Hello all,

I have quite a bit to report on the advancement of my project.

My current checklist was as so:

1. Complete synchronization of CellDesigner plugin model and JSBML.
2. maintain map of SBases.
2. Finish Render Extension additions
3. Work on adding cases to Reaction positioning algorithm(main reaction axes over 4 points were never handled, very diverse minority of cases)

During the last meeting, it was found that Rules, UnitDefinition, Events, Constraints, Parameters, etc are not synchronized in CellDesigner. Also, it was also found that IDs for many CellDesigner PluginSBases can be changed, and are not constant. Therefore, we could not depend on Ids to synchronize the CellDesigner and JSBML models.

As such, a new algorithm was proposed for Changing and Deleting SBases.

If a PluginSBase(other than Models or Compartments) is changed or deleted, we:
1. delete all associated JSBML objects in Model and Layout
2. delete them from the Map of SBases
2. re-add them directly from the CellDesigner model.

This has been done for all CellDesigner PluginSBases, and as such, there is a thorough synchronization.
The map is also maintained properly.

On the Layout front, I FINALLY got reaction axes over 4 points to be read properly by my algorithm. There are still small bugs that need to be fleshed out, but I am happy a few downloaded models actually render 95%+ properly.

The above model did not render properly until main reaction axes over four points were handled. This is an excellent way to assure conformance to models "in the wild".

Adding render information has always been difficult due to the complexity of the Render Extension itself, so I have not been getting very far on that. But I hope tomorrow will be a better day for that.

Finally, my practice presentation for the final presentation is going to be on the 13th in preparation for COMBINE on the 20th. I will need to start creating some demos to show off the progress I have made this summer on improving the JSBML/CellDesigner plugin interface.

Monday, July 28, 2014

Synchronizing CellDesigner and JSBML, Contact with Akira and Checklist

Just a quick update since it is late here, but over the past week, I have been continuing with my synchronization of the JSBML/CellDesigner(CD) model representations. I have added a Map<PluginSBase, Set<SBase>>. The key is the CD object and all JSBML objects associated with the CD object.

Since establishing contact with the main developer of CellDesigner (Dr. Akira Funahashi), I have sent him an email detailing some questions I had regarding CellDesigner.

My questions to him:

1.  Is there is an accurate way to determine the reaction direction, be it North-South, East-West, etc? This answer will be very useful in determining the position of the Reaction text element, as it is calculated dynamically behind the scenes in CellDesigner.

2.According to the image below, when the CD user moves only a Reaction, nothing happens. One has to move a Species to send a Reaction SBaseChange event. This is unexpected and I would like some clarification on this if possible.

3. Some CellDesigner model files force CellDesigner to send SBaseChanged events every time one part of the model is changed. This is odd behavior, as if the whole model is changed when one small part is changed. It is even more odd considering as other models only send SBaseChanged events for PluginSBases that are edited by the user rather than an event for every PluginSBase in the model. 

Current checklist for myself:

1. Add Render information
2. setCharge()/ FBC. 
3. add reactiontext info, fix bugs
4. find species reference sbases in CellDesigner

Friday, July 18, 2014

Aftermath of 17/7 Meeting

I presented the slideshow below to Professor Funahashi (Akira), the main developer of CellDesigner, and my mentors at 15:00 UTC on 17/7/2014.

The presentation was a success because Akira was able to provide me with inside information and clarity to my work with CellDesigner. I asked questions at the end of the presentation which I will share answers with now:

Reaction text is calculated dynamically and hopefully, the algorithm will be provided to the team so we can also calculate reaction text in an identical way in JSBML. 

PluginModel objects are not constant. As such, using PluginModels as a key in a Hashmap is impossible. Therefore, we need to remove our HashMap in AbstractCellDesignerPlugin and simply convert one model at a time.

I am pleased by the progress at this meeting and have high morale. I expect a lot of progress in the next few days. 

Saturday, July 12, 2014

CellDesigner Reaction positioning and CellDesigner/JSBML synchronization

Over the past week, I have been working on two separate topics:

1. Complete algorithm that use the CellDesigner Plugin API to calculate positioning for ReactionGlyphs and SpeciesReferenceGlyphs.
2. Establish way to synchronize CellDesigner's plugin datastructure and JSBML (so that CellDesigner models will be immediately and accurately represented in JSBML)

The first point has been completed. ReactionGlyphs and SpeciesReferenceGlyph positioning has been accurately implemented. I still have loose ends to tie up, but I am proud that my algorithms do the "right thing" in a variety of situations.

On the second point, I have created a plugin that receives events from CellDesigner and displays them in a console. As you can see, when the position of a species or reaction changes, CellDesigner informs the console.

The next step is to update the currently selected model in JSBML automatically when it is edited by the user.

I did run into problems in the plugin implementation and I had a few small hang-ups in regards to getting consistent reaction coordinates, but things are progressing very well :)


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.

Thursday, June 26, 2014

Midterm Presentation

Here are my slides that I presented today for the midterm evaluation meeting:

Dr. Hucka linked me to some Layout Extension links that I should look into further. They are here:

"* Frank wrote an online SBML layout viewer:

* COPASI should support reading layout:

* There are more tools that mention SBML layout support, at"

Things are going well with my project. These are my future plans: