Retention time regression output specification
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill retention-time-regression-output-specificationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 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 author says it does
Copied from the file, not written here
Use when after initializing and executing a forward pass through a dual-branch RT-Transformer model (combining fingerprint and molecular graph inputs) on a batch of molecular samples, to verify that the output tensor conforms to the expected shape, data type, and numeric range for retention time.
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
8.0 KB, as published. Nobody here has run it
retention-time-regression-output-specification
Summary
Specification of the scalar regression output tensor produced by the RT-Transformer dual-branch architecture when predicting liquid chromatography retention times for metabolites. This skill ensures the model's forward pass produces valid, correctly-shaped retention time predictions suitable for downstream validation and transfer learning workflows.
When to use
After initializing and executing a forward pass through a dual-branch RT-Transformer model (combining fingerprint and molecular graph inputs) on a batch of molecular samples, to verify that the output tensor conforms to the expected shape, data type, and numeric range for retention time predictions before proceeding to loss computation, validation, or model deployment.
When NOT to use
- Input fingerprint or graph data have not been normalized or validated (spec does not handle upstream data quality; verify inputs first)
- Model has not been instantiated with both fingerprint processing and graph neural network branches fully connected (incomplete architecture)
- Output predictions are already aggregated, averaged, or post-processed into a different shape (spec defines immediate raw model output only)
Inputs
- Molecular fingerprint tensor (typically 2D array of shape [batch_size, fingerprint_dim] from RDKit)
- torch_geometric Batch object containing molecular graph representations (node features, edge indices, batch indices)
- Initialized RT-Transformer PyTorch model in forward-evaluation mode
Outputs
- Output tensor of shape [batch_size, 1] with dtype float32 containing scalar retention time predictions
- Validation status (pass/fail) confirming output conforms to expected schema and numeric validity
How to apply
Execute the RT-Transformer forward pass on a batch containing fingerprint tensors (from RDKit feature extraction) and torch_geometric Graph objects. Verify the output tensor has shape [batch_size, 1] and dtype float32 or compatible numeric type. Confirm all output values are scalar numeric predictions (not NaN or infinite). The output should represent predicted retention times in the same units as the training target (typically minutes or seconds depending on the chromatographic protocol used in the SMRT or PredRet datasets). Check that predictions fall within a plausible range relative to the training data distribution (e.g., positive values for retention time in standard LC–MS workflows). This validation step must complete without shape errors or type mismatches before feeding outputs to loss functions or evaluation metrics.
Related tools
- torch (PyTorch tensor framework used to instantiate the RT-Transformer model, execute forward pass, and validate output tensor shape and dtype)
- torch_geometric (Library for molecular graph construction (Graph objects with node/edge features) and graph neural network branch that processes graph inputs and fuses with fingerprint embeddings)
- rdkit-pypi (Generates molecular fingerprints (input to fingerprint processing branch) from SMILES or InChI molecular representations)
- RT-Transformer reference implementation (Reference architecture and training scripts defining the dual-branch model topology, fusion layer, and regression head that produces the specified output tensor) — https://github.com/01dadada/RT-Transformer
Examples
import torch; from model import RTTransformer; model = RTTransformer(); fingerprints = torch.randn(32, 2048); graphs = construct_batch(smiles_list); output = model(fingerprints, graphs); assert output.shape == (32, 1) and output.dtype == torch.float32
Evaluation signals
- Output tensor shape must exactly equal [batch_size, 1] with no extraneous dimensions or flattening artifacts
- All output values must be numeric (float32 or compatible) with no NaN, infinity, or null values
- Output predictions must be non-negative and fall within a plausible retention time range (e.g., 0–120 minutes for typical LC–MS protocols using SMRT/PredRet datasets)
- Forward pass must complete without shape mismatch errors, dtype casting warnings, or gradient computation issues when model is in evaluation mode
- Output must be independent of batch size (i.e., changing batch_size should produce output shape [new_batch_size, 1] without error)
Limitations
- Output specification assumes both fingerprint and graph inputs are correctly formatted and present; mismatched or missing modalities will cause shape errors upstream of the regression head
- Retention time predictions reflect the chromatographic conditions and chemical space of the training dataset (SMRT or PredRet); transfer to substantially different LC methods may require fine-tuning and output range adjustment
- Scalar predictions provide point estimates only; no uncertainty quantification (e.g., confidence intervals) is produced by this output specification
- Output tensor dtype depends on model initialization precision (float32 vs. float64); consistency with loss function and downstream metrics must be verified separately
Evidence
- [other] The RT-Transformer model uses a dual-branch architecture that accepts fingerprint data from one branch and molecular graph data from another branch, with both inputs processed to produce a retention time prediction as output.: "The RT-Transformer model uses a dual-branch architecture that accepts fingerprint data from one branch and molecular graph data from another branch, with both inputs processed to produce a retention"
- [other] Validation: confirm model runs forward pass without errors and produces output tensor of shape [batch_size, 1] with numeric predictions.: "Validation: confirm model runs forward pass without errors and produces output tensor of shape [batch_size, 1] with numeric predictions."
- [other] Implement the regression head that outputs scalar retention time predictions.: "Implement the regression head that outputs scalar retention time predictions."
- [readme] The RT-Tranformer combine the fingerprint and the molecular graph data and predict retention time as the output.: "The RT-Tranformer combine the fingerprint and the molecular graph data and predict retention time as the output."
- [other] Load molecular fingerprints (from RDKit feature extraction) and construct molecular graph representations using torch_geometric Graph objects.: "Load molecular fingerprints (from RDKit feature extraction) and construct molecular graph representations using torch_geometric Graph objects."