예제 #1
0
def create_design():
    length = 10
    helices = [
        sc.Helix(max_offset=length,
                 position=sc.Position3D(x=0, y=0, z=2.5),
                 pitch=0,
                 roll=0,
                 yaw=0),
        sc.Helix(max_offset=length,
                 position=sc.Position3D(x=3, y=3, z=0),
                 pitch=0,
                 roll=0,
                 yaw=0),
        sc.Helix(max_offset=length,
                 position=sc.Position3D(x=8, y=-3, z=0),
                 pitch=0,
                 roll=0,
                 yaw=0),
        sc.Helix(max_offset=length,
                 position=sc.Position3D(x=11, y=1, z=0),
                 pitch=0,
                 roll=0,
                 yaw=0),
    ]
    stap_ss = sc.Domain(0, True, 0, length)
    scaf_ss = sc.Domain(0, False, 0, length)
    stap = sc.Strand([stap_ss])
    scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
    strands = [stap, scaf]
    design = sc.Design(helices=helices, strands=strands, grid=sc.Grid.none)

    return design
예제 #2
0
def main():
    length = 16
    helices = [
        sc.Helix(major_tick_distance=4,
                 max_offset=length,
                 position=sc.Position3D(x=0, y=0, z=0),
                 min_offset=0),
        sc.Helix(major_tick_distance=4,
                 max_offset=length,
                 position=sc.Position3D(x=0, y=3, z=3),
                 min_offset=8),
        sc.Helix(major_tick_distance=4,
                 max_offset=length,
                 position=sc.Position3D(x=2.5, y=-3, z=8),
                 min_offset=0),
        sc.Helix(major_tick_distance=4,
                 max_offset=length,
                 position=sc.Position3D(x=2.5, y=1, z=11),
                 min_offset=8),
    ]
    design = sc.DNADesign(helices=helices,
                          strands=[
                              sc.Strand([sc.Domain(0, True, 0, length)]),
                              sc.Strand([sc.Domain(1, True, 8, length)]),
                              sc.Strand([sc.Domain(2, True, 0, length)]),
                              sc.Strand([sc.Domain(3, True, 8, length)]),
                          ],
                          grid=sc.Grid.none)

    return design
예제 #3
0
def idx_to_position(idx: int):
    x = 0
    y = 0
    angle = 0
    for _ in range(idx):
        x += math.cos(angle) * 2.5
        y += math.sin(angle) * 2.5
        angle += 2 * math.pi / 16
    return sc.Position3D(x=x, y=y)
예제 #4
0
def idx_to_position(idx: int) -> sc.Position3D:
    z = 0
    y = 0
    angle = 0
    for _ in range(idx):
        z += math.cos(angle) * 2.5
        y += math.sin(angle) * 2.5
        angle += 2 * math.pi / 16
    return sc.Position3D(x=0, y=y, z=z)
예제 #5
0
def main():
    length = 9
    helices = [
        sc.Helix(max_offset=length,
                 major_ticks=[2, 5],
                 position3d=sc.Position3D(x=3, y=2, z=1),
                 pitch=90)
    ]
    stap_ss = sc.Domain(0, sc.forward, 0, length)
    scaf_ss = sc.Domain(0, sc.reverse, 0, length)
    stap = sc.Strand([stap_ss])
    scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
    strands = [stap, scaf]
    design = sc.DNADesign(helices=helices, strands=strands, grid=sc.square)
    design.assign_dna(scaf, 'AACT' * (length // 4))

    return design
예제 #6
0
def create_design():
    length = 9
    helices = [
        sc.Helix(max_offset=length,
                 major_ticks=[2, 5],
                 position=sc.Position3D(x=1, y=2, z=3),
                 pitch=90)
    ]
    stap_ss = sc.Domain(0, True, 0, length)
    scaf_ss = sc.Domain(0, False, 0, length)
    stap = sc.Strand([stap_ss])
    scaf = sc.Strand([scaf_ss], color=sc.default_scaffold_color)
    strands = [stap, scaf]
    design = sc.Design(helices=helices, strands=strands, grid=sc.Grid.none)
    design.assign_dna(scaf, 'AACT' * (length // 4))

    return design
예제 #7
0
def create_design():
    include_rot = False
    include_rot = True
    n = 'north'
    e = 'east'
    s = 'south'
    w = 'west'
    helices = [
        sc.Helix(max_offset=20, group=n, grid_position=(0, 0)),  # 0
        sc.Helix(max_offset=21, group=n, grid_position=(1, 0)),  # 1
        sc.Helix(max_offset=19, group=n, grid_position=(1, 1)),  # 2
        sc.Helix(max_offset=18, group=n, grid_position=(0, 1)),  # 3
        sc.Helix(max_offset=17, group=n, grid_position=(-1, 1)),  # 4
        sc.Helix(max_offset=16, group=n, grid_position=(-1, 0)),  # 5
        sc.Helix(max_offset=24, group=s),  # 6
        sc.Helix(max_offset=25, group=s),  # 7
        sc.Helix(max_offset=26, group=w, position=sc.Position3D(x=0, y=0,
                                                                z=0)),  # 8
        sc.Helix(max_offset=27, group=w, position=sc.Position3D(x=0, y=3,
                                                                z=0)),  # 9
    ]
    if include_rot:
        helices.extend([
            sc.Helix(max_offset=26, group='r', grid_position=(0, 0)),  # 10
            sc.Helix(max_offset=27, group='r', grid_position=(0, 1)),  # 11
        ])
    helices.extend([
        sc.Helix(idx=13, max_offset=22, group=e),  # 13
        sc.Helix(idx=15, max_offset=23, group=e),  # 15
    ])

    group_north = sc.HelixGroup(position=sc.Position3D(x=0, y=-10, z=0),
                                grid=sc.honeycomb)
    group_south = sc.HelixGroup(position=sc.Position3D(x=0, y=10, z=0),
                                helices_view_order=[7, 6],
                                grid=sc.square)
    group_east = sc.HelixGroup(position=sc.Position3D(x=0, y=0, z=10),
                               grid=sc.square)
    group_west = sc.HelixGroup(position=sc.Position3D(x=0, y=0, z=-10),
                               grid=sc.Grid.none)
    groups = {
        n: group_north,
        e: group_east,
        s: group_south,
        w: group_west,
    }

    if include_rot:
        group_rot = sc.HelixGroup(position=sc.Position3D(x=00, y=10, z=10),
                                  pitch=45,
                                  grid=sc.square)
        groups['r'] = group_rot

    design = sc.Design(helices=helices, groups=groups, strands=[])

    design.strand(0, 0).to(8) \
        .cross(1).to(0) \
        .cross(2).to(8) \
        .cross(3).to(0) \
        .cross(4).to(8) \
        .cross(5).to(0)

    design.strand(4, 10).to(13)

    design.strand(6, 0).to(8).cross(7).to(0)
    design.strand(8, 0).to(8).cross(9).to(0)
    design.strand(13, 0).to(8).cross(15).to(0)

    design.strand(8, 8).to(11)
    design.strand(13, 8).to(11)

    if include_rot:
        design.strand(10, 0).to(8).cross(11).to(0)

    return design