MolecularDiffusion.utils.substituent_builder¶
Self-contained substituent-fragment placement for outpaint skeleton init.
Uses the bundled idealized fragment geometries in substituent_geometries.py
(attachment atom = row 0, bond pointing along local +x) to build clean,
connector-anchored placeholder coordinates for the to-be-generated atoms. Only
coordinates are used (a geometry prior); node features are randomized and
denoised. No external dependency.
Functions¶
|
Align a local fragment so its bond points along |
|
Pick the bundled fragment matching all |
Module Contents¶
- MolecularDiffusion.utils.substituent_builder.place_fragment(frag_coords, connector_pos, direction, roll_angle=None)¶
Align a local fragment so its bond points along
directionat the connector.The fragment’s attachment atom (row 0, local ~(bond, 0, 0)) lands at
connector_pos + bond * direction; an optional roll aboutdirectionadds orientational diversity. Returns placed coords(M, 3).
- MolecularDiffusion.utils.substituent_builder.select_fragment(tags_all, n_extra)¶
Pick the bundled fragment matching all
tags_allclosest to n_extra.Among fragments whose
tagsinclude every tag intags_all(emptytags_allmatches any), prefer the one whose atom count is >= n_extra and closest to it (so we subset rather than extend); otherwise the largest available. Returns(name, coords_tensor (M, 3))or(None, None).