From 89649bd7a8a83940a187e62f47a6e2d303b7bd53 Mon Sep 17 00:00:00 2001 From: mmguar Date: Wed, 26 Oct 2022 18:06:29 -0700 Subject: [PATCH] Should fix 825 --- lib/src/state/design.dart | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/src/state/design.dart b/lib/src/state/design.dart index 8ef830287..11e135055 100644 --- a/lib/src/state/design.dart +++ b/lib/src/state/design.dart @@ -2125,6 +2125,23 @@ abstract class Design with UnusedFields implements Built, else start = old_base; + bool running = true; + while(running){ + switch(Design._cadnano_v2_import_extract_end_deletions(vstrands[old_helix]['skip'], start,end)){ + case -1:{ + start = start + 1; + } + break; + case 1:{ + end = end-1; + } + break; + case 0:{ + running = false; + } + } + } + domains.add(Domain( is_scaffold: strand_type == 'scaf', helix: old_helix, @@ -2174,6 +2191,19 @@ abstract class Design with UnusedFields implements Built, return to_return; } + + /// Routines which finds cadnano skips that correspond to domain ends. Returns -1 if they appear at the start, +1 if they appear at the end, or 0 if there are no end deletions. + static int _cadnano_v2_import_extract_end_deletions(List skip_table, int start, int end){ + if ((skip_table[start] == -1)){ + return -1; + } + if (skip_table[end] == -1){ + return 1; + } else { + return 0; + } + } + /// Routines which converts cadnano skips to scadnano insertions static List _cadnano_v2_import_extract_insertions(List loop_table, int start, int end) { List to_return = [];