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

`Design.add_full_crossover` and `Design.add_half_crossover` should check for existing crossovers #231

Closed dave-doty closed 2 years ago

dave-doty commented 2 years ago

Imagine we have the following design, which has crossovers (which appear horizontal in the web interface) between domains that are consecutive on each helix:

# helix 0 [------+^+------>
# 
# helix 1 <------+^+------]
design = Design(helices=[Helix(100), Helix(100)])
design.draw_strand(0, 0).move(8).move(8)
design.draw_strand(1, 16).move(-8).move(-8)

The following code should raise an exception, because it is trying to add a crossover at an offset where there is already a crossover:

design.add_full_crossover(helix-0, helix2=1, offset=8, forward=True)