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

raise exception on unpaired insertions/deletions in `Design.inline_insertions_deletions` and oxDNA/oxView/CanDo export #227

Open dave-doty opened 2 years ago

dave-doty commented 2 years ago

Unpaired insertions/deletions are allowed primarily to keep a user from getting annoyed if they copy+paste or move strands with insertions and deletions. However, they are only intended to be allowed in "intermediate" designs that have not been finalized.

In particular, the behavior of Design.inline_insertions_deletions is strange on unpaired insertions. For example, applying to this design:

image

results in this:

image

This is unintuitive behavior since it shifts which bases are paired to the right of the insertion.

Loopouts are the intended way to represent unpaired bases loopout out from a single strand, e.g.,

image

So Design.inline_insertions_deletions should raise an exception if any deletions or insertions are unpaired. Since export to oxDNA/oxView/CanDo will soon call Design.inline_insertions_deletions as their first step, they will also raise this exception.