featurization
Choose, run, validate, and troubleshoot DeepChem featurizers for molecules, graphs, descriptors, sequences, materials, polymers, and complexes.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- featurization
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Choose, run, validate, and troubleshoot DeepChem featurizers for molecules, graphs, descriptors, sequences, materials, polymers, and complexes.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md7.5 KB
- 参考文档references/featurizer-guide.md6.3 KB
- 参考文档references/troubleshooting.md7.5 KB
- 脚本scripts/inspect_featurizer_outputs.py9.2 KB
03 SKILL.md 正文
DeepChem Featurization
Use this sub-skill when the user needs to select or debug deepchem.feat transformations before loading data into models. Route dataset loading, MolNet presets, splitting, and CSV/SDF loader mechanics to ../data-and-molnet/; route model construction/training to ../model-training/; route full docking pose generation to ../docking-and-structure/.
Quick Router
- Use
CircularFingerprintfor fixed-size ECFP/Morgan bit vectors or count vectors for classical ML, similarity, and quick baselines. - Use
RDKitDescriptorsfor interpretable 2D physicochemical descriptors; useMordredDescriptorsonly when the optional Mordred package is available and high-dimensional descriptors are desired. - Use
MolGraphConvFeaturizerfor graph neural network inputs asGraphData; setuse_edges=Truewhen the downstream model consumes edge attributes anduse_chirality=Truewhen stereochemistry matters. - Use
CoulombMatrixorCoulombMatrixEigfor coordinate-aware molecular representations wheremax_atomsand conformer handling are explicit. - Use
FASTAFeaturizerfor FASTA files and biosequence extraction; use tokenizer wrappers such asHuggingFaceFeaturizeronly when transformer tokenizers are installed and intentionally selected. - Use material featurizers such as
ElementPropertyFingerprint,SineCoulombMatrix,CGCNNFeaturizer, andElemNetFeaturizerfor composition strings or pymatgen structures. - Use polymer, complex, and docking-adjacent featurizers only for feature extraction; route pose generation and docking workflows elsewhere.
Minimal Patterns
import deepchem as dc
smiles = ["CCO", "c1ccccc1"]
features = dc.feat.CircularFingerprint(size=1024).featurize(smiles)
print(features.shape) # (2, 1024)
graphs = dc.feat.MolGraphConvFeaturizer(use_edges=True).featurize(["CCO"])
graph = graphs[0]
print(graph.node_features.shape, graph.edge_index.shape, graph.edge_features.shape)
descriptors = dc.feat.RDKitDescriptors(use_bcut2d=False).featurize(["CCO"])
print(descriptors.shape)
For mixed-validity batches, always inspect per-entry outputs before passing features to a model. Failed molecular featurizations usually appear as empty arrays, and heterogeneous feature shapes can force an object array.
Validation Checklist
- Confirm input type: SMILES/RDKit Mol for molecular featurizers, FASTA file path for
FASTAFeaturizer, pymatgen structure or structure dict for structure featurizers, composition string for composition featurizers. - Print
type(feature)and shape-like attributes for a tiny batch before scaling up. - Check failures: empty arrays, warnings about failed datapoints, missing optional dependency warnings, or object arrays from heterogeneous outputs.
- Match feature family to model family: vectors for scikit-learn/dense models,
GraphDatafor graph models, sequence/tokenizer outputs for sequence models, structure/composition features for materials models. - Keep featurizer settings identical between train/validation/test/inference.
Bundled References
references/featurizer-guide.md: selection guidance by input, task, and model family.references/api-reference.md: common signatures, output contracts, and validation snippets.references/troubleshooting.md: failure modes for invalid SMILES, optional dependencies, graph shape mismatches, Coulombmax_atoms, and descriptor normalization.scripts/inspect_featurizer_outputs.py: tiny CLI to inspect SMILES and optional FASTA outputs without needing dataset loaders.
Helper Script
Run the bundled helper from this sub-skill directory or by path:
python scripts/inspect_featurizer_outputs.py --smiles CCO 'C[C@H](O)Cl' bad_smiles --featurizers circular molgraph rdkit
Add --fasta path/to/file.fasta --featurizers fasta to inspect FASTA extraction when the sequence dependency is installed.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).