Commit f1c64034 authored by cmaffeo2's avatar cmaffeo2
Browse files

Automatically write atomic ENM in multiresolution_simulation; fixed error in...

Automatically write atomic ENM in multiresolution_simulation; fixed error in ENM causing failure for square lattice
parent befc24fb
......@@ -255,6 +255,6 @@ if __name__ == "__main__":
model._clear_beads()
model._generate_atomic_model(scale=1.0)
model._write_atomic_ENM( 'test-from-pdb', lattice_type="honeycomb" )
model.write_atomic_ENM( 'test-from-pdb' )
model.atomic_simulate( outputPrefix = 'test-from-pdb' )
......@@ -2376,10 +2376,13 @@ class SegmentModel(ArbdModel):
for s in self.strands:
s.update_atomic_orientations(orientation)
def _write_atomic_ENM(self, prefix, lattice_type=None):
def write_atomic_ENM(self, prefix, lattice_type=None):
## TODO: ensure atomic model was generated already
if lattice_type is None:
lattice_type = self.lattice_type
try:
lattice_type = self.lattice_type
except:
lattice_type = "square"
if lattice_type == "square":
enmTemplate = enmTemplateSQ
......@@ -2429,9 +2432,9 @@ class SegmentModel(ArbdModel):
if lattice_type == 'honeycomb':
correctionKey = ','.join((key,n1,n2))
assert(correctionKey in enmCorrectionsHC)
dk,dr = enmCorrectionsHC[correctionKey]
k = float(dk)
d += float(dr)
dk,dr = enmCorrectionsHC[correctionKey]
k = float(dk)
d += float(dr)
i = nt1._get_atomic_index(name=n1)
j = nt2._get_atomic_index(name=n2)
......
......@@ -97,6 +97,7 @@ def multiresolution_simulation( model, output_name,
model.update_splines(coordinates)
model._clear_beads()
model._generate_atomic_model(scale=backbone_scale)
model.write_atomic_ENM( output_prefix )
model.atomic_simulate( outputPrefix = output_prefix )
ret = directory
......
Supports Markdown
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