Release notes
new method [`Design.base_pairs()`](https://scadnano-python-package.readthedocs.io/en/latest/#scadnano.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` when displayed in the web interface. There is also a new method `StrandBuilder.with_domain_color()`:
python
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](https://user-images.githubusercontent.com/19274365/205503932-8c2c33d0-a113-4d29-8918-2d6d6e804e8e.png)
Commits
- 5586c9f: bumped version (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- 6463865: closes 252: add method `Design.base_pairs()` (David Doty) [254](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/254)
- fec6f43: changed return type of `Design.base_pairs()` to dict and added `allow_mismatches` parameter (David Doty) [254](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/254)
- e795627: fixed unit tests after updating `with_sequence` and `with_domain_sequence` to default to not assigning complement (David Doty) [254](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/254)
- 6b6001a: removed unused _popleft() function (David Doty) [254](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/254)
- e55609d: Update scadnano.py (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- afc44b8: don't put Helix idx in base_pairs dict if Helix has no base pairs (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- 1049cdc: fixed base pair calculation to allow for deletions/insertions/wildcards/None if DNA sequence is not assigned (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- e6c0737: added unit test for no base pairs (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- f81b8ff: Update scadnano_tests.py (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- 7b83a43: fixed bug in `Design.base_pairs()` when no reverse domains on helix (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- 5312a59: Update scadnano_tests.py (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)
- 1b7e605: closes 238: Domain colors (David Doty) [255](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/255)
- fea3b32: added example with domain colors (David Doty) [256](https://github.com/UC-Davis-molecular-computing/scadnano-python-package/pull/256)