Commit 89279732 authored by cmaffeo2's avatar cmaffeo2
Browse files

Add public versions of _generate_atomic_model and _generate_bead_model; moved...

Add public versions of _generate_atomic_model and _generate_bead_model; moved generation of strands in __init__ to precede generation of beads comands,
parent 34556ed5
......@@ -1333,12 +1333,11 @@ class SegmentModel(ArbdModel):
self.children = self.segments = segments
self._bonded_potential = dict() # cache for bonded potentials
self._generate_strands()
self._generate_bead_model( max_basepairs_per_bead, max_nucleotides_per_bead, local_twist, escapable_twist)
self.useNonbondedScheme( nbDnaScheme )
self.useTclForces = False
self._generate_strands()
def get_connections(self,type_=None,exclude=()):
""" Find all connections in model, without double-counting """
......@@ -1467,6 +1466,7 @@ class SegmentModel(ArbdModel):
return self._clear_beads()
def _clear_beads(self):
## TODO: deprecate
for s in self.segments:
s.clear_all()
self.clear_all(keep_children=True)
......@@ -1641,7 +1641,20 @@ class SegmentModel(ArbdModel):
max_nucleotides_per_bead = 4,
local_twist=False,
escapable_twist=True):
## TODO: deprecate
self.generate_bead_model( max_basepairs_per_bead = max_basepairs_per_bead,
max_nucleotides_per_bead = max_nucleotides_per_bead,
local_twist=local_twist,
escapable_twist=escapable_twist)
def generate_bead_model(self,
max_basepairs_per_bead = 7,
max_nucleotides_per_bead = 4,
local_twist=False,
escapable_twist=True):
self.children = self.segments # is this okay?
self.clear_beads()
segments = self.segments
for s in segments:
......@@ -2649,7 +2662,12 @@ proc calcforces {} {
self.dimensions = [dx,dy,dz]
def _generate_atomic_model(self, scale=1):
self.children = self.strands
## TODO: deprecate
self.generate_atomic_model(scale=scale)
def generate_atomic_model(self, scale=1):
self.clear_beads()
self.children = self.strands # TODO: is this going to be okay? probably
first_atomic_index = 0
for s in self.strands:
first_atomic_index = s.generate_atomic_model(scale,first_atomic_index)
......
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