Skip to content

Non-Residue-Contiguous System::atoms in to_bio_topology Corrupts bf::Bond Flat Indices #23

@TKanX

Description

@TKanX

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:

  • Remap Bond::i/j via old_to_new table derived from residue_members insertion order in to_bio_topology
  • Add regression test to_bio_topology_remaps_bonds_for_non_contiguous_atoms

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions