Describe the bug
When using infer_ori_strategy="hotspots", the ORI token (binder center-of-mass target) is sometimes placed in a strange position (e.g., inside the target protein) instead of on its surface. This occurs because in input_parsing.py function build here, _build_inputs is called before calling _set_origin, which runs infer_ori_from_hotspots. At the time infer_ori_from_hotspots executes, the diffused binder atoms are already present in the atom_array with coordinates [0, 0, 0] (placed there by create_diffused_residues). If any hotspot atom is within 12 Å of the coordinate origin in the input PDB frame, those zero-coordinate diffused atoms fall inside the 12 Å cell list query, massively bias nearby_atoms_com toward the origin, and corrupt the outward direction vector.
To Reproduce
Use any target structure whose hotspot residues have sidechain atoms within 12 Å of [0, 0, 0] in the PDB coordinate frame. This is common for structures deposited near the crystallographic origin.
Minimal dummy structure triggering the bug: place hotspot residue CA within 12 Å of origin, with enough binder diffused residues initialized at [0, 0, 0] to dominate nearby_atoms_com
Describe the bug
When using
infer_ori_strategy="hotspots", the ORI token (binder center-of-mass target) is sometimes placed in a strange position (e.g., inside the target protein) instead of on its surface. This occurs because ininput_parsing.pyfunctionbuildhere,_build_inputsis called before calling_set_origin, which runsinfer_ori_from_hotspots. At the timeinfer_ori_from_hotspotsexecutes, the diffused binder atoms are already present in theatom_arraywith coordinates[0, 0, 0](placed there bycreate_diffused_residues). If any hotspot atom is within 12 Å of the coordinate origin in the input PDB frame, those zero-coordinate diffused atoms fall inside the 12 Å cell list query, massively biasnearby_atoms_comtoward the origin, and corrupt the outward direction vector.To Reproduce
Use any target structure whose hotspot residues have sidechain atoms within 12 Å of
[0, 0, 0]in the PDB coordinate frame. This is common for structures deposited near the crystallographic origin.Minimal dummy structure triggering the bug: place hotspot residue CA within 12 Å of origin, with enough binder diffused residues initialized at
[0, 0, 0]to dominatenearby_atoms_com