Graph neural network architecture assembly
Use when when you have: (1) a collection of molecules represented as molecular graphs (nodes=atoms, edges=bonds with chirality/order attributes); (2) structured metadata describing experimental conditions (e.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill graph-neural-network-architecture-assemblyAssembled 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 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
10.8 KB, ~2.0k tokens by cl100k_base, as published. Nobody here has run it
graph-neural-network-architecture-assembly
License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
Summary
Assembly and instantiation of a Graph Transformer backbone for molecular property prediction, where heterogeneous molecular graphs (nodes, edges, atom/bond attributes) and structured metadata (column parameters, gradient slopes) are combined into a unified forward pass that outputs continuous predictions. This skill bridges graph encoding, feature featurization, and transformer inference.
When to use
When you have: (1) a collection of molecules represented as molecular graphs (nodes=atoms, edges=bonds with chirality/order attributes); (2) structured metadata describing experimental conditions (e.g., chromatographic column parameters: diameter, particle size, temperature, pH, solvent composition, gradient slopes); (3) a need to predict a continuous outcome (e.g., retention time) that depends on both molecular structure and experimental context; and (4) access to a pre-trained or custom Graphormer checkpoint. Use this skill to construct the combined encoder–transformer–decoder pipeline that fuses these heterogeneous inputs.
When NOT to use
- Input molecules are already flattened into fixed-size descriptor vectors or Morgan fingerprints; use standard MLPs or XGBoost instead of graph architectures.
- Experimental metadata is sparse, unstructured, or missing for >20% of samples; imputation and featurization of incomplete column parameters may degrade predictions.
- Target is classification (e.g., retention-time bin) rather than continuous regression; use a classification head and appropriate loss function, not a dense regression layer.
Inputs
- DGL heterogeneous molecular graphs (nodes with atom-type features, edges with bond-order and chirality attributes)
- RDKit Mol objects or SMILES strings (convertible to DGL graphs)
- Column metadata table with fields: company_name, USP_code, column_length, column_inner_diameter, particle_size, temperature, flow_rate, dead_time, HPLC_type, solvent_A, solvent_B, gradient_times, gradient_B_values, pH_A, pH_B, additive_A, additive_B, Tanaka_parameters, HSMB_parameters
- Graphormer pre-trained checkpoint or initialization parameters (hidden_dim, num_attention_heads, num_encoder_layers)
Outputs
- PyTorch model instance (nn.Module) ready for forward pass
- Tensor predictions of shape [batch_size, 1] representing continuous retention times or other molecular properties
- Validation report: tensor shape traces through forward pass (e.g., graph embeddings [batch, hidden_dim], column embeddings [batch, column_feature_dim], concatenated [batch, total_dim], final output [batch, 1])
How to apply
First, initialize a PyTorch Graphormer module with specified hidden dimensions, attention heads, and encoder layers. Second, instantiate a DGL graph featurization pipeline that encodes each molecule as a heterogeneous graph, annotating nodes with atom types and edges with bond orders and chirality flags. Third, construct a column-parameter embedding layer that accepts one-hot encoded categorical features (company, USP, solvent type, HPLC method) and normalized numerical features (column length divided by 250, temperature divided by 100, pH divided by 14, diameter, particle size, dead time, Tanaka/HSMB physicochemical parameters). Fourth, compute gradient-slope features as piecewise slopes s1, s2, s3 from chromatographic B and t parameters via (B_next − B_prev)/(t_next − t_prev). Fifth, assemble the forward pass: concatenate the DGL-encoded molecular graph embeddings, the column-parameter embeddings, and gradient slopes into a composite feature vector, then pass through the Graphormer transformer backbone to a final dense output layer. Finally, validate instantiation by running a forward pass on sample batches (molecular graphs + column metadata) and checking that tensor shapes propagate correctly and output shape matches the prediction target (single continuous value per molecule–column pair).
Related tools
- Graphormer (Graph Transformer backbone: encodes molecular graphs through attention-based message passing and outputs node/graph-level embeddings) — https://github.com/microsoft/Graphormer
- DGL (Heterogeneous graph construction and featurization: converts SMILES/Mol objects to node–edge graphs with atom-type and bond-order attributes)
- RDKit (Molecule I/O and feature extraction: parses SMILES strings, generates Mol objects, computes molecular properties (used in DGL graph construction))
- PyTorch (Neural network framework: defines model layers (embeddings, transformers, dense), handles forward passes, and manages tensor operations)
Evaluation signals
- Forward pass completes without shape-mismatch or device-placement errors; sample batch (e.g., 32 molecules + 32 column metadata rows) produces output shape [32, 1].
- Molecular graph embeddings have expected dimensionality (hidden_dim, e.g., 768); column parameter embeddings match featurization output size (≥30 features post-concatenation); gradient slopes are scalar values in [−2, 2] (typical normalized gradient range).
- Model parameters are on the correct device (CPU or CUDA); gradients flow through all components (graph encoder → transformer → output layer) when loss.backward() is called.
- Column metadata is correctly one-hot encoded (categorical dimensions sum to 1 per category) and numerical features are normalized to approximate range [0, 1] (e.g., pH ∈ [0, 0.14] after division by 14).
- Predictions are within physically plausible range for retention times (e.g., 0–100 min for typical LC methods); no NaN or inf values in output or gradient tensors.
Limitations
- Incomplete or truncated code in source material (two code blocks end mid-function with syntax errors 'for i i' and truncated int_encodings concatenation); full featurization pipeline must be manually completed or sourced from HopkinsLaboratory/Graphormer-RT repository.
- Categorical feature encoding (company, USP, solvent type) is dataset-specific; one-hot vocabulary must be learned from training data or predefined; unseen categories will fail unless handled with OOV (out-of-vocabulary) placeholders.
- Numerical feature normalization thresholds (length/250, temperature/100, pH/14) are assumed fixed; if experimental ranges differ significantly (e.g., ultra-high-pressure HPLC >400 bar), normalization may saturate or produce outliers.
- Missing values in column metadata (empty strings for diameter, pH_B) are replaced with 0; this assumes 0 is semantically meaningful (e.g., no additive present) and may introduce bias if data is missing at random.
- Tanaka and HSMB physicochemical parameters contain string artifacts ('2.7 spp', '2.6 spp'); string-to-numeric conversion is required and non-standard values are coerced to defaults, risking silent data loss.
- Model requires pre-trained Graphormer weights or careful initialization; training from scratch requires substantial labeled data and tuning of learning rate, warmup schedule, and weight decay.
Evidence
- [other] Column parameters are featurized through one-hot encoding of categorical features (company, USP, solvents), normalization of numerical features (length/250, temperature/100, pH/14), and concatenation of integer and float encodings: "Column parameters are featurized through one-hot encoding of categorical features (company, USP, solvents), normalization of numerical features (length/250, temperature/100, pH/14), and concatenation"
- [other] Initialize a PyTorch Graph Transformer backbone architecture (Graphormer module) with appropriate hidden dimensions, attention heads, and encoder layers: "Initialize a PyTorch Graph Transformer backbone architecture (Graphormer module) with appropriate hidden dimensions, attention heads, and encoder layers."
- [other] Configure DGL graph featurization pipeline to encode molecules as heterogeneous graphs with node/edge attributes (atom types, bond orders, chirality): "Configure DGL graph featurization pipeline to encode molecules as heterogeneous graphs with node/edge attributes (atom types, bond orders, chirality)."
- [other] Assemble forward pass that concatenates molecular graph embeddings from DGL encoder, column embeddings, and gradient slopes, passing combined representation through Graphormer transformer backbone to final dense output layer for continuous retention-time prediction: "Assemble forward pass that concatenates molecular graph embeddings from DGL encoder, column embeddings, and gradient slopes, passing combined representation through Graphormer transformer backbone to"
- [other] Validate model instantiation by checking tensor shapes propagate correctly through forward pass with sample molecular graphs and column-metadata batches: "Validate model instantiation by checking tensor shapes propagate correctly through forward pass with sample molecular graphs and column-metadata batches."
- [results] def featurize_column(column_params, index): company = one_hot_company(column_params[0]) USP = one_hot_USP(column_params[1]) length = float(column_params[2]) / 250: "def featurize_column(column_params, index): company = one_hot_company(column_params[0]) USP = one_hot_USP(column_params[1]) length = float(column_params[2]) / 250"
- [readme] Supports interface and datasets of PyG, DGL, OGB, and OCP. Supports fairseq backbone.: "Supports interface and datasets of PyG, DGL, OGB, and OCP.
- Supports fairseq backbone."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most architecture codebase skills give in ~2.0k tokens
Counted across 811 of the 1,134 authors here whose files we hold, read 2026-08-07
- Ask the user which candidate to explorein 45 of 811, across 15 files
- Apply the deletion test to suspected shallow modulesin 43 of 811, across 15 files
- Read any relevant architecture decision records firstin 31 of 811, across 8 files
- Use exact glossary terms in every suggestionin 30 of 811, across 10 files
- Accept dependencies instead of creating themin 24 of 811, across 5 files
- Include before and after visualisations for each candidatein 24 of 811, across 5 files
- Read the domain glossary before exploringin 24 of 811, across 6 files
- Return results instead of producing side effectsin 23 of 811, across 4 files
- Explore the codebase for shallow modules and frictionin 23 of 811, across 3 files
- Introduce seams only where things varyin 22 of 811, across 3 files
- Reduce the number of methodsin 21 of 811, across 2 files
- Design deep modules with small interfacesin 21 of 811, across 3 files
Said here and by no other author read
- initialize PyTorch Graphormer module
- instantiate DGL graph featurization pipeline
- construct column-parameter embedding layer
- compute gradient-slope features
- assemble forward pass
- concatenate embeddings and gradient slopes
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.