Molecular structure to vector encoding
Use when when you have a collection of molecular structures (SMILES, InChI, or SDF format) and need to train or compare neural network-based spectrum predictors (such as NEIMS, MassFormer, or ICEBERG variants) on the same benchmark dataset.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill molecular-structure-to-vector-encodingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.2 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
molecular-structure-to-vector-encoding
Summary
Convert molecular structures into fixed-length numerical feature vectors suitable for neural network input, enabling direct comparison and benchmarking of spectrum prediction models. This preprocessing step is essential for training FFN and GNN encoders on equivalent settings across baseline and novel spectrum prediction architectures.
When to use
When you have a collection of molecular structures (SMILES, InChI, or SDF format) and need to train or compare neural network-based spectrum predictors (such as NEIMS, MassFormer, or ICEBERG variants) on the same benchmark dataset. The input structures must be converted to fixed-length feature vectors to ensure equivalent model settings across different encoder architectures (FFN vs. GNN) during hyperparameter sweeps and evaluation.
When NOT to use
- When input is already a pre-computed feature table or numerical matrix (featurization already applied).
- When comparing models that require different molecular representations (e.g., fragment-level predictions vs. formula-level predictions) — alignment on single featurization may obscure genuine model differences.
- When the benchmark dataset lacks sufficient structural annotation or metadata to verify consistent featurization across all compounds.
Inputs
- Molecular structures in SMILES, InChI, or SDF format
- Benchmark dataset metadata (e.g., NIST'20 labels.tsv or MassSpecGym catalog)
- Molecular property annotations (if available)
Outputs
- Fixed-length numerical feature vectors (one per molecule)
- Feature vector matrix suitable for FFN/GNN encoder input
- Featurization parameter configuration (for reproducibility)
How to apply
Load molecular structures from the benchmark dataset (e.g., NIST'20 or MassSpecGym spectra paired with SMILES/InChI data). Represent each structure as a fixed-length feature vector compatible with FFN input layers, typically using molecular descriptors or learned embeddings. Ensure all structures in the dataset are encoded using identical featurization rules to maintain equivalent settings across compared baseline and alternative models. Validate that the resulting feature vectors have uniform dimensionality and pass schema checks before feeding to downstream encoders. The choice of featurization (classical descriptors vs. graph-derived features vs. pre-trained molecular embeddings) should be documented and held constant across all compared models to enable fair benchmarking.
Related tools
- PyTorch / TensorFlow (Neural network framework for encoding and training spectrum predictors on vectorized molecular inputs)
- PubChem (Source of molecular structures, SMILES, and formula mappings for featurization and retrieval experiments)
- ms-pred (Benchmark framework implementing equivalent featurization and encoder training across NEIMS, MassFormer, 3DMolMS, and other baselines) — github.com/coleygroup/ms-pred
- MAGMa / RDKit (Molecular annotation and descriptor calculation tools for structure-to-vector conversion)
Evaluation signals
- All output feature vectors have identical dimensionality and numeric dtype (e.g., float32).
- Feature vectors contain no NaN or Inf values; min/max ranges are consistent across the dataset.
- Featurization is deterministic: re-encoding the same structure yields identical vectors.
- Model training proceeds without shape mismatch errors; FFN encoder input layer receives vectors of expected dimensionality.
- Benchmark comparison metrics (e.g., cosine similarity, spectral match score between NEIMS-FFN and NEIMS-GNN variants) show equivalent performance when only encoder architecture differs, confirming featurization consistency.
Limitations
- Fixed-length vectorization may lose structural detail or context-dependent information compared to graph or fragment-based representations (ICEBERG predicts at fragment level, SCARF at formula level).
- Choice of featurization method (classical descriptors, learned embeddings, or graph features) significantly impacts model performance; no single encoding is optimal across all spectrum prediction tasks.
- Structures with ambiguous or missing stereochemistry or those outside the training domain may produce uninformative or out-of-distribution vectors.
- Large-scale featurization of PubChem or MassSpecGym requires substantial computational resources and time (formula subset generation documented as 'several hours, even parallelized').
Evidence
- [other] Preprocess molecular structures into fixed-length feature vectors suitable for FFN input.: "Preprocess molecular structures into fixed-length feature vectors suitable for FFN input."
- [readme] implement a number of baselines and alternative models using equivalent settings across models (i.e., same covariates, hyperparameter sweeps for each, etc.): "implement a number of baselines and alternative models using equivalent settings across models (i.e., same covariates, hyperparameter sweeps for each, etc.)"
- [readme] ICEBERG predicts spectra at the level of molecular fragments, whereas SCARF predicts spectra at the level of chemical formula.: "ICEBERG predicts spectra at the level of molecular fragments, whereas SCARF predicts spectra at the level of chemical formula."
- [readme] formula subset generation takes longer (on the order of several hours, even parallelized) as it requires converting each molecule in PubChem to a mol / InChI.: "formula subset generation takes longer (on the order of several hours, even parallelized) as it requires converting each molecule in PubChem to a mol / InChI."
- [other] Train the FFN encoder on the spectrum prediction task using mean squared error loss and an optimization algorithm (e.g. Adam).: "Train the FFN encoder on the spectrum prediction task using mean squared error loss and an optimization algorithm (e.g. Adam)."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.