Commit 32ce45a6 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added option to exclude interhelical bonds from atomic ENM

parent 97f92674
......@@ -3449,7 +3449,7 @@ class SegmentModel(ArbdModel):
j = nt2._get_atomic_index(name=n2)
fh.write("bond %d %d %f %.2f\n" % (i,j,spring_constant,2.8))
def write_atomic_ENM(self, output_name, lattice_type=None):
def write_atomic_ENM(self, output_name, lattice_type=None, interhelical_bonds=True):
## TODO: ensure atomic model was generated already
if lattice_type is None:
try:
......@@ -3600,20 +3600,20 @@ class SegmentModel(ArbdModel):
...
# print("PUSH BONDS:", len(push_bonds))
if not self.useTclForces:
with open("%s.exb" % output_name, 'a') as fh:
for i,j in push_bonds:
fh.write("bond %d %d %f %.2f\n" % (i,j,1.0,31))
else:
flat_push_bonds = list(sum(push_bonds))
atomList = list(set( flat_push_bonds ))
with open("%s.forces.tcl" % output_name,'w') as fh:
fh.write("set atomList {%s}\n\n" %
" ".join([str(x-1) for x in atomList]) )
fh.write("set bonds {%s}\n" %
" ".join([str(x-1) for x in flat_push_bonds]) )
fh.write("""
if interhelical_bonds:
if not self.useTclForces:
with open("%s.exb" % output_name, 'a') as fh:
for i,j in push_bonds:
fh.write("bond %d %d %f %.2f\n" % (i,j,1.0,31))
else:
flat_push_bonds = list(sum(push_bonds))
atomList = list(set( flat_push_bonds ))
with open("%s.forces.tcl" % output_name,'w') as fh:
fh.write("set atomList {%s}\n\n" %
" ".join([str(x-1) for x in atomList]) )
fh.write("set bonds {%s}\n" %
" ".join([str(x-1) for x in flat_push_bonds]) )
fh.write("""
foreach atom $atomList {
addatom $atom
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment