Calculable Properties

You can use PilotScript to calculate properties from the data records.

See Also
PilotScript Reference

Calculable Properties

PilotScript can calculate properties on-the-fly, if they are not defined in the data record. These types of properties are known as calculable properties. They are used by custom manipulator and filter components and are referred to in a PilotScript expression. For example, if the expression AlogP > 2 is entered in a Custom Filter (PilotScript) component, then AlogP is calculated automatically before the data record is evaluated. If a value already exists on the property list for a given property, the stored value is used to evaluate the data record, rather than the calculated one.

For a property to be calculated on-the-fly, the following conditions must be met:

  • The property name must not already exist on the data record.
  • The property name must be a registered calculable property.
  • A suitable data object (for example molecule) must also be associated with the data record so the property can be calculated.

For example, the conditional statement is:

IF Num_Atoms > 200 THEN ...

In this case, this Num_Atoms is a registered calculable property and the component knows how to calculate the number of atoms from molecular data. Provided that the data record has an associated molecule object, the property is calculated and added to the data record. Then the property value comparison proceeds.

Note:

By default, calculated properties are discarded after the custom manipulator and filter components releases the record. To keep these properties, set the parameter Keep Calculated Properties to "True".

To view a list of registered calculable properties, press F4 from the PilotScript expression editor. A list of registered calculable properties is displayed. This list includes both the registered properties and custom calculable properties stored in your "User Name" tab.

If other client users are working on the server, they may be creating components that register calculable properties (via an "output" parameter). These calculable properties are added to the database on the server, and they are available for any client user's expressions. To display any new calculable properties that were recently added to the server, press F7.

In addition to on-the-fly calculation, there are other ways to calculate properties, including:

  • Use the Calculate() function
  • Use calculator components available in the Chemistry collection
  • Use models created with Learners. They become calculable properties as soon as they are created and behave like any other calculable property.

Note: If a parameter named Output is added to a component, the value of the parameter becomes a calculable property.