Skip to content

Commit c19459b

Browse files
authored
Merge pull request #196 from Mishakolok/main
Respect write_spin_centers parameter for PDB HEADER and TER strings
2 parents c8d0645 + dfc3dd4 commit c19459b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/chilife/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,6 @@ def write_labels(pdb_file: TextIO, *args: sl.SpinLabel,
749749
if not np.any(label.spin_centers):
750750
continue
751751

752-
pdb_file.write(f"HEADER {label.name}_density\n")
753752
spin_centers = np.atleast_2d(label.spin_centers)
754753

755754
if KDE and len(spin_centers) > 5:
@@ -767,6 +766,7 @@ def write_labels(pdb_file: TextIO, *args: sl.SpinLabel,
767766
vals = label.weights
768767

769768
if write_spin_centers:
769+
pdb_file.write(f"HEADER {label.name}_density\n")
770770
norm_weights = vals / vals.max()
771771
[
772772
pdb_file.write(
@@ -784,8 +784,8 @@ def write_labels(pdb_file: TextIO, *args: sl.SpinLabel,
784784
)
785785
for i in range(len(norm_weights))
786786
]
787+
pdb_file.write("TER\n")
787788

788-
pdb_file.write("TER\n")
789789

790790

791791
def write_atoms(file: TextIO,

0 commit comments

Comments
 (0)