GeinQSAR Studio
Home › Predicting new compounds

Predicting new compounds

Applying a model to compounds without a measurement: fitting one on a training set or reading a saved bundle, what the bundle carries, and the domain verdict of every prediction.

Wizards > Predict with a saved model opens the Predict new compounds wizard. Despite the menu name it does two things: it applies a model saved earlier, or it fits a model on a training set and applies it to a second file in one workflow. Either way the result is a dataset of predictions in the spreadsheet, each with its applicability-domain verdict, and optionally a CSV and an SD file.

Model source

The first page. Fit on a training set is chosen, so the wizard has six steps and asks for the task. With Apply a saved model the steps Training set and Model are greyed out and four remain.
The first page. Fit on a training set is chosen, so the wizard has six steps and asks for the task. With Apply a saved model the steps Training set and Model are greyed out and four remain.
ControlMeaning
Fit on a training setA model is fitted in this workflow on a training file and applied to the compounds to predict. Every usable record of the training file trains the model: there is no split and no validation here. Build and validate a model in the 2D-QSAR wizard first when you need its statistics.
Apply a saved modelReads a model file: a 2D model bundle (.json, written by the 2D-QSAR wizard, by this wizard, by a Write model node or by the command line) or a 3D-QSAR model (.gqfm). Nothing is refitted.
TaskFit only: Regression or Classification.
Model file, BrowseSaved model only: the file to apply.
ContentsSaved model only: what the file holds, read from it, for example "Pipeline (PLS (NIPALS, 2 LV)) · 3976 descriptors · predicts pIC50 · applicability domain". A response transform is named when the model has one. A file that cannot be read is reported here in red.

What a saved model bundle carries

A 2D bundle holds everything needed to treat a new compound exactly as the training compounds were treated:

Because the transforms travel with the model, nothing is refitted and no statistic of the new compounds influences their predictions. The record of the fitted rows lets a later prediction or validation warn when a compound it is given as new was part of the fit.

Fitting a model here

With Fit on a training set the wizard asks for the training data, the compounds to predict, the descriptors and the model.

The Training set page: the same data controls as the 2D-QSAR wizard, here with the 429 compounds of the acetylcholinesterase sample and their pIC50 distribution, and Duplicates set to Merge.
The Training set page: the same data controls as the 2D-QSAR wizard, here with the 429 compounds of the acetylcholinesterase sample and their pIC50 distribution, and Duplicates set to Merge.

Duplicates (Merge, Keep the first, Keep all) applies to the training set only. The compounds to predict are never merged or dropped: every row of that file gets a prediction. Convert concentration to p-scale and its Conversion options work as in the 2D-QSAR wizard.

The Model page. Recipe starts on PLS with fingerprints, tagged Default; the model and its hyper-parameters are shown as controls (Components 0 means chosen by cross-validation, at most 10, by Maximum Q2), followed by a one-line summary, Reset to defaults, and the preprocessing inside the model.
The Model page. Recipe starts on PLS with fingerprints, tagged Default; the model and its hyper-parameters are shown as controls (Components 0 means chosen by cross-validation, at most 10, by Maximum Q2), followed by a one-line summary, Reset to defaults, and the preprocessing inside the model.

The Recipe drop-down offers the recipes of the 2D-QSAR wizard except Automatic model search, with the default of the task marked (recommended): PLS on classical descriptors and fingerprints for a measured value, a random forest of 500 trees with balanced class weights for a class column. The recipe sets the descriptor families, the model with its hyper-parameters, the preprocessing inside the model and the applicability domain, and every value is shown on the page. Choosing another Model or changing a hyper-parameter turns the recipe into Custom. Below the hyper-parameters, Missing values, Outlier limits, Descriptor filter, Descriptor scaling, Applicability domain and Domain methods have the meaning described in The 2D-QSAR wizard. There is no preprocessing node in the workflow: the model fits its own preprocessing on the training set and applies it, unchanged, to the compounds it predicts.

The compounds to predict

Compounds to predict, when a model is fitted here. The file needs structures only; the preview shows its first records.
Compounds to predict, when a model is fitted here. The file needs structures only; the preview shows its first records.
The same page when a saved model is applied: step 2 of 4, the Training set step greyed out in the list on the left.
The same page when a saved model is applied: step 2 of 4, the Training set step greyed out in the list on the left.
ControlMeaning
Measured activities availableThe file also holds measured values of the response. Each prediction is then written next to its measurement with its residual, which turns the prediction into an external validation. Off: no activity column is needed.
Dataset, Browse, Sample data, BuildThe compounds, as on the Data page of the 2D-QSAR wizard. A saved model is applied to the dataset you are working with unless you choose another.
Structure column, Name columnFor tables.

Descriptors

The Descriptors page when a model is fitted here: the structures are standardised and the 22 families of the recipe are ticked. Both sets are curated identically before the descriptors are computed.
The Descriptors page when a model is fitted here: the structures are standardised and the 22 families of the recipe are ticked. Both sets are curated identically before the descriptors are computed.
The Descriptors page for a saved model, with the line Matched to the model by name under the family list.
The Descriptors page for a saved model, with the line Matched to the model by name under the family list.

Standardize structures curates the compounds before their descriptors are computed, with the steps under Standardization options. For a saved model, curate the new compounds the way the training set of the model was curated, or their descriptors will not be comparable.

The descriptors of a saved model are matched by name. The selection only has to contain the columns the model was fitted on; extra columns are ignored. A descriptor the model needs and the selection lacks stops the prediction with its name. Select the families the model was built on, which is what the wizard pre-sets for a model of a recipe.

Output

The Output page of the prediction wizard. With Keep only in-domain compounds left off, every compound is written with its domain verdict, which is usually what a reader of the predictions needs; tick it to drop the compounds outside the domain from the files.
The Output page of the prediction wizard. With Keep only in-domain compounds left off, every compound is written with its domain verdict, which is usually what a reader of the predictions needs; tick it to drop the compounds outside the domain from the files.
OptionResultDefault and when to use it
Save the fitted model, Model fileFit only: writes the model as a bundle that this wizard, the canvas and the command line can apply to another library later.Off. Tick it unless the model is a one-off.
Keep only in-domain compoundsDrops the compounds the applicability domain flags.Off: they are kept and flagged. Tick it for virtual screening, where an unreliable prediction is worse than none.
Back-transform to the original scaleAdds the prediction on the original concentration scale as a column of the CSV file. Shown when the model has a response transform.Off.
Prediction optionsThe remaining parameters of the prediction node, such as which rows to predict (all rows by default).
CSV file, Predictions file, CSV optionsOne row per compound: the prediction, its standard error, the measured value and residual where known, and the domain verdict with its reasons.On.
SD file, Structures file, SD field namesThe structures with the prediction, its standard error and the domain verdict as data fields. Needs structures, so it is not available for predictions made from a descriptor table alone.Off.

Predict builds the workflow and runs it.

The result

The predictions open as a dataset in the spreadsheet, with the structures of the predicted compounds, and a notification gives the number of predictions (per class for a classifier) and how many lie inside the applicability domain. A second run of the same workflow replaces the dataset of the first one.

ModelColumns
RegressionPredicted; with measured activities Observed and Residual (observed minus predicted); Standard error when the model estimates one (a Gaussian process, for example).
ClassifierPredicted class by its label; Observed class when the file has one; one probability column per class, P(label). A classifier without probabilities shows its decision values instead, one column Decision A vs B per pair of classes.
BothDomain: inside or OUTSIDE, and Domain reason: the methods that flagged the compound.
The predictions of a hERG classifier for 100 compounds, opened as a dataset: each row has its structure and its Predicted class by label (non_blocker, blocker); the probability and domain columns follow to the right.
The predictions of a hERG classifier for 100 compounds, opened as a dataset: each row has its structure and its Predicted class by label (non_blocker, blocker); the probability and domain columns follow to the right.

Reading the domain verdict

Every prediction carries the verdict of the applicability domain fitted with the model, with the same methods and thresholds and the same rule for combining them (see The model dashboard, Domain). A compound inside the domain resembles the training compounds in the space the domain measures, and its prediction can be expected to be about as good as the cross-validated predictions of the model. A compound outside it is an extrapolation. It is not dropped unless you asked for that; it is reported with the reason, for example a leverage above h* (the compound is structurally unlike the training set in the model's own descriptor space) or a kNN distance above the threshold (it has no close neighbour among the training compounds).

3D-QSAR models

A saved 3D-QSAR model (.gqfm) is chosen as the model file like a bundle. The wizard then has three pages: the model file, the compounds and the output. The file records how the compounds of the model were prepared, aligned and charged, and the new compounds go through exactly those steps. See The 3D-QSAR dashboard for saving such a model.