UC-Davis-molecular-computing / scadnano

Web application for designing DNA structures such as DNA origami.
https://scadnano.org
MIT License
24 stars 13 forks source link

overlapping domains should not be able to be drawn #855

Open EdwinChang24 opened 1 year ago

EdwinChang24 commented 1 year ago

Looks like domains can be created like this:

image

When this happens, no error is immediately thrown, but when reloading the page, this message appears:

Click to show ``` ****************** * illegal design * ****************** The design has the following problem: two domains overlap on helix 1: Domain { helix=1, forward=true, start=0, end=8, deletions=[], insertions=[], is_first=true, is_last=true, is_scaffold=false, strand_id=strand-H1-0-forward, unused_fields={}, } and Domain { helix=1, forward=true, start=1, end=7, deletions=[], insertions=[], is_first=true, is_last=true, is_scaffold=false, strand_id=strand-H1-1-forward, unused_fields={}, } but have the same direction ********************************************************************************** * If you believe this is due to a bug in scadnano, please file a bug report at * * https://github.com/UC-Davis-molecular-computing/scadnano/issues * * Include this entire message in the email. * ********************************************************************************** stack trace: dart:sdk_internal 4850:11 throw_ package:scadnano/src/state/design.dart 1483:15 check_strands_overlap_legally package:scadnano/src/state/design.dart 1366:5 [_check_legal_design] package:scadnano/src/state/design.dart 120:11 new package:scadnano/src/state/design.dart 1303:12 from_json package:scadnano/src/state/design.dart 1254:19 from_json_str package:scadnano/src/reducers/load_dna_file_reducer.dart 25:29 load_dna_file_reducer$ package:scadnano/src/reducers/app_state_reducer.dart 21:12 app_state_reducer$ package:redux_dev_tools/src/state.dart 38:17 fromApp package:redux_dev_tools/src/reducer.dart 31:20 call package:redux/src/store.dart 235:28 package:redux_dev_tools/src/middleware.dart 35:20 package:over_react/src/over_react_redux/devtools/middleware.dart 176:9 call package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/oxdna_export.dart 48:7 oxdna_export_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/zoom_speed.dart 15:7 zoom_speed_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/system_clipboard.dart 38:9 system_clipboard_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/autostaple_and_autobreak.dart 20:9 autostaple_and_autobreak_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/periodic_save_design_local_storage.dart 14:7 periodic_design_save_local_storage_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/edit_select_mode_change.dart 32:7 edit_select_mode_change_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/check_mirror_strands_legal.dart 59:9 check_reflect_strands_legal_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/invalidate_png.dart 14:7 invalidate_png_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/adjust_grid_position.dart 14:9 adjust_grid_position_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/insertion_deletion_batching.dart 38:9 insertion_deletion_batching_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/selections_intersect_box_compute.dart 78:9 selections_intersect_box_compute_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/reselect_moved_domains.dart 68:9 reselect_moved_domains_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/reselect_moved_copied_strands.dart 73:9 reselect_moved_copied_strands_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/reselect_moved_dna_extension_ends.dart 39:9 reselect_moved_dna_extension_ends_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/reselect_moved_dna_ends.dart 38:9 reselect_moved_dna_ends_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/export_dna_sequences.dart 11:7 export_dna_sequences_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/dna_extensions_move_start.dart 76:9 dna_extensions_move_start_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/dna_ends_move_start.dart 48:9 dna_ends_move_start_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helices_positions_set_based_on_crossovers.dart 29:7 helix_positions_set_based_on_crossovers_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helix_hide_all.dart 10:7 helix_hide_all_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helix_grid_change.dart 51:7 helix_grid_offsets_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helix_idxs_change.dart 52:7 helix_idxs_change_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helix_offsets_change.dart 50:7 helix_change_offsets_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helix_group_move_start.dart 42:9 helix_group_move_start_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/group_remove.dart 27:9 group_remove_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/helix_remove.dart 45:7 helix_remove_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/strand_create.dart 12:7 strand_create_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 package:redux_dev_tools/src/middleware.dart 35:20 package:scadnano/src/middleware/assign_dna.dart 22:7 assign_dna_middleware package:redux_dev_tools/src/middleware.dart 39:25 call package:redux/src/store.dart 255:43 ```
dave-doty commented 1 year ago

Oh wow... is that by clicking in the small white space in the helix adjacent to the existing domain?

At any rate, this is definitely a bug and should just be prevented. Thanks for finding it!

dave-doty commented 1 year ago

I don't know how to reproduce this. If it can be reproduced, re-open the issue and describe in detail what steps are needed to create the design shown in the first comment above.

EdwinChang24 commented 1 year ago

I'm able to reproduce this bug in the current dev branch by drawing a domain, and then drawing another domain starting on one side of the first domain and ending on the other side to overlap the first domain. This was fixed in the original pull request (#860) but reintroduced in #883.

dave-doty commented 1 year ago

I'm able to reproduce this bug in the current dev branch by drawing a domain, and then drawing another domain starting on one side of the first domain and ending on the other side to overlap the first domain. This was fixed in the original pull request (#860) but reintroduced in #883.

Ah, I see it now! scadnano prevents dragging the cursor into the middle of the domain, but if you reach to the other side of it, it allows you to draw it.

Hmm, right now I'm not seeing how to fix the logic in a way that won't re-introduce the bug in #883, but maybe we can discuss in our next meeting

dave-doty commented 1 year ago

I removed the "closed in dev" because this behavior still appears on the dev server (https://scadnano.org/dev/) and when I run locally from the dev branch.

I'm a bit confused about the history here, I see some of the comments here were made after PR #860, but for some reason I thought we had fixed this issue again after that.