cxcalc integration

This manual gives you a walk-through on how to integrate your own calculations using cxcalc.

Introduction

Cxcalc is a command line tool that can perform chemical calculations in batch mode. It can invoke all calculations that are available in MarvinSketch, and since Marvin version 5.6 it can also run external services. As Marvin saves the configuration of the services into an XML file, services that were previously set can be used in cxcalc without any further setup. To execute the external service in cxcalc its name or the alias of the service can be used to execute it.

To see the help of a service calculation in cxcalc, execute the cxcalc <name> -h command, where name is the name of the calculation. As an example see the command line help for the hellomolecule command.

images/download/attachments/45331442/image2015-12-10_16_21_19.png

Fig. 1 The command line help of the hellomolecule service called from cxcalc

To execute the hellomolecule calculation run the cxcalc hellomolecule <input file/strings> command. It will run the calculation with the default settings. To run the calculation in batch mode you should simply replace the single molecule parameter with an input file. An example could be:

images/download/attachments/45331442/image2015-12-10_16_26_11.png

Fig. 2 The hellomolecule service called for the etanol molecule

The parameters of the calculation can be set using the --<parameter_name> <parameter value> command line options. For example to output molecule names you can use the name:t format option:

images/download/attachments/45331442/image2015-12-10_16_41_54.png

Fig. 3 The hellomolecule service called in batch mode

Accessing parameters

The following example illustrates the connection between the service and cxcalc parameters. In this case we want to calculate the number of microspecies at a give pH for a molecule.

images/download/attachments/45331442/image2015-12-10_16_48_34.png

Fig. 4 The service cxcalc connection

As already mentioned before, the default service and parameter names can be defined using the @Alias annotation:

@Alias(name="MSCount", params={"mol", "pH"})
@Description("Counts microspecies of the given molecule at " +
"given pH.")
public Integer getMicrospeciesCount(Molecule mol, Double pH)

The default settings can be overwritten during the set-up. Next we will modify the name and parameter names of the MSCount calculation.

images/download/attachments/45331442/image2015-12-11_11_29_57.png

Fig. 5 Modifying the MSCount calculation

After the modification the calculation is also accessible as MSC, and the -pH command line parameter can also be referred to as --H, too.

images/download/attachments/45331442/image2015-12-11_11_58_22.png

Fig. 6 Using the new parameters

If no pH parameters are set, the default is used. (pH 7.4)

Additional cxcalc parameters

Calculated properties can also be stored as a molecule property:

images/download/attachments/45331442/image2015-12-11_12_3_3.png

Fig. 7. Storing calculated properties as a molecule property

The visualized result is:

images/download/attachments/45331442/image2015-12-11_12_5_0.png

Fig. 8. Visualized molecule with the stored properties

Built-in and external calculations can be called at the same time, too.