Description:
dreid-forge ≤0.4.1's io::to_bio_topology regroups System::atoms into a chain→residue→atom tree, after which bio_struct.iter_atoms() defines a new flat index sequence required by bf::Bond. Bond::i/j (indices into the input atoms[]) are forwarded to bf::Bond::new without remapping. These orderings coincide only when input atoms are already residue-contiguous — the case for normal dreid-forge roundtrips where atoms originate from iter_atoms_with_context(). Any consumer constructing System with non-contiguous layout (e.g., dreid-pack's reconstruct(): fixed backbone first, then mobile sidechains) causes bonds to reference wrong atom pairs after the regrouping phase.
Tasks:
Description:
dreid-forge ≤0.4.1'sio::to_bio_topologyregroupsSystem::atomsinto a chain→residue→atom tree, after whichbio_struct.iter_atoms()defines a new flat index sequence required bybf::Bond.Bond::i/j(indices into the inputatoms[]) are forwarded tobf::Bond::newwithout remapping. These orderings coincide only when input atoms are already residue-contiguous — the case for normal dreid-forge roundtrips where atoms originate fromiter_atoms_with_context(). Any consumer constructingSystemwith non-contiguous layout (e.g.,dreid-pack'sreconstruct(): fixed backbone first, then mobile sidechains) causes bonds to reference wrong atom pairs after the regrouping phase.Tasks:
Bond::i/jviaold_to_newtable derived fromresidue_membersinsertion order into_bio_topologyto_bio_topology_remaps_bonds_for_non_contiguous_atoms