Machine Learning For Formulations Containing Proteins

Tutorial Created with Software Release: 2026-2
Topics: Consumer Packaged Goods, Pharmaceutical Formulations, Polymeric Materials
Methodology: Machine Learning
Products Used: MS Formulation ML, MS Informatics, MS Maestro

Tutorial files

35 MB

This tutorial is written for use with a 3-button mouse with a scroll wheel.
Words found in the Glossary of Terms are shown like this: Workspacethe 3D display area in the center of the main window, where molecular structures are displayed

 

Tip: You can hover over a glossary term to display its definition. You can click on an image to expand it in the page.
Abstract:

In this tutorial, we will learn how to generate ML models using the Formulation Machine Learning panel to predict the firmness of protein-containing yogurt formulations. First, we will calculate protein descriptors that can be used alongside standard featurizers. Lastly, we will evaluate the performance of the generated models and examine feature importance.

Tutorial Content
  1. Introduction
  2. Creating Projects and Importing Structures
  3. Building a Machine Learning Model for Formulations Containing Proteins
  4. Conclusion and References
  5. Glossary of Terms

1. Introduction

A formulation is a multicomponent mixture created through a specific process and defined by the precise composition of its constituents. Measuring the properties of a formulation can be done via various methods, including traditional experimentation or physics-based simulations. However, machine learning (ML) models offer a computationally efficient alternative. These ML models can capture the intricate relationship between a formulation's composition and its properties with a significantly lower computational cost compared to physics-based approaches.

Protein formulations are vital across numerous sectors, including biopharmaceuticals, advanced drug delivery, sustainable packaging, bioplastics, food science, and personal care and cosmetics. To leverage the power of ML algorithms in optimizing these formulations, complex protein structures need to be translated into a usable format. Protein descriptors fulfill this role by acting as numerical fingerprints. They convert the raw amino acid sequences and 3D folding patterns of macromolecules into quantitative data, thus bridging the gap between the chemical complexity of proteins and the predictive capabilities necessary for effective formulation development.

In this tutorial, we will generate ML models using the Formulation Machine Learning panel to predict the firmness of protein-containing yogurt formulations. First, we will calculate protein descriptors that can be used alongside standard featurizers. Then, we will evaluate the performance of the generated models and examine feature importance.

2. Creating Projects and Importing Structures

At the start of the session, change the file path to your chosen Working Directorythe location where files are saved in MS Maestro to make file navigation easier. Each session in MS Maestro begins with a default Scratch Projecta temporary project in which work is not saved, closing a scratch project removes all current work and begins a new scratch project, which is not saved. A MS Maestro project stores all your data and has a .prj extension. A project may contain numerous entries corresponding to imported structures, as well as the output of modeling-related tasks. Once a project is saved, the project is automatically saved each time a change is made.

Structures can be built in MS Maestro or can be imported using File > Import Structures (or drag-and-dropped), and are added to the Entry Lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion and Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data. The Entry Lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion is located to the left of the Workspacethe 3D display area in the center of the main window, where molecular structures are displayed. The Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data can be accessed by Ctrl+T (Cmd+T) or Window > Project Table if you would like to see an expanded view of your project data.

  1. Double-click the Materials Science icon

Figure 2-1. Change Working Directory option.

  1. Go to File > Change Working Directory
  2. Find your directory, and click Choose
  3. Pre-generated files are included for running jobs or examining output. Download the zip file here: schrodinger.com/sites/default/files/s3/release/current/Tutorials/zip/ml_formulation_proteins.zip
  4. After downloading the zip file, unzip the contents in your Working Directorythe location where files are saved for ease of access throughout the tutorial

Figure 2-2. Save Project panel.

  1. Go to File > Save Project As
  2. Change the File name to ml_formulation_proteins_tutorial, click Save
    • The project is now named ml_formulation_proteins_tutorial.prj

3. Building a Machine Learning Model for Formulations Containing Proteins

In this section, we will use the Formulation Machine Learning panel to generate ML models for predicting the firmness of yogurt formulations. First, we will calculate protein descriptors that can be used alongside the standard featurizers. Finally, we will evaluate the performance of the generated models and examine feature importance.

Figure 3-1. Loading the training data into the Formulation Machine Learning panel.

  1. Go to Tasks > Materials > Informatics > Formulation Machine Learning
  2. For Formulation type, choose Simple
    • We want to train a model for predicting a single mixture instead of a blend of mixtures
  3. Click Load CSV, navigate to the provided files and select Section_03 > yogurt_formulations_input.csv, and click Open 
    • The training data set is loaded into the panel
    • You can find references for the data in the last column of the imported csv file

Figure 3-2. Visualizing the firmness distribution of the data set.

The formulations in this data set contain 1-2 proteins as well as one additive for a Calcium source (columns 1 to 3). The following columns display some properties of the formulations (pH, Temperature, etc).

The first two columns of the formulations , which contain the proteins, show missing SMILES for most formulations. Proteins are not easily described via SMILES strings.

  1. For View ingredient as, choose Labels
    • Now we can see the labels as defined in the data set
  2. For the plot on the right side, choose Firmness (mN) as the first of the  Properties to be displayed
    • The distribution of the firmness is shown for the imported training data set
    • We will generate a model for the prediction of the firmness of our yogurt formulations

Figure 3-3. Settings for building the model.

  1. Switch to the Build tab
  2. For Featurizers, choose MACCS Keys, Fingerprint, and User Input Features Only (3 items)
  3. For Machine learning models, choose Elastic Net, Random Forest, XGBoost, Support Vector Machine, and Dense Neural Network (5 items)
  4. For Target property, choose Firmness (mN) (1 item)
  5. For Formulation descriptors, choose pH and Temp (oC) (2 items)
  6. For Protein descriptors, click Define Proteins
    • The Link Missing SMILES to Proteins dialog box opens

You can find more information on featurizers and types of ML models in the Formulation Machine Learning Featurizer and Model Information documentation.

Figure 3-4. Linking the protein sequences to the labels.

The proteins used in the data set are: (Seq_A) Alpha-Casein, (Seq_B) Beta-Casein, (Seq_K) Kappa-Casein, (Seq_W) Beta-Lactoglobulin. Now we have to link the ingredients to either 3D structures or sequences.

  1. For Protein Input Type, choose Sequences
    • We are going to link the amino acid sequences for the proteins to their ingredients. It is also possible to link 3D structures from the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data instead.
  2. For Seq_A click Enter Sequence in the Action row
    • A new window opens
  3. Copy the sequence for protein A (Seq_A) from the provided file Section_03 > yogurt_protein_seq.csv and paste it into the the field for Sequence for Seq_A
  4. Click OK
  5. Repeat steps 13 to 15 for Seq_B, Seq_K, and Seq_W
  6. Click OK
    • A window informs you that 4 missing SMILES ingredients have been linked to protein sequences

Figure 3-5. Calculating protein descriptors and loading them as ingredient descriptors.

  1. Change the Job name to formulation_ml_calc_protein_descr
  2. Click Calculate Protein Descriptors
    • This job should take about 1 minute on a single CPU

Note: When the job is complete, no new entry group is added to the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion.

  1. A popup window appears, asking if you would like to load the calculated protein descriptors as ingredient descriptors. Click OK.

This job calculates the protein descriptors from the linked sequences or structures. Different descriptors are calculated for linked sequences or linked 3D structures. You can find a table of all descriptors along with a short explanation and references in the Protein Descriptors documentation.

Figure 3-6. Running the job.

  1. Change the Job name to formulation_ml_train
  2. Adjust the job settings () as needed
    • The job can be run on a single CPU and takes approximately 5 minutes to complete
  3. If you would like to run the job yourself, click Run. Otherwise, proceed with the provided results from the zip file.

Note: When the job is complete, no new entry group is added to the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion.

Figure 3-7. Loading the ML model.

  1. Upon completion of the calculation, click OK in the popup window. The ML Model Manager panel opens automatically and the trained model appears in the list.

If you want to load the provided model, switch to the Performance tab and click Load Model to open the ML Model Manager panel. Click Add Model, browse to Section_03 > formulation_ml_train > formulation_ml_train.mlform, and click Open.

  1. Select the formulation_ml_train entry and click OK
    • If you get a warning saying that the uploaded ML model was trained on an older version, feel free to click OK and proceed. If you wish to retrain the model, you can use the ML Model Manager panel.

Figure 3-8. Visualizing the results.

The plot contains predicted versus actual values from the train and test sets, along with the corresponding distributions of the data sets for both predicted and actual values. The table below shows corresponding R2 and RMSE values for both data sets.

In this case, the model generalized well on the test set, even though both the training and test sets were quite small (90 and 10 data points, respectively). This results in lower correlation (R2) and higher errors (RMSE). A larger data set would very likely improve the performance.

Figure 3-9. Calculating feature importance.

  1. Switch to the Feature Importance subtab
  2. Change the Job name to formulation_ml_feature_importance
  3. If you would like to run the job yourself, click Run. Otherwise, proceed with the provided results from the zip file.
    • This job should take about 1 minute on a single CPU
    • Feature importance is not available for Set2Set and Graph-based ML models

Note: When the job is complete, no new entry group is added to the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion.

Figure 3-10. Loading the model with the feature importance results.

Click Add Model, browse to Section_03 > formulation_ml_train > formulation_ml_train.mlform, and click Open.

  1. Click Load Model
  2. Click Add Model
  3. For loading the provided model, browse to Section_03 > formulation_ml_feature_importance > formulation_ml_train_xai.mlform, and click Open
  4. For loading your own model, browse to formulation_ml_feature_importance > formulation_ml_train_xai.mlform, and click Open
  5. Select the formulation_ml_train_xai entry and click OK
    • If you get a warning saying that the uploaded ML model was trained on an older version, feel free to click OK and proceed. If you wish to retrain the model, you can use the ML Model Manager panel.

Figure 3-11. Visualizing the feature importance.

  1. You can click on a descriptor name to view a description at the right
  2. You can use the arrow buttons below the plot to view more descriptors

Feature importance shows which descriptors play a significant role for the target property of the models. A positive mean |SHAP| (SHapley Additive exPlanations) value indicates that increasing this feature will likely increase the predicted property. Conversely, a negative value suggests that decreasing this feature will likely increase the predicted property. Some protein descriptors (features starting with UserDefined) are among the more important features. You can find a table of all protein descriptors along with a short explanation and references in the Protein Descriptors documentation.

Figure 3-12. Visualizing and comparing featurizer-model type pairs.

  1. Switch to the Model Comparison subtab

This histogram shows the 5-fold cross-validation R2 score, or the CV score, for all featurizer-model type pairs. The error bars show the minimum and maximum CV scores for pairs that appear more than once in the trained model ensemble.

4. Conclusion and References

In this tutorial, we learned how to generate ML models using the Formulation Machine Learning panel to predict the firmness of protein-containing yogurt formulations. First, we calculated protein descriptors that could be used alongside the standard featurizers. Lastly, we evaluated the performance of the generated models and examined feature importance.

For further learning:

For introductory content, focused on navigating the Schrödinger Materials Science interface, an Introduction to Materials Science Maestro tutorial is available. Please visit the materials science training website for access to 100+ tutorials. For scientific inquiries or technical troubleshooting, submit a ticket to our Technical Support Scientists at help@schrodinger.com.

For self-paced, asynchronous, online courses in Materials Science modeling, including access to Schrödinger software, please visit the Schrödinger Online Learning portal on our website.

For some related practice, proceed to explore other relevant tutorials:

For further reading:

6. Glossary of Terms

Entry List - a simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion

Included - the entry is represented in the Workspace, the circle in the In column is blue

Project Table - displays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data

Recent actions - This is a list of your recent actions, which you can use to reopen a panel, displayed below the Browse row. (Right-click to delete.)

Scratch Project - a temporary project in which work is not saved, closing a scratch project removes all current work and begins a new scratch project

Selected - (1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries

Working Directory - the location where files are saved

Workspace - the 3D display area in the center of the main window, where molecular structures are displayed