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.
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:
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:
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 given pH for a molecule.
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.
After the modification, the calculation is also accessible as MSC, and the -pH command line parameter can also be referred to as --H, too.
If no pH parameters are set, the default is used. (pH 7.4)
Calculated properties can also be stored as a molecule property:
The visualized result is:
{info} Built-in and external calculations can be called at the same time, too.