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
|
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
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
- Introduction
- Creating Projects and Importing Structures
- Building a Machine Learning Model for Formulations Containing Proteins
- Conclusion and References
- 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.
-
Double-click the Materials Science icon
- (No icon? See Starting Maestro)
- Go to File > Change Working Directory
- Find your directory, and click Choose
- 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
- After downloading the zip file, unzip the contents in your Working Directorythe location where files are saved for ease of access throughout the tutorial
- Go to File > Save Project As
-
Change the File name to ml_formulation_proteins_tutorial, click Save
-
The project is now named
ml_formulation_proteins_tutorial.prj
-
The project is now named
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.
-
Go to Tasks > Materials > Informatics > Formulation Machine Learning
- The Formulation Machine Learning panel opens
-
For Formulation type, choose Simple
- We want to train a model for predicting a single mixture instead of a blend of mixtures
-
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
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.
-
For View ingredient as, choose Labels
- Now we can see the labels as defined in the data set
-
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
- Switch to the Build tab
- For Featurizers, choose MACCS Keys, Fingerprint, and User Input Features Only (3 items)
- For Machine learning models, choose Elastic Net, Random Forest, XGBoost, Support Vector Machine, and Dense Neural Network (5 items)
- For Target property, choose Firmness (mN) (1 item)
- For Formulation descriptors, choose pH and Temp (oC) (2 items)
-
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.
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.
-
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.
-
For Seq_A click Enter Sequence in the Action row
- A new window opens
-
Copy the sequence for protein A (Seq_A) from the provided file
Section_03 > yogurt_protein_seq.csvand paste it into the the field for Sequence for Seq_A - Click OK
- Repeat steps 13 to 15 for Seq_B, Seq_K, and Seq_W
-
Click OK
- A window informs you that 4 missing SMILES ingredients have been linked to protein sequences
- Change the Job name to formulation_ml_calc_protein_descr
-
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.
- 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.
- Change the Job name to formulation_ml_train
-
Adjust the job settings (
) as needed
- The job can be run on a single CPU and takes approximately 5 minutes to complete
- 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.
- 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.
-
Select the
formulation_ml_trainentry 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.
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.
- Switch to the Feature Importance subtab
- Change the Job name to formulation_ml_feature_importance
-
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.
Click Add Model, browse to Section_03 > formulation_ml_train > formulation_ml_train.mlform, and click Open.
-
Click Load Model
- The ML Model Manager panel opens
- Click Add Model
-
For loading the provided model, browse to
Section_03 > formulation_ml_feature_importance > formulation_ml_train_xai.mlform, and click Open -
For loading your own model, browse to
formulation_ml_feature_importance > formulation_ml_train_xai.mlform, and click Open -
Select the
formulation_ml_train_xaientry 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.
- You can click on a descriptor name to view a description at the right
- 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.
- 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 more machine learning:
- Machine Learning Property Prediction
- Machine Learning for Materials Science
- Molecular Dynamics Descriptors for Machine Learning
- Machine Learning for Sweetness
- Cheminformatics Machine Learning for Homogeneous Catalysis
- Machine Learning for Formulations
- Applied Machine Learning for Formulations
- Optimization of Formulations Using Machine Learning
- Optimizing Viscosity and Cost in Formulations with Missing Structural Data
- Machine Learning for Ionic Conductivity
- Optoelectronics Active Learning
- Periodic Descriptors for Inorganic Solids
- For relevant physics-based workflows:
For further reading:
- Help documentation on the Formulation Machine Learning panel
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















