Commit 47b578f2 authored by cmaffeo2's avatar cmaffeo2
Browse files

Set origin of arbd box using structure in mrdna script

parent 11161c71
......@@ -9,6 +9,7 @@ import re
import pathlib
from mrdna import __version__ as __version__
from mrdna.simulate import multiresolution_simulation as simulate
import numpy as np
"""Easy multiresolution simulations of DNA nanotechnology objects using ARBD"""
......@@ -107,8 +108,9 @@ def main():
model = read_model( str(infile), debye_length=args.debye_length, temperature=args.temperature )
if args.dimensions is None:
model.dimensions = [max(f,2500)
for f in model.dimensions_from_structure( padding_factor=2.5 )]
dim = model.dimensions_from_structure( padding_factor=2.5 )
model.dimensions = dim
model.origin = model.get_center()-0.5*np.array(model.dimensions)
else:
model.dimensions = args.dimensions
......
......@@ -628,10 +628,11 @@ class PdbModel(Transformable, Parent):
class ArbdModel(PdbModel):
def __init__(self, children, dimensions=(1000,1000,1000), temperature=291, timestep=50e-6, cutoff=50, decompPeriod=10000, pairlistDistance=None, nonbondedResolution=0.1, remove_duplicate_bonded_terms=True, extra_bd_file_lines=""):
def __init__(self, children, dimensions=(1000,1000,1000), origin=None, temperature=291, timestep=50e-6, cutoff=50, decompPeriod=10000, pairlistDistance=None, nonbondedResolution=0.1, remove_duplicate_bonded_terms=True, extra_bd_file_lines=""):
PdbModel.__init__(self, children, dimensions, remove_duplicate_bonded_terms)
self.temperature = temperature
self.origin = origin
self.timestep = timestep
self.cutoff = cutoff
......@@ -837,8 +838,15 @@ class ArbdModel(PdbModel):
params['outputPeriod'] = outputPeriod
for k,v in zip('XYZ', self.dimensions):
params['origin'+k] = -v*0.5
params['dim'+k] = v
if self.origin is None:
for k,v in zip('XYZ', self.dimensions):
params['origin'+k] = -v*0.5
else:
for k,v in zip('XYZ', self.origin):
params['origin'+k] = v
params['pairlistDistance'] -= params['cutoff']
......
......@@ -1541,6 +1541,7 @@ class SegmentModel(ArbdModel):
def __init__(self, segments=[], local_twist=True, escapable_twist=True,
max_basepairs_per_bead=7,
max_nucleotides_per_bead=4,
origin = None,
dimensions=(5000,5000,5000), temperature=291,
timestep=50e-6, cutoff=50,
decompPeriod=10000, pairlistDistance=None,
......
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