Generally we don't encourage putting isolated deletions/insertions. But in this case, it makes sense to put a wildcard symbol. However, we should first add a (default True) boolean paramater to Design.assign_dna that raises an exception if some pair of Domains mismatch deletions or insertions in this way. Only if the user explicitly sets it to False would we assign the wildcard, since this could mask a subtle bug in the design.
This error was originally identified in the following design, but the minimal reproducible example is above.
(Calling design.assign_m13_to_scaffold raises an exception because that design has two scaffolds, one is a small isolated strand on helix 37.)
It raises this exception:
File "C:\Dropbox\git\scadnano-python-package\tests\scadnano_tests.py", line 595, in test_minitri_assign_m13
design.assign_dna(design.scaffold, sc.m13())
File "C:\Dropbox\git\scadnano-python-package\scadnano\scadnano.py", line 5499, in assign_dna
other_strand.assign_dna_complement_from(strand)
File "C:\Dropbox\git\scadnano-python-package\scadnano\scadnano.py", line 3107, in assign_dna_complement_from
merged_domain_self_dna_sequence = _string_merge_wildcard(domain_self_dna_sequence,
File "C:\Dropbox\git\scadnano-python-package\scadnano\scadnano.py", line 3426, in _string_merge_wildcard
raise ValueError(f'\ns1={s1} and\ns2={s2}\nare not the same length.')
ValueError:
s1=CTGGAAG and
s2=????????
are not the same length.
Create a design where one domain has a deletion but the domain it is bound to does not:
Assign DNA to the strand with the deletion:
I'm showing this above in the web interface to help visualize, but you get the same error in the Python package:
Expected behavior
Generally we don't encourage putting isolated deletions/insertions. But in this case, it makes sense to put a wildcard symbol. However, we should first add a (default True) boolean paramater to
Design.assign_dna
that raises an exception if some pair of Domains mismatch deletions or insertions in this way. Only if the user explicitly sets it to False would we assign the wildcard, since this could mask a subtle bug in the design.This error was originally identified in the following design, but the minimal reproducible example is above.
Import this cadnano design and run
(Calling
design.assign_m13_to_scaffold
raises an exception because that design has two scaffolds, one is a small isolated strand on helix 37.)It raises this exception: