Develop Custom Method

In addition to the available decomposition methods, you can implement a custom method and use it for subsequent model exploration. Within the LMME source code, the decomposition methods can be found in the org.vanted.addons.lmme.decomposition package. To implement a new method, you only need to extend the abstract class MMDecompositionAlgorithm. We first describe the abstract class and then point you to some classes and data structures that may be used for your implementation.

The abstract class MMDecompositionAlgorithm

The heart of the algorithm is going to implemented in the method runSpecific(HashSet<Node> alreadyClassifiedNodes). The argument is a list of nodes that have already been assigned to a subsystem, e.g. the transporter subsystem. The return type of this method is ArrayList<SubsystemGraph>. So during the algorithm, you need to create one SubsystemGraph (see below) per subsystem and finally return them as ArrayList. Keep in mind that the cloning procedure will take place before your algorithm is executed.

The methods requiresCloning() and requiresTransporterSubsystem() need to return the respective boolean value. Through these, it is controllen, whether the cloning procedure and the transporter subsystem construction take place (before your algorithm) or not.

The methods getFolderPanel() and updateFolderPanel() are used to provide the settings for a user. For more information on these, see either the Vanted documentation or the swing documentation by Oracle®.

The method getName() should only return the name of the method in order to refer to it within the LMME user interface.

Further Classes

We now point you to a few further classes that are relevant for your implementation.

The BaseGraph

The class BaseGraph, located in the package org.vanted.addons.lmme.graphs, contains the graph representation of the model under investigation. To access the current base graph, use LMMEController.getInstance().getCurrentSession().getBaseGraph(). The entire graph may be accessed, calling getGraph() to the BaseGraph object. To access it's species nodes, call getSpeciesNodes() on the BaseGraph object and to access its reaction nodes, use getReactionNodes().

A SubsystemGraph

In order to create the decomposition, your algorithm needs to return an ArrayList of SubsystemGraphs. The class SubsystemGraph is located in the same package org.vanted.addons.lmme.graphs. It has a constructor

  SubsystemGraph(String name, HashSet<Node> speciesNodes, HashSet<Node> reactionNodes, HashSet<Edge> edges)

which may be used to create a subsystem. You need to provide a name, and the nodes and edges that belong to the subsystem to be created. The reason for the edge list is that it may happen that you do not want a subsystem to have the edge set induced by the nodes, but only a subset of the possible edges.

In addition, nodes and edges can be added to a subsystem using the methods addSpecies(Node speciesNode), addReaction(Node reactionNode), and addEdge(Edge edge), respectively. These may be helpful if a subsystem is constructed incrementally.

If you need more information, just explore the available methods available in the package. They're all implemented as extension of the abstract class MMDecompositionAlgorithm.