Rapid Enzyme / Non-Enzyme Prediction — an efficient machine learning tool combining multi-physicochemical sequence features with an XGBoost classifier for fast and accurate binary classification of protein sequences.
Accurate identification of enzymes from protein sequences is crucial for understanding metabolic pathways, drug target discovery, and functional annotation of novel proteins.
sxLaep supports Python 3.9+ on Windows, Linux, and macOS.
| Package | Minimum |
|---|---|
numpy | ≥ 1.23 |
pandas | ≥ 1.5 |
scikit-learn | ≥ 1.2 |
xgboost | ≥ 1.7 |
joblib | ≥ 1.2 |
pip install sxlaep
git clone https://github.com/labxscut/sxLaep
cd sxLaep
pip install -e .
docker pull labxscut/sxlaep:python3.11
docker run --rm -it -v $(pwd):/workspace labxscut/sxlaep:python3.11 bash
Predict enzyme probability for a single protein sequence or a FASTA file in just a few lines of code using the bundled pre-trained model.
sxlaep --input sequences.fasta --output predictions.csv
from pathlib import Path
import sxlaep
from sxlaep.model import load_model, predict_sequences, predict_fasta
# Load the bundled pre-trained model (native UBJSON format)
model_path = Path(sxlaep.__file__).parent / "enzyme_xgb_model.ubj"
model = load_model(model_path)
# Single sequence prediction
df = predict_sequences(model, ["MKVLW..."])
# df['pred_label'] -> 0 (Non-Enzyme) or 1 (Enzyme)
# df['enzyme_probability'] -> float (0.0 ~ 1.0)
# FASTA file prediction
result = predict_fasta(
model_path=model_path,
fasta_path="sequences.fasta",
output_csv="predictions.csv",
)
print(result.head())
Complete API documentation for all sxLaep modules (v1.0.5).
Configuration dataclasses and biochemical constants used by sxLaep.
| Parameter | Default | Description |
|---|---|---|
lag | 10 | Maximum correlation lag used by multi-property pseudo-AAC. |
weight | 0.05 | Weight applied to sequence-order correlation terms. |
n_segments | 3 | Number of N-to-C sequence windows used by windowed AAC. |
add_length | True | Whether to append raw sequence length to the pseudo-AAC vector. |
properties | PROPERTIES | Amino-acid physicochemical property tables used by pseudo-AAC. |
| Name | Description |
|---|---|
AA20 | 20 standard amino acid alphabet (ACDEFGHIKLMNPQRSTVWY). |
HYDRO | Hydrophobicity values for each amino acid. |
POLAR | Polarity values for each amino acid. |
CHARGE | Charge values for each amino acid. |
PROPERTIES | Combined dictionary of hydro, polar, and charge. |
CTD_GROUPS | Physicochemical group definitions for CTD features (7 systems: hydrophobicity, normalized VDW, polarizability, secondary structure, solvent access, polarity, charge). |
FASTA reading and writing utilities for protein sequence experiments.
>), and concatenated protein sequence.Protein sequence feature extraction for sxLaep. Combines pseudo-AAC, CTD, and windowed AAC into a 258-dimensional feature vector.
(n_sequences, n_features) array.20 + lam × n_properties + int(add_length).n_segments × 20 features.Model loading and prediction utilities. Pre-trained models use native XGBoost UBJSON format (.ubj) for cross-version compatibility.
.json / .ubj) or legacy joblib pickle. Prefers the sibling .ubj file when loading .pkl to avoid version-skew warnings.pred_label (0/1) and enzyme_probability (float).sequence_id, description, pred_label, enzyme_probability.predict_fasta.High-level wrapper for the main sxLaep prediction workflow.
predict_fasta.predict subcommand and --input shorthand.sxlaep --input query.fasta --output predictions.csv
Uses the packaged enzyme_xgb_model.ubj. Feature parameters are fixed to the bundled model's defaults.
sxlaep predict \
--model results/sxlaep_training/enzyme_xgb_model.ubj \
--fasta data/query.fasta \
--output results/query_predictions.csv \
--lag 10 --weight 0.05 --segments 3 \
--properties hydro polar charge \
--n-jobs 4
End-to-end prediction workflow from raw FASTA files to enzyme/non-enzyme classification results.
# CLI (shorthand, bundled model)
sxlaep --input data/query.fasta --output results/predictions.csv
# CLI (subcommand, custom model)
sxlaep predict \
--model results/sxlaep_training/enzyme_xgb_model.ubj \
--fasta data/query.fasta \
--output results/query_predictions.csv
# Python API
from sxlaep.model import predict_fasta
df = predict_fasta(
model_path="results/sxlaep_training/enzyme_xgb_model.ubj",
fasta_path="data/query.fasta",
output_csv="results/query_predictions.csv",
)
print(df[["sequence_id", "pred_label", "enzyme_probability"]].head())
Parameters, output formats, notes, and citations.
| Parameter | Type | Default | Description |
|---|---|---|---|
lag | int | 10 | Maximum correlation lag for pseudo-AAC. |
weight | float | 0.05 | Weight applied to sequence-order correlation terms. |
n_segments | int | 3 | Number of N-to-C sequence windows for windowed AAC. |
add_length | bool | True | Append raw sequence length to the feature vector. |
properties | dict | PROPERTIES | Physicochemical property tables (hydrophobicity, polarity, charge). |
| Column | Type | Description |
|---|---|---|
sequence_id | str | FASTA identifier (first whitespace-delimited token of the header). |
description | str | Full FASTA header without the leading >. |
pred_label | int | Predicted class: 0 = Non-Enzyme, 1 = Enzyme. |
enzyme_probability | float | Enzyme probability score (0.0 ~ 1.0). |
enzyme_xgb_model.ubj) is bundled with the package in native XGBoost UBJSON format for cross-version compatibility.n_jobs — set to -1 when processing large datasets.Please cite sxLaep if you use it in your research:
labxscut. sxLaep: Rapid Enzyme/Non-Enzyme Prediction using Sequence Features and XGBoost. (2026).
Additional references: