Commit 616ca8e2 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added 'read_model' to cadnano_segments

parent ad9e6189
......@@ -544,6 +544,39 @@ def decode_cadnano_part(json_data):
def package_archive( name, directory ):
...
def read_model(json_data, sequence=None):
""" Read in data """
part = decode_cadnano_part(json_data)
model = cadnano_part(part,
max_basepairs_per_bead = 7,
max_nucleotides_per_bead = 4,
local_twist=False)
model._generate_strands() # TODO: move into model creation
# TODO
# try:
# model.set_cadnano_sequence()
# finally:
# ...
# if sequence is not None and len() :
# model.strands[0].set_sequence(seq)
if sequence is None or len(sequence) == 0:
## default m13mp18
sequence = list(m13seq)
try:
model.strands[0].set_sequence(sequence)
except:
...
else:
model.strands[0].set_sequence(sequence)
for s in model.segments:
s.randomize_unset_sequence()
return model
def run_simulation_protocol( output_name, job_id, json_data,
sequence=None,
remove_long_bonds=False,
......
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