Commit aea81edd authored by cmaffeo2's avatar cmaffeo2
Browse files

Updated readers to more consistently read sequence

parent 1b3ad2f1
......@@ -8,6 +8,7 @@ def read_sequence_file(sequenceFile=_m13_path):
l = l.strip().replace(" ", "")
if l[0] in (";","#"): continue
seq.extend([c.upper() for c in l])
return seq
return list(seq)
m13 = read_sequence_file()
......@@ -6,6 +6,7 @@ from .cadnano_segments import read_model as model_from_cadnano_json
""" vHelix """
from .polygon_mesh import parse_maya_file, convert_maya_to_segments
from ..model.dna_sequence import m13 as m13seq
""" Atomic PDB """
from .segmentmodel_from_pdb import SegmentModelFromPdb
......@@ -19,7 +20,9 @@ def read_cadnano(json_file, **model_parameters):
def read_vhelix(maya_file, **model_parameters):
data = parse_maya_file(maya_file)
segments, dsSegmentDict = convert_maya_to_segments( data )
return SegmentModel( segments,**model_parameters )
model = SegmentModel( segments,**model_parameters )
model.set_sequence(m13seq*10)
return model
def read_atomic_pdb(pdb_file, **model_parameters):
return SegmentModelFromPdb(pdb_file)
......@@ -541,16 +541,9 @@ def read_model(json_data, sequence=None):
if sequence is None or len(sequence) == 0:
## default m13mp18
sequence = list(m13seq)
try:
model.strands[0].set_sequence(sequence)
except:
...
model.set_sequence(m13seq,force=False)
else:
model.strands[0].set_sequence(sequence)
for s in model.segments:
s.randomize_unset_sequence()
model.set_sequence(sequence)
return model
......
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