foundation-model-prediction-generation
License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution.
Summary
Use a pre-trained foundation model to generate molecular embeddings and predictions on downstream tasks (classification, regression, or virtual screening) by loading pre-trained weights and running inference on new molecular data. This skill leverages learned evolutionary and structural patterns to produce bioactivity predictions or molecular representations without task-specific retraining.
When to use
You have a pre-trained foundation model checkpoint (e.g., NaFM.ckpt) and new molecules represented as SMILES strings or a CSV file, and you need to generate predictions (e.g., bioactivity scores, taxonomy class, screening rankings) or embeddings for downstream analysis. Particularly useful when your molecules are natural products or derivatives thereof, and existing synthetic-molecule models underperform.
When NOT to use
- Input molecules are highly synthetic (e.g., combinatorial libraries or fully synthetic compounds) — foundation models pre-trained on synthetic molecules may be more suitable.
- Pre-trained weights are not available or incompatible with your PyTorch/CUDA version.
- You need to adapt the model to a novel task not covered in the pre-training objective (e.g., a task requiring task-specific architectural changes) — fine-tuning would be more appropriate.
Inputs
- Pre-trained model checkpoint file (PyTorch Lightning .ckpt)
- Molecular data as CSV file with 'SMILES' column
- Task specification (classification, regression, or virtual screening)
- Model configuration (embedding dimension, number of layers, dropout ratio)
Outputs
- Predictions CSV file with SMILES, predicted labels/scores, and confidence values
- Molecular embeddings (optional, for downstream analysis)
- Ranking or retrieval metrics for virtual screening tasks
How to apply
Load the pre-trained model checkpoint using the inference script, prepare your input data as a CSV file with a 'SMILES' column, specify the task type (classification or regression), and run the inference.py script with the checkpoint path and data location. The model will encode each molecule into learned representations capturing scaffold-derived evolutionary patterns and side-chain information, then apply the task-specific head (classifier or regressor) to produce outputs. Save predictions to a results file and validate that output schema matches expected format (class labels or numeric scores with confidence ranges).
Related tools
- PyTorch (Deep learning framework for loading and executing the pre-trained model graph)
- PyTorch Lightning (Checkpoint management and inference orchestration for the NaFM model)
- inference.py (Primary inference script for generating predictions on new molecular data) — https://github.com/TomAIDD/NaFM-Official
- scikit-learn (Compute evaluation metrics (e.g., ranking accuracy, retrieval scores) on predictions)
Examples
python inference.py --task classification --downstream-data downstream_data/Ontology/raw/classification_data.csv --checkpoint-path NaFM.ckpt
Evaluation signals
- Output CSV contains all input SMILES with corresponding predictions and no null/NaN values in prediction columns.
- Prediction scores are within the expected range (class indices for classification, numeric values for regression, 0–1 for probabilities).
- For classification tasks, predicted class labels match the ontology or dataset schema (e.g., valid taxonomy classes, pathway codes).
- For virtual screening, ranking metrics (e.g., hit rate, area under curve on ranked retrieval) match or exceed baseline performance reported in the paper (SOTA on downstream benchmarks).
- Model inference time per molecule is consistent with batch processing efficiency (no sudden crashes or GPU memory errors).
Limitations
- The provided inference scripts (test.py and inference.py) are demonstration templates rather than production pipelines — parameter tuning (learning rate, batch size, early stopping patience) may be required for novel datasets.
- Pre-trained weights encode patterns from natural product training corpora; performance on highly synthetic or non-drug-like molecules is not guaranteed.
- Virtual screening results depend on dataset composition and domain alignment; external or proprietary screening libraries may require retraining or fine-tuning.
- Model evaluation is sensitive to SMILES standardization and salt/duplicate removal; inconsistent preprocessing can degrade prediction quality.
Evidence
- [readme] For inference on new molecules (CSV with a "SMILES" column): python inference.py --task classification --downstream-data [data location] --checkpoint-path [your finetuned model path]: "For inference on new molecules (CSV with a "SMILES" column)"
- [intro] The proposed framework achieves state-of-the-art (SOTA) performance across a wide range of downstream tasks in natural product mining and drug discovery: "The proposed framework achieves state-of-the-art (SOTA) performance across a wide range of downstream tasks in natural product mining and drug discovery"
- [intro] Our method integrates contrastive learning with masked graph modeling, effectively encoding scaffold-derived evolutionary patterns alongside diverse side-chain information: "Our method integrates contrastive learning with masked graph modeling, effectively encoding scaffold-derived evolutionary patterns alongside diverse side-chain information"
- [intro] NaFM reveals a strong capacity for learning evolutionary information: "NaFM reveals a strong capacity for learning evolutionary information"
- [readme] Results will be saved to NaFM/predictions.csv: "Results will be saved to NaFM/predictions.csv"
1---2name: foundation-model-prediction-generation3description: Use when you have a pre-trained foundation model checkpoint (e.g., NaFM.ckpt) and new molecules represented as SMILES strings or a CSV file, and you need to generate predictions (e.g., bioactivity scores, taxonomy class, screening rankings) or embeddings for downstream analysis.4license: CC-BY-4.05---67# foundation-model-prediction-generation89> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->10## Summary1112Use a pre-trained foundation model to generate molecular embeddings and predictions on downstream tasks (classification, regression, or virtual screening) by loading pre-trained weights and running inference on new molecular data. This skill leverages learned evolutionary and structural patterns to produce bioactivity predictions or molecular representations without task-specific retraining.1314## When to use1516You have a pre-trained foundation model checkpoint (e.g., NaFM.ckpt) and new molecules represented as SMILES strings or a CSV file, and you need to generate predictions (e.g., bioactivity scores, taxonomy class, screening rankings) or embeddings for downstream analysis. Particularly useful when your molecules are natural products or derivatives thereof, and existing synthetic-molecule models underperform.1718## When NOT to use1920- Input molecules are highly synthetic (e.g., combinatorial libraries or fully synthetic compounds) — foundation models pre-trained on synthetic molecules may be more suitable.21- Pre-trained weights are not available or incompatible with your PyTorch/CUDA version.22- You need to adapt the model to a novel task not covered in the pre-training objective (e.g., a task requiring task-specific architectural changes) — fine-tuning would be more appropriate.2324## Inputs2526- Pre-trained model checkpoint file (PyTorch Lightning .ckpt)27- Molecular data as CSV file with 'SMILES' column28- Task specification (classification, regression, or virtual screening)29- Model configuration (embedding dimension, number of layers, dropout ratio)3031## Outputs3233- Predictions CSV file with SMILES, predicted labels/scores, and confidence values34- Molecular embeddings (optional, for downstream analysis)35- Ranking or retrieval metrics for virtual screening tasks3637## How to apply3839Load the pre-trained model checkpoint using the inference script, prepare your input data as a CSV file with a 'SMILES' column, specify the task type (classification or regression), and run the inference.py script with the checkpoint path and data location. The model will encode each molecule into learned representations capturing scaffold-derived evolutionary patterns and side-chain information, then apply the task-specific head (classifier or regressor) to produce outputs. Save predictions to a results file and validate that output schema matches expected format (class labels or numeric scores with confidence ranges).4041## Related tools4243- **PyTorch** (Deep learning framework for loading and executing the pre-trained model graph)44- **PyTorch Lightning** (Checkpoint management and inference orchestration for the NaFM model)45- **inference.py** (Primary inference script for generating predictions on new molecular data) — https://github.com/TomAIDD/NaFM-Official46- **scikit-learn** (Compute evaluation metrics (e.g., ranking accuracy, retrieval scores) on predictions)4748## Examples4950```51python inference.py --task classification --downstream-data downstream_data/Ontology/raw/classification_data.csv --checkpoint-path NaFM.ckpt52```5354## Evaluation signals5556- Output CSV contains all input SMILES with corresponding predictions and no null/NaN values in prediction columns.57- Prediction scores are within the expected range (class indices for classification, numeric values for regression, 0–1 for probabilities).58- For classification tasks, predicted class labels match the ontology or dataset schema (e.g., valid taxonomy classes, pathway codes).59- For virtual screening, ranking metrics (e.g., hit rate, area under curve on ranked retrieval) match or exceed baseline performance reported in the paper (SOTA on downstream benchmarks).60- Model inference time per molecule is consistent with batch processing efficiency (no sudden crashes or GPU memory errors).6162## Limitations6364- The provided inference scripts (test.py and inference.py) are demonstration templates rather than production pipelines — parameter tuning (learning rate, batch size, early stopping patience) may be required for novel datasets.65- Pre-trained weights encode patterns from natural product training corpora; performance on highly synthetic or non-drug-like molecules is not guaranteed.66- Virtual screening results depend on dataset composition and domain alignment; external or proprietary screening libraries may require retraining or fine-tuning.67- Model evaluation is sensitive to SMILES standardization and salt/duplicate removal; inconsistent preprocessing can degrade prediction quality.6869## Evidence7071- [readme] For inference on new molecules (CSV with a "SMILES" column): python inference.py --task classification --downstream-data [data location] --checkpoint-path [your finetuned model path]: "For inference on new molecules (CSV with a "SMILES" column)"72- [intro] The proposed framework achieves state-of-the-art (SOTA) performance across a wide range of downstream tasks in natural product mining and drug discovery: "The proposed framework achieves state-of-the-art (SOTA) performance across a wide range of downstream tasks in natural product mining and drug discovery"73- [intro] Our method integrates contrastive learning with masked graph modeling, effectively encoding scaffold-derived evolutionary patterns alongside diverse side-chain information: "Our method integrates contrastive learning with masked graph modeling, effectively encoding scaffold-derived evolutionary patterns alongside diverse side-chain information"74- [intro] NaFM reveals a strong capacity for learning evolutionary information: "NaFM reveals a strong capacity for learning evolutionary information"75- [readme] Results will be saved to NaFM/predictions.csv: "Results will be saved to NaFM/predictions.csv"