Skip to content

Commit

Permalink
updated remaining test for new PDBData class
Browse files Browse the repository at this point in the history
  • Loading branch information
gwirn committed Jun 5, 2024
1 parent 00c87eb commit 5caaa6a
Show file tree
Hide file tree
Showing 5 changed files with 926 additions and 917 deletions.
6 changes: 6 additions & 0 deletions src/molearn/data/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ def read_traj(self) -> None:
loaded.topology = top0
multi_traj.append(loaded)
self.traj = md.join(multi_traj)
# converts ELEMENT names from eg "Cd" -> "C" to avoid later complications
topo_table, topo_bonds = self.traj.topology.to_dataframe()
topo_table["element"] = topo_table["element"].apply(
lambda x: x if len(x.strip()) <= 1 else x.strip()[0]
)
self.traj.topology = md.Topology.from_dataframe(topo_table, topo_bonds)
# save new topology
self.traj[0].save_pdb(
os.path.join(self.outpath, f"./{self.traj_name}_NEW_TOPO.pdb")
Expand Down
Binary file modified test/MurD_test.dcd
Binary file not shown.
Loading

0 comments on commit 5caaa6a

Please sign in to comment.