Model modifiers

A model modifier takes a model as input (and in some cases some parameters), and constructs a modified version of the model. The parameter string depends on the type of modifier, see the specific documentation of available modifiers for details. The syntax for these parameter string is shared between command line and scripting modes, as well as in the Java API.

Command line use

Model modifiers can be called from the command line after selecting the loaded model, using the -m modifier[:parameters] switch. The modifier is identified by its name and can be provided with parameters, see the documentation of individual modifiers for detail on their parameters (if any). For example the arguments -m booleanization will generate a booleanized model (this modifier takes no argument). The -m perturbation:A%0 arguments will apply a perturbation corresponding to the knockout of component A (setting its target value to 0). Some examples are shown below, see the command line documentation page for more.

  • Modifiers can be chained on the command line.

  • Perturbations are available directly with the -p A%0 shortcut (instead of -m perturbation:A%0).

Apply a knockout perturbation before saving the model:

java -jar bioLQM.jar model.sbml -p A%0 modified.sbml

Booleanize and save a model:

java -jar bioLQM.jar model.sbml -m booleanize model_bool.sbml

Chain the previous modifiers:

java -jar bioLQM.jar model.sbml -p A%0 -m booleanize modified.sbml

Scripting

In scripts, model modifiers are available through the lqm.modifyModel method which takes 3 arguments: the model, the name of the modifier, and the parameters.

model = lqm.loadModel("model.sbml")
modified = lqm.modifyModel(model, "perturbation", "A%0")

Java API

Modifiers, like other services, are available by name or by type from static methods in the LQMServiceManager class. While retrieving a modifier by name is convenient in command line and scripting modes, using the class is encouraged from java code as it enables compile-time checks and directly returns an object of the right type (without casting). All modifier services have a getModifiedModel(LogicalModel model, String parameters) method, where the parameters depend on the type of modifier and are the same as on the command line and scripting case. Services can provide additional methods. See the documentation of individual modifiers for details.

LogicalModel model = LQMLauncher.loadModel("model.xml", "sbml");
ModelBooleanizerService boolService = LQMServiceManager.getModifier(ModelBooleanizerService.class);
LogicalModel modified = boolService.getModifiedModel(model);

Implementation

Model modifiers implement the ModelModifier interface, and are accessible throught a dedicated ModelModifierService. Services are discovered by using the @MetaInfServices(ModelModifierService.class) decorator. Some implementors may provide additional methods on the service to facilitate the construction of the modifier instance.