UC-Davis-molecular-computing / scadnano-python-package

Python scripting library for generating designs readable by scadnano.
https://scadnano.org
MIT License
13 stars 7 forks source link

Dev #256

Closed dave-doty closed 1 year ago

dave-doty commented 1 year ago

Release notes

new method Design.base_pairs()

This method returns a dict mapping helix idx's where base pairs exist to a list of offsets where those base pairs are.

Domain/Extension/Loopout colors

Individual Domain's, Extension's, and Loopout's now have a color field. If specified, then this overrides the field Strand.color in the display. There is also a new method StrandBuilder.with_domain_color():

helices = [sc.Helix(max_offset=100) for _ in range(4)]
design = sc.Design(helices=helices, grid=sc.square)

red = sc.Color(255, 0, 0)
dark_red = sc.Color(150, 0, 0)
green = sc.Color(0, 255, 0)
dark_green = sc.Color(0, 150, 0)
blue = sc.Color(0, 0, 255)
dark_blue = sc.Color(0, 0, 150)
black = sc.Color(0, 0, 0)

design.draw_strand(0, 0) \
    .extension_5p(num_bases=5).with_domain_color(red) \
    .move(8).with_domain_color(green) \
    .loopout(1, 5).with_domain_color(dark_blue) \
    .move(-8).with_domain_color(dark_red) \
    .cross(2) \
    .move(8).with_domain_color(dark_green) \
    .cross(3) \
    .move(-8) \
    .extension_3p(num_bases=5).with_domain_color(black) \
    .with_color(blue)

image