Commit 70017fbc authored by New Tbgl User's avatar New Tbgl User
Browse files

Brough in some changes to cadnano_segments.py from origamitwo server

parent 7415864a
......@@ -2,8 +2,10 @@
import pdb
import numpy as np
import os,sys
from coords import readArbdCoords, readAvgArbdCoords
from glob import glob
import re
from coords import readArbdCoords, readAvgArbdCoords
from segmentmodel import SegmentModel, SingleStrandedSegment, DoubleStrandedSegment
arbd="/home/cmaffeo2/development/cuda/arbd.dbg/src/arbd" # reduced the mem footprint cause vmd
......@@ -276,7 +278,7 @@ def decode_cadnano_part(json_data):
def package_archive( name, directory ):
...
def run_simulation_protocol( output_name, json_data,
def run_simulation_protocol( output_name, job_id, json_data,
sequence=None,
remove_long_bonds=False,
gpu = 0,
......@@ -284,14 +286,14 @@ def run_simulation_protocol( output_name, json_data,
):
coarseSteps = 1e7
fineSteps = 1e6
fineSteps = 1e6
ret = None
d_orig = os.getcwd()
try:
if directory is None:
import tempfile
directory = tempfile.mkdtemp(prefix='origami-'+output_name, dir='./')
directory = tempfile.mkdtemp(prefix='origami-%s-' % job_id, dir='/dev/shm/')
elif not os.path.exists(directory):
os.makedirs(directory)
os.chdir(directory)
......@@ -320,8 +322,7 @@ def run_simulation_protocol( output_name, json_data,
# print(sequence)
# for i in sequence:
# print( i, i in ('A','T','C','G') )
# model.strands[0].set_sequence(sequence)
model.strands[0].set_sequence(sequence)
for s in model.segments:
s.randomize_unset_sequence()
......@@ -380,16 +381,8 @@ def run_simulation_protocol( output_name, json_data,
model._generate_atomic_model(scale=0.25)
model.atomic_simulate( outputPrefix = full_output_prefix )
# if not os.path.exists(output_directory):
# os.makedirs(output_directory)
# elif not os.path.isdir(output_directory):
# raise Exception("output_directory '%s' is not a directory!" % output_directory)
ret = directory
""" Package result """
ret = "{}@{}:{}".format( os.environ["USER"],
os.environ["HOSTNAME"],
"/path/to/archive.tar.gz" )
except:
raise
finally:
......@@ -405,11 +398,8 @@ def run_simulation_protocol( output_name, json_data,
if __name__ == '__main__':
from glob import glob
import re
for f in glob('json/*'):
print("Working on {}".format(f))
out = re.match('json/(.*).json',f).group(1)
data = read_json_file(f)
run_simulation_protocol( out, data, gpu=0 )
run_simulation_protocol( out, "job-id", data, gpu=0 )
......@@ -9,4 +9,4 @@ if __name__ == '__main__':
print("Working on {}".format(f))
out = re.match('json/(.*).json',f).group(1)
data = read_json_file(f)
run_simulation_protocol( out, data, gpu=0 )
run_simulation_protocol( out, "job-id", data, gpu=0 )
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