Thursday, August 21, 2014

Project Wrap-up

The Google Summer of Code program is over. I had an amazing time working on this project. I really enjoyed working in this project and I am thankful for this opportunity. I am happy with my results and, hopefully, I can continue to contribute to the community. In summary, this summer I implemented:
  • Arrays package: I implemented the arrays extensions in JSBML, and this allows people to create regular structures more efficiently. I think the extension is quite straightforward to use. I got the impression some people were confused as to what the arrays package is. People might misinterpret the package, thinking that it is a container that can be populated with objects. This is wrong. An arrayed object indicates you have many copies that share similar attributes.
  • Validation: I implemented a routine that validates arrayed models. The most recent specification defines a set of validation rules that models extending arrays must not violate. Just to be clear, the most recent specification is not yet up on the web, but you can find it in the svn repository. I think the specification has come to a stable point, though changes are not discarded. Validation will be required to update on a regular basis to accommodate the changes in validation rules.
  • Flattening: I implemented a routine that flattens out array constructs. Models do not necessarily need to handle arrays if they flatten the model beforehand. This makes arrays support easier. Flattening arrays makes sense because if you say you have an array of species S, you are actually saying that you have n copies of S, where n is the size of the array. You can inline the objects, which eliminates array constructs.
In summary, I would say that the arrays package seemed easy at the beginning. I was able to implement the extension fairly quick, which gave me the false impression I would run out of things to do in the summer. I could not be more wrong! The extension is simple, but flattening and validation can be quite tricky since arrays have many implications on the math.

We, the students who were participating in the program and that were working with the JSBML team, got the opportunity to share our projects with the community at COMBINE. The slides I used can be found here. I think everything went quite well. Yusef and Victor did a really good job; their project were quite amazing and they did great in their presentations.

I thought it would be interesting to create big models in SBML using the arrays package. Without arrays, this task would be very tedious, but I managed to create this models fairly easily. I created these arrayed models in iBioSim. I believe the flattened models could be used for performance analysis; how fast does a certain simulation tool performs. Also, it would be interesting to use the flattened models to test the new implementation of the ASTNode that Victor has done compared to the old structure.

This model has 1000 assignment rules, 1000 parameters x, 1000 parameters y.

This model has 1000 reactions, 1000 species a, 1000 species b, and 1000 species c.

This model has 5000 parameters, 10000 events.

Any comments, suggestions, or questions, please don't hesitate to contact me!

Monday, August 11, 2014

Weekly Log: August 04 - August 10

This week I focused on my final presentation and finishing up the last pieces of the arrays package. I fixed some bugs I found and also finished the compiler I wrote for evaluating vectors. Now that GSoC is coming to an end, I am taking this week to polish my code and improve documentation. However, the main focus of the past week is to prepare myself for the presentation the JSBML students have with the mentors.

Monday, August 4, 2014

Weekly Log: July 28 - August 3

This week I have been mainly working on two things: validation and final presentation. The arrays package turned out to be more difficult than I was anticipating. The package itself is very straightforward, but validating and flattening a model is not so easy mostly because of all the math implications. Last week I changed the flattening routine to reflect two changes: one is that implicit sizes are going to be disallowed and second I had the wrong interpretation of reaction and species reference with dimensions.

By implicit sizes, we mean that if a variable is an array, say X, and we want to give an initial assignment to X, then the right-hand side must be evaluated to a scalar. If the right-hand side evaluates to a vector, then it must be the case that X has Dimension objects where the dimension sizes match the assigned vector dimension sizes.

Reactions and events are kind of tricky so I made a special case for both. The problem of these SBase objects is that they have children that can have Dimension objects or have vector MathML. For instance, events have trigger/delay/priority which can be vectors. In addition, events have event assignment objects that are allowed to have a list of Dimensions. Reactions have KineticLaw objects which can also be a vector. Furthermore, reactions have SpeciesReference objects which can be an array. The tricky part which I hadn't considered was the case where species reference and reaction are arrays and species reference have ids. Since species reference cannot have duplicate id, I had to make the flattened species reference id to take both the parent reaction's index value and the species reference index value to ensure uniqueness.

Finally, I started making the slides for my final presentation. The final presentation will be an important factor to decide whether or not I pass my final Google Summer of Code evaluation. We, the students and mentors, will have a joint meeting next week, so I need to practice my presentation throughout this week. This presentation will serve as a practice for a talk every student will give at COMBINE.