Commit a83baf1b authored by cmaffeo2's avatar cmaffeo2
Browse files

polygon_mesh: Changed bead positions at crossovers to fix issue with single-nt polymers

parent f50dfd14
......@@ -50,10 +50,13 @@ if __name__ == '__main__':
model = read_model( infile )
if args.output_prefix is not None:
prefix = args.output_prefix
run_args = dict(
model = model,
output_name = args.output_prefix,
job_id = "job-"+args.output_prefix,
output_name = prefix,
job_id = "job-" + prefix,
directory = args.directory,
gpu = args.gpu,
coarse_steps = args.coarse_steps,
......@@ -61,7 +64,5 @@ if __name__ == '__main__':
backbone_scale = args.backbone_scale
)
if args.output_prefix == None:
run_args['output_name'] = prefix
simulate( **run_args )
......@@ -13,7 +13,7 @@ from .segmentmodel_from_pdb import SegmentModelFromPdb
## TODO: make module this package conform to a single style for input/output
def read_cadnano(json_file, **model_parameters):
data = read_json_file
data = read_json_file(json_file)
return model_from_cadnano_json(data)
def read_vhelix(maya_file, **model_parameters):
......
......@@ -326,9 +326,15 @@ def convert_maya_to_segments(helices):
if top not in connectionToSingleStrand:
ssSeg = get_end3_ssDNA(top)
if len(ssSeg) > 0:
seg2 = SingleStrandedSegment("strand",
start_position = ssSeg[0].get_position(),
end_position = ssSeg[-1].get_position(),
r0 = ssSeg[0].get_position()
if ssSeg[0].end5 is not None:
r0 = 0.75*r0 + 0.25*ssSeg[0].end5.get_position()
r1 = ssSeg[-1].get_position()
if ssSeg[-1].end3 is not None:
r1 = 0.75*r1 + 0.25*ssSeg[-1].end3.get_position()
seg2 = SingleStrandedSegment("S{:03d}".format(len(ss_segments)),
start_position = r0,
end_position = r1,
num_nt = len(ssSeg))
seg.connect_end3(seg2)
connectionToSingleStrand[top] = seg2
......@@ -354,9 +360,15 @@ def convert_maya_to_segments(helices):
if top.basepair not in connectionToSingleStrand:
ssSeg = get_end5_ssDNA(top.basepair)[::-1]
if len(ssSeg) > 0:
seg2 = SingleStrandedSegment("strand",
start_position = ssSeg[-1].get_position(),
end_position = ssSeg[0].get_position(),
r0 = ssSeg[-1].get_position()
if ssSeg[-1].end5 is not None:
r0 = 0.75*r0 + 0.25*ssSeg[-1].end5.get_position()
r1 = ssSeg[0].get_position()
if ssSeg[0].end3 is not None:
r1 = 0.75*r1 + 0.25*ssSeg[0].end3.get_position()
seg2 = SingleStrandedSegment("S{:03d}".format(len(ss_segments)),
start_position = r0,
end_position = r1,
num_nt = len(ssSeg))
seg.connect_end5(seg2)
connectionToSingleStrand[top.basepair] = seg2
......@@ -382,9 +394,15 @@ def convert_maya_to_segments(helices):
if bot not in connectionToSingleStrand:
ssSeg = get_end3_ssDNA(bot)
if len(ssSeg) > 0:
seg2 = SingleStrandedSegment("strand",
start_position = ssSeg[0].get_position(),
end_position = ssSeg[-1].get_position(),
r0 = ssSeg[0].get_position()
if ssSeg[0].end5 is not None:
r0 = 0.75*r0 + 0.25*ssSeg[0].end5.get_position()
r1 = ssSeg[-1].get_position()
if ssSeg[-1].end3 is not None:
r1 = 0.75*r1 + 0.25*ssSeg[-1].end3.get_position()
seg2 = SingleStrandedSegment("S{:03d}".format(len(ss_segments)),
start_position = r0,
end_position = r1,
num_nt = len(ssSeg))
seg.connect_start3(seg2)
connectionToSingleStrand[bot] = seg2
......@@ -406,9 +424,15 @@ def convert_maya_to_segments(helices):
if bot.basepair not in connectionToSingleStrand:
ssSeg = get_end5_ssDNA(bot.basepair)[::-1]
if len(ssSeg) > 0:
seg2 = SingleStrandedSegment("strand",
start_position = ssSeg[-1].get_position(),
end_position = ssSeg[0].get_position(),
r0 = ssSeg[-1].get_position()
if ssSeg[-1].end5 is not None:
r0 = 0.75*r0 + 0.25*ssSeg[-1].end5.get_position()
r1 = ssSeg[0].get_position()
if ssSeg[0].end3 is not None:
r1 = 0.75*r1 + 0.25*ssSeg[0].end3.get_position()
seg2 = SingleStrandedSegment("S{:03d}".format(len(ss_segments)),
start_position = r0,
end_position = r1,
num_nt = len(ssSeg))
seg.connect_start5(seg2)
connectionToSingleStrand[bot.basepair] = seg2
......
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