Source-linked AI summary
Novel hybrid protein scaffold gap filling using weighted machine learning ensemble, beam search, and mass-constrained reranking
Tahmid Enam Shrestha, Md. Manzurul Hasan, Md. Rafiqul Islam
TL;DR
Protein scaffold gap filling must infer missing amino acid regions from incomplete sequences under known-size or known-mass constraints. The paper combines masked-residue machine learning, weighted ensembling, beam search, homologous retrieval, and mass-aware reranking, achieving strong residue and gap reconstruction results. The findings support integrating local sequence learning with homologous and biochemical evidence, while evaluation remains limited by small known-mass coverage and dependence on homologs.
Problem
Protein scaffold gap filling asks how to reconstruct missing amino acid sequences when either gap size or total gap mass is known.
Method
The framework combines masked 11-mer residue prediction, validation-accuracy-weighted ensembling, beam search, homologous candidate retrieval, and hybrid mass-constrained reranking.
Results
95.41% validation accuracy, 87.50% known-size exact-match accuracy, and 100% top-5 recovery across seven CAH2 known-mass cases were reported.
Takeaways & Limitations
Combining local sequence context, homologous evidence, peptide mass constraints, and biochemical validation can reconstruct missing protein regions.
Takeaways & Limitations
Known-mass evaluation used only seven CAH2 cases, and performance may degrade when few homologous sequences are available.
Abstract
from arXiv · showhide
Protein scaffold gap filling is an important computational task in protein sequence reconstruction, where missing amino acid regions must be inferred from incomplete scaffold information. This study proposes a hybrid machine learning and mass constrained reranking framework for protein scaffold gap filling under known-gap-size and known-gapmass settings. Homologous protein sequences from MabCampath, P5A proteoform, and carbonic anhydrase 2 were used to generate masked 11-mer residue-level samples and fullgap evaluation cases. The residue prediction task was formulated as a 20-class amino acid classification problem using first-, middle-, and last-position masking. Multiple classical machine learning models were trained using raw encoded, row-average, and SVD-reduced features, and the strongest models were combined through a validation-accuracy-weighted ensemble. For known-size gap reconstruction, beam search was used to generate complete missing peptide sequences from residue-level probability estimates. For known-mass reconstruction, mass-constrained homologous candidate retrieval was combined with hybrid reranking based on mass validity, homologous frequency, context support, ensemble likelihood, mass error, and length penalty. The proposed framework achieved 95.41% residue-level validation accuracy, 87.50% known-size exact-match accuracy, and 100% top-5 recovery on seven CAH2 known-mass benchmark cases. These results indicate that the proposed framework can effectively reconstruct missing protein regions by integrating local sequence learning, homologous evidence, peptide mass constraints, and biochemical validation.
Author summary
The study addresses protein scaffold gaps by combining machine learning, sequence evidence, beam search, and biochemical constraints. This framework predicts residues and reconstructs complete missing regions, including known-mass CAH2 gaps.
- The framework combines multiple machine learning models, sequence-based candidate retrieval, beam-search decoding, and biochemical validation.
- Masked protein segments train models to learn how neighboring residues influence missing amino acids.
- Known-length gaps are reconstructed by generating and ranking complete candidate sequences with beam search.
- Known-mass reconstruction uses mass agreement, homologous frequency, contextual support, predicted likelihood, and expected length.
- The framework accurately predicted individual residues, reconstructed complete regions, and recovered all evaluated known-mass CAH2 gaps.
1 Introduction
Protein scaffold gap filling reconstructs amino acid regions missing from incomplete sequences, with separate known-size and known-mass variants. The proposed system combines complementary modeling and biochemical constraints to address limitations of single-method approaches.
- Protein scaffold gaps arise in incomplete sequences and affect applications including antibody profiling, proteoform analysis, drug design, and vaccine design.
- Known-size reconstruction predicts missing residues when gap length is given, whereas known-mass reconstruction predicts sequences from total mass without precise size.
- Existing approaches trade off speed, gap and motif handling, homolog dependence, data requirements, and mass-constraint compliance.
- The proposed framework integrates local context learning, homologous information, peptide mass constraints, and biochemical analysis across both problem variants.
- The system uses masked 11-mer 20-class prediction, an accuracy-weighted ensemble, beam search, and hybrid mass-aware reranking.
- Reconstructed gaps are evaluated with predictive metrics and biochemical measures including mass error, composition similarity, and BLOSUM62 similarity.
2 Literature Review
Prior work progressed from classical machine learning and probabilistic methods to deep, generative, mass-aware, and retrieval-augmented approaches. This literature establishes both the scaffold-filling benchmarks and the value of combining sequence modeling with biochemical constraints.
- Earlier scaffold-filling work defined known-gap-size and known-gap-mass variants and established benchmark datasets including MabCampath, CAH2, and P5A.
- Multiple-gap filling introduced a more difficult combinatorial setting, while convolutional denoising autoencoders brought neural reconstruction to scaffold filling.
- Generative models, including GPT-2, achieved 100% accuracy on the MabCampath benchmark for local gap completion.
- Protein language models such as ESM-2 and ProtTrans provide pretrained sequence representations for feature extraction and transfer learning.
- The field combines classical, probabilistic, deep, generative, mass-constrained, protein-language, and retrieval-augmented approaches.
3 Methodology
The methodology presents a workflow for protein scaffold gap filling that combines machine learning with sequence and mass-based evidence. The workflow is framed as the architecture underlying the proposed reconstruction system.
- The proposed architecture is presented as a workflow diagram for protein scaffold gap filling.
- The methodology section uses the workflow to organize the proposed protein scaffold gap-filling framework.
3.1 Data Collection
The study assembled homologous protein data and derived masked residue-level and full-gap evaluation samples for scaffold gap filling. It also defined seven CAH2 known-mass benchmark cases.
- Protein sequence sources: 2992 homologous sequences from MabCampath, P5A proteoform, and CAH2 supported dataset construction.The collection included 992 MabCampath, 1000 P5A, and 1000 CAH2 training sequences.
- Dataset composition: The dataset included target sequences, homologous training sequences, and a de novo CAH2 scaffold sequence.MabCampath and CAH2 target lengths were 214 and 260 amino acids, respectively.
- Sample generation: 150,000 masked residue-level samples and 14,960 full-gap evaluation samples were generated.Residues were masked at first, middle, and last positions, with removed subsequences serving as full-gap ground truth.
- Known-mass evaluation: Seven CAH2 known-mass cases provided benchmark targets for mass-constrained candidate retrieval and ranking.The target masses ranged from 420 Da to 1318 Da and had corresponding ground-truth peptide sequences.
3.2 Data Preprocessing
Preprocessing cleaned and encoded protein sequences, generated masked and full-gap samples, and prepared mass-valid candidates for the known-mass task.
- Sequence cleaning: Input sequences were parsed, cleaned, uppercased, and restricted to the 20 canonical amino acids.FASTA headers, whitespace, invalid characters, and non-canonical residues were removed.
- Sequence encoding: Amino acids were integer-encoded from 1 to 20, while the gap character was encoded as 0.The coding converted masked protein fragments into numerical features for classical machine learning.
- Masked-sample construction: Sliding 11-mer windows produced three masked variants by masking the first, middle, or last residue.The excluded residue became the supervised prediction target.
- Full-gap evaluation: Full-gap samples stored removed subsequences as ground truth alongside flanking context, gap size, and gap mass.A total of 14,960 full-gap evaluation samples were generated.
- Mass-constrained preparation: Known-mass preprocessing retained homologous subsequences whose computed peptide mass matched the target within a predefined tolerance.Candidates were subsequently evaluated with frequency, mass validity, ensemble likelihood, length penalty, and flank compatibility.
3.3 Feature Engineering
Feature engineering represented masked local sequence context in three ways and computed candidate-level attributes for known-mass reranking.
- Residue-level features: The machine-learning branch compared raw encoded, row-average, and SVD-reduced 11-mer representations.Raw features preserved positional information, row averages compressed each 11-mer, and SVD reduced samples to five components.
- Raw encoding: Raw encoded features represented each masked 11-mer as an 11-dimensional vector.This representation retained the full positional information of the local sequence window.
- Reduced representations: SVD transformed the raw feature matrix so that each sample was represented by five components.The row-average representation instead compressed each 11-mer into one numerical mean.
- Candidate-level features: Known-mass candidates were described using length, mass, target mass, mass error, validity, frequency, context support, ensemble likelihood, and length penalty.Context support checked candidate occurrence with scaffold flanking residues in homologous sequences.
3.4 Proposed Model Development
The proposed system combined masked-residue classification, validation-weighted ensembling, beam search, homologous mass-constrained retrieval, and hybrid reranking for two gap-filling settings.
- Problem formulation: The framework addressed known-gap-size filling as masked 11-mer amino acid classification and known-gap-mass filling as mass-constrained candidate retrieval and reranking.The two branches used local sequence information while incorporating different gap constraints.
- Model selection: Twenty-four classifier configurations were evaluated across eight supervised models and three feature schemes.The classifiers included kNN, decision tree, random forest, Extra Trees, histogram gradient boosting, logistic regression, linear SVC, and multilayer perceptron.
- Weighted ensemble: Selected models were combined with validation-accuracy weights so stronger models contributed more to residue probability estimates.The weighted ensemble supported both known-size residue prediction and known-mass candidate reranking.
- Known-size reconstruction: Known-size reconstruction used beam search to retain multiple high-scoring partial sequences before right-context reranking.The final beam score combined accumulated left-decoding probability with right-context support.
- Known-mass reconstruction: Known-mass reconstruction retrieved mass-valid homologous subsequences and reranked them using frequency, context, ensemble likelihood, mass error, and length penalty.The highest-scoring candidate was selected, while remaining candidates supported top-k analysis.
- Pipeline: The framework proceeded through residue-level learning, ensemble construction, gap reconstruction, and biochemical validation.These phases formed the proposed end-to-end scaffold gap-filling workflow.
3.5 Training Procedure and Hyperparameter Selection
The framework trains classical machine-learning models on three feature representations, selects the strongest models by validation accuracy, and combines them in a weighted ensemble for downstream gap reconstruction.
- Training setup: Experiments used raw encoded 11-mer, row-average, and SVD-reduced feature representations with eight supervised models.The implementation used Python and scikit-learn with random seed 42 for reproducibility.
- Framework inputs and outputs: Algorithm 1 takes target and homologous sequences, amino-acid masses, k-mer size, flanking contexts, and either a known gap size or mass as inputs.It returns a predicted gap sequence, ranked candidates, evaluation metrics, and biochemical validation scores.
- Evaluation outputs: The pipeline computes residue-level and exact-match metrics together with mass error, hydrophobicity, charge, composition, and BLOSUM62 validation scores.The selected reconstruction branch depends on whether gap size or gap mass is known.
- Model selection: The three strongest validation models were selected for the weighted ensemble and downstream beam-search decoding and mass-constrained hybrid reranking.The selected models included the strongest performers after validation-based comparison.
3.6 Performance Evaluation
Performance evaluation covers residue prediction, known-size sequence reconstruction, and known-mass candidate retrieval, using accuracy, exact-match, top-k, and biochemical consistency measures.
- Residue-level prediction: Residue-level prediction was evaluated with accuracy, error rate, macro and weighted precision, recall, and F1-score across 20 amino acid classes.Top-k residue accuracy was also computed for k = 1, 2, 3, and 5.
- Known-size reconstruction: Beam search expands partial gap candidates from ensemble residue probabilities, retains the highest-scoring beams, and reranks complete candidates with right-context support.The final beam score combines the beam probability with right-context support using weights 0.70 and 0.30.
- Known-mass retrieval: Known-mass retrieval filters homologous subsequences by mass tolerance, then evaluates frequency, mass error, context support, ensemble likelihood, and length suitability.Candidates are ranked by a hybrid score and the highest-ranked candidate is selected, while the remaining candidates support top-k analysis.
- Known-mass retrieval: The hybrid known-mass score combines mass validity, contextual support, ensemble likelihood, mass error, and a length penalty before ranking candidates.This evaluation compares both the highest-ranked candidate and whether the correct sequence appears among top-ranked mass-valid candidates.
- Known-size reconstruction: Known-size reconstruction was evaluated by exact-match accuracy and mean residue-level accuracy for complete predicted gap sequences.Exact match requires the complete predicted gap to equal the ground-truth sequence.
- Validation metrics: Known-mass performance was assessed using exact-match accuracy and top-k recovery, while biochemical validation included mass, hydrophobicity, charge, composition, and BLOSUM62 measures.Summary statistics and task-specific results were exported for downstream analysis and visualization.
4 Results and Discussion
The framework combined weighted residue prediction, beam search, biochemical validation, and mass-constrained candidate reranking to reconstruct known-size and known-mass protein gaps. It achieved strong residue-level performance, 87.50% known-size exact matching, and complete recovery on seven CAH2 known-mass cases.
- Feature representations: Raw encoded 11-mer features outperformed row-average and SVD-reduced representations because they preserved residue-order and positional information.Row averaging compressed each window into one mean value, while SVD reduction retained less predictive information.
- Weighted ensemble: 95.41% validation accuracy was achieved by the weighted ensemble, exceeding the best individual model's 95.29% accuracy.The ensemble combined raw Random Forest, Histogram Gradient Boosting, and Extra Trees using validation-accuracy-based weights.
- Residue prediction: 98.78% top-5 accuracy showed that the correct residue was frequently retained among the ensemble's highest-probability candidates.Top-1, top-2, and top-3 accuracies were 95.41%, 97.54%, and 98.16%, respectively.
- Known-size reconstruction: 87.50% exact-match accuracy was achieved on 14,960 known-size full-gap samples, with 95.82% mean residue-level accuracy.Biochemical validation also reported 4.551 Da mean mass absolute error, 96.77% amino-acid composition similarity, and 91.65% mean BLOSUM62 similarity.
- Known-mass reconstruction: 100% exact-match accuracy and 100% top-5 recovery were achieved across seven CAH2 known-mass benchmark cases.The method used mass-constrained homologous retrieval and hybrid reranking based on mass validity, homologous frequency, context, ensemble likelihood, mass error, and length.
- Limitations: The known-mass result is limited by the seven-case CAH2 evaluation and requires validation across more protein families and diverse gap cases.The discussion also identifies dependence on homologous sequences and the need for structural and functional validation.
5 Conclusion
The paper presents a hybrid approach integrating machine learning, homologous evidence, peptide mass constraints, and biochemical validation for known-size and known-mass scaffold gap filling. It reports strong residue prediction and reconstruction performance across the evaluated cases.
- Conclusion: The proposed framework integrates local context, masked 11-mer prediction, weighted ensembles, beam search, homologous retrieval, mass constraints, and hybrid reranking.It reports 95.41% validation accuracy, 87.50% known-size exact-match accuracy, and 100% top-5 recovery across seven CAH2 known-mass cases.