Skip to content
Snippets Groups Projects
Commit 616ca8e2 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added 'read_model' to cadnano_segments

parent ad9e6189
No related branches found
No related tags found
No related merge requests found
...@@ -544,6 +544,39 @@ def decode_cadnano_part(json_data): ...@@ -544,6 +544,39 @@ def decode_cadnano_part(json_data):
def package_archive( name, directory ): 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, def run_simulation_protocol( output_name, job_id, json_data,
sequence=None, sequence=None,
remove_long_bonds=False, remove_long_bonds=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment