Skip to content

Commit

Permalink
new exclude_hydrogen option
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmoriarty committed Nov 4, 2023
1 parent ab6e2b3 commit 99696d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mmtbx/programs/arginine_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class Program(ProgramTemplate):
.type = atom_selection
.help = what to select
.multiple = True
exclude_hydrogen = False
.type = bool
print_torsion_limit = 1.
.type = float
print_torsion_number = 10
Expand Down Expand Up @@ -148,7 +150,7 @@ def arginine_simple(self):
current[tuple(torsion_atom_names)]=v
self.results.process()

def torsions_in_planes(self):
def torsions_in_planes(self, exclude_hydrogen=False):
model = self.data_manager.get_model()
model.set_log(null_out())
model.process(make_restraints=True)
Expand Down Expand Up @@ -187,6 +189,7 @@ def torsions_in_planes(self):
if atom.element_is_hydrogen(): h_atom=True
torsion_xyzs.append(atom.xyz)
torsion_strs += '%s - ' % (atom.id_str()[4:])
if exclude_hydrogen and h_atom: continue
v = geometry_restraints.dihedral(sites=torsion_xyzs, angle_ideal=0, weight=1).angle_model
v = get_torsion_deviations(v)
self.results[torsion_strs[:-2]]=[v, h_atom]
Expand All @@ -197,7 +200,7 @@ def run(self, log=None):
# self.arginine_simple()
self.results = plane_torsion_deviations(self.params.arginine.print_torsion_limit,
self.params.arginine.print_torsion_number)
self.torsions_in_planes()
self.torsions_in_planes(self.params.arginine.exclude_hydrogen)
print('\n%s' % self.results, file=log)
reduce_H_atoms = self.results.is_possible_reduce()
print(' Has reduce-like H atoms : %s\n' % reduce_H_atoms if reduce_H_atoms else '', file=log)
Expand Down

0 comments on commit 99696d1

Please sign in to comment.