diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..b1613bcee
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,7 @@
+version: 2
+updates:
+ - package-ecosystem: "pub"
+ directory: "/" # Directory of pubspec.yaml
+ target-branch: "dev"
+ schedule:
+ interval: "weekly" # daily, weekly, monthly
diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml
index b7636353f..6d4b8fbdd 100644
--- a/.github/workflows/dart.yml
+++ b/.github/workflows/dart.yml
@@ -8,30 +8,25 @@ jobs:
run_unit_tests:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-22.04
-
+ runs-on: ubuntu-latest
steps:
- - name: Setup Dart SDK Step 1
- run: sudo apt-get update
- - name: Setup Dart SDK Step 2
- run: sudo apt-get install apt-transport-https
- - name: Setup Dart SDK Step 3
- run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- - name: Setup Dart SDK Step 4
- run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- - name: Setup Dart SDK Step 5
- run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- - name: Setup Dart SDK Step 6
- run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
- - uses: actions/checkout@v4
+ - name: Checkout branch
+ uses: actions/checkout@v4
+
+ - name: Setup Dart SDK # Using Dart 3.8 to match pubspec.yaml constraint
+ uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
+ with:
+ sdk: 3.8
+
- name: Install dependencies
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
- - name: Run tests
- run: PATH="$PATH:/usr/lib/dart/bin" dart run build_runner test
+ run: dart pub get
+
+ - name: Run Tests
+ run: dart run build_runner test
fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
steps:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
run: exit 1
diff --git a/.github/workflows/dart_formatting.yml b/.github/workflows/dart_formatting.yml
index 7bfe78e28..632424b77 100644
--- a/.github/workflows/dart_formatting.yml
+++ b/.github/workflows/dart_formatting.yml
@@ -8,30 +8,25 @@ jobs:
check_formatting:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-22.04
-
+ runs-on: ubuntu-latest
steps:
- - name: Setup Dart SDK Step 1
- run: sudo apt-get update
- - name: Setup Dart SDK Step 2
- run: sudo apt-get install apt-transport-https
- - name: Setup Dart SDK Step 3
- run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- - name: Setup Dart SDK Step 4
- run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- - name: Setup Dart SDK Step 5
- run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- - name: Setup Dart SDK Step 6
- run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
- - uses: actions/checkout@v4
+ - name: Checkout branch
+ uses: actions/checkout@v4
+
+ - name: Setup Dart SDK # Using Dart 3.8 to match pubspec.yaml constraint
+ uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
+ with:
+ sdk: 3.8
+
- name: Install dependencies
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
+ run: dart pub get
+
- name: Verify formatting
- run: PATH="$PATH:/usr/lib/dart/bin" dart format -l 110 --output=none --set-exit-if-changed .
+ run: dart format -l 110 --output=none --set-exit-if-changed .
fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
steps:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and formatting workflow needs to pass.
run: exit 1
diff --git a/.github/workflows/gh-pages-dev.yml b/.github/workflows/gh-pages-dev.yml
index 054dcbdb4..dee1ac028 100644
--- a/.github/workflows/gh-pages-dev.yml
+++ b/.github/workflows/gh-pages-dev.yml
@@ -7,44 +7,32 @@ on:
jobs:
deploy:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- name: Checkout dev branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: dev
- name: Checkout gh-pages branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages-repo
-
-
- - name: Setup Dart SDK Step 1
- run: sudo apt-get update
- - name: Setup Dart SDK Step 2
- run: sudo apt-get install apt-transport-https
- - name: Setup Dart SDK Step 3
- run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- - name: Setup Dart SDK Step 4
- run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- - name: Setup Dart SDK Step 5
- run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- - name: Setup Dart SDK Step 6
- run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
+ - name: Setup Dart SDK # Using Dart 3.8 to match pubspec.yaml constraint
+ uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
+ with:
+ sdk: 3.8
- name: Install dependencies
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
+ run: dart pub get
- name: Install webdev
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub global activate webdev
-
+ run: dart pub global activate webdev
- name: Build into gh-pages repo
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub global run webdev build -o web:gh-pages-repo/dev
-
+ run: dart pub global run webdev build -o web:gh-pages-repo/dev
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index ef23e3589..620251dbc 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -7,46 +7,39 @@ on:
jobs:
deploy:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
+
steps:
- name: Checkout main branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Checkout gh-pages branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages-repo
+ - name: Setup Dart SDK # Using Dart 3.8 to match pubspec.yaml constraint
+ uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
+ with:
+ sdk: 3.8
-
- - name: Setup Dart SDK Step 1
- run: sudo apt-get update
- - name: Setup Dart SDK Step 2
- run: sudo apt-get install apt-transport-https
- - name: Setup Dart SDK Step 3
- run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- - name: Setup Dart SDK Step 4
- run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- - name: Setup Dart SDK Step 5
- run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- - name: Setup Dart SDK Step 6
- run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
- name: Install dependencies
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
-
- - name: Install webdev
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub global activate webdev
+ run: dart pub get
+ - name: Activate webdev
+ run: dart pub global activate webdev
- name: Build into gh-pages repo
- run: PATH="$PATH:/usr/lib/dart/bin" dart pub global run webdev build -o web:/tmp/scadnano ; cp -r /tmp/scadnano/* gh-pages-repo
+ run: dart pub global run webdev build -o web:/tmp/scadnano ; cp -r /tmp/scadnano/* gh-pages-repo
+
- name: Retrieve version
- run: echo "VERSION=$(cat lib/src/constants.dart | grep 'const String CURRENT_VERSION = .*' | grep -oP '\d+\.\d+\.\d+')" >> $GITHUB_ENV
+ run: echo "VERSION=$(cat lib/src/constants.dart | grep 'const String CURRENT_VERSION = .*' | grep -oP '\d+\.\d+\.\d+')" >> $GITHUB_ENV
+
- name: Build into gh-pages-repo/VERSION
run: |
if [ "$VERSION" != "" ]; then
- PATH="$PATH:/usr/lib/dart/bin" dart pub global run webdev build -o web:gh-pages-repo/v$VERSION
+ dart pub global run webdev build -o web:gh-pages-repo/v$VERSION
else
echo "::warning deploying VERSION skipped because VERSION number could not be found"
fi
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 19b8f3aac..f0dcd7f5c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Release"
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
# ...
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ce9749ab2..48c1379bf 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -241,23 +241,17 @@ git checkout dev
### Installing Dart
-This project requires using Dart version **3.5.4**, not the latest version. Click on a dropdown below for installation instructions for your operating system.
+This project requires using the latest Dart version. Click on a dropdown below for installation instructions for your operating system.
Windows
First, install Chocolatey if you haven't already. If choco help shows a help menu for using Chocolatey, then you've set it up correctly.
-Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart 3.5.4:
+Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart:
-choco install dart-sdk --version 3.5.4
-
-
-To stop Chocolatey from automatically updating Dart to the latest version, pin it:
-
-
-choco pin --name="'dart-sdk'" --version="'3.5.4'"
+choco install dart-sdk
@@ -267,16 +261,10 @@ First, install Homebrew if you haven't already. I
It may help to run `brew tap dart-lang/dart` first.
-Then, install Dart 3.5.4:
-
-
-brew install dart@3.5.4
-
-
-To stop Homebrew from automatically updating Dart to the latest version, pin it:
+Then, install Dart:
-brew pin dart@3.5.4
+brew install dart
If running `dart` in a terminal now does not work, you may need to follow these instructions .
@@ -292,17 +280,11 @@ wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dea
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
-Then, install Dart 3.5.4:
+Then, install Dart:
sudo apt-get update
-sudo apt-get install dart=3.5.4
-
-
-To stop apt from automatically updating Dart to the latest version, hold it:
-
-
-sudo apt-mark hold dart=3.5.4
+sudo apt-get install dart
diff --git a/lib/src/actions/actions.dart b/lib/src/actions/actions.dart
index 67c6fe205..46e6c49f8 100644
--- a/lib/src/actions/actions.dart
+++ b/lib/src/actions/actions.dart
@@ -163,10 +163,12 @@ abstract class BatchAction with UndoableAction implements Built actions, String short_description_value) =>
- BatchAction.from((b) => b
- ..actions.replace(actions)
- ..short_description_value = short_description_value);
+ factory BatchAction(Iterable actions, String short_description_value) => BatchAction.from(
+ (b) =>
+ b
+ ..actions.replace(actions)
+ ..short_description_value = short_description_value,
+ );
factory BatchAction.from([void Function(BatchActionBuilder) updates]) = _$BatchAction;
@@ -204,9 +206,12 @@ abstract class ThrottledActionFast
double get interval_sec;
/************************ begin BuiltValue boilerplate ************************/
- factory ThrottledActionFast(Action action, double interval_sec) => ThrottledActionFast.from((b) => b
- ..action = action
- ..interval_sec = interval_sec);
+ factory ThrottledActionFast(Action action, double interval_sec) => ThrottledActionFast.from(
+ (b) =>
+ b
+ ..action = action
+ ..interval_sec = interval_sec,
+ );
factory ThrottledActionFast.from([void Function(ThrottledActionFastBuilder) updates]) =
_$ThrottledActionFast;
@@ -224,9 +229,12 @@ abstract class ThrottledActionNonFast
double get interval_sec;
/************************ begin BuiltValue boilerplate ************************/
- factory ThrottledActionNonFast(Action action, double interval_sec) => ThrottledActionNonFast.from((b) => b
- ..action = action
- ..interval_sec = interval_sec);
+ factory ThrottledActionNonFast(Action action, double interval_sec) => ThrottledActionNonFast.from(
+ (b) =>
+ b
+ ..action = action
+ ..interval_sec = interval_sec,
+ );
factory ThrottledActionNonFast.from([void Function(ThrottledActionNonFastBuilder) updates]) =
_$ThrottledActionNonFast;
@@ -690,8 +698,9 @@ abstract class SetModificationDisplayConnector
SetModificationDisplayConnector.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
- factory SetModificationDisplayConnector.from(
- [void Function(SetModificationDisplayConnectorBuilder) updates]) = _$SetModificationDisplayConnector;
+ factory SetModificationDisplayConnector.from([
+ void Function(SetModificationDisplayConnectorBuilder) updates,
+ ]) = _$SetModificationDisplayConnector;
SetModificationDisplayConnector._();
@@ -738,12 +747,13 @@ abstract class ShowUnpairedInsertionDeletionsSet
factory ShowUnpairedInsertionDeletionsSet(bool show_unpaired_insertion_deletions) =>
ShowUnpairedInsertionDeletionsSet.from(
- (b) => b..show_unpaired_insertion_deletions = show_unpaired_insertion_deletions);
+ (b) => b..show_unpaired_insertion_deletions = show_unpaired_insertion_deletions,
+ );
/************************ begin BuiltValue boilerplate ************************/
- factory ShowUnpairedInsertionDeletionsSet.from(
- [void Function(ShowUnpairedInsertionDeletionsSetBuilder) updates]) =
- _$ShowUnpairedInsertionDeletionsSet;
+ factory ShowUnpairedInsertionDeletionsSet.from([
+ void Function(ShowUnpairedInsertionDeletionsSetBuilder) updates,
+ ]) = _$ShowUnpairedInsertionDeletionsSet;
ShowUnpairedInsertionDeletionsSet._();
@@ -767,21 +777,22 @@ abstract class OxviewShowSet
}
abstract class SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix
- with
- BuiltJsonSerializable
+ with BuiltJsonSerializable
implements
Action,
- Built {
+ Built<
+ SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix,
+ SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelixBuilder
+ > {
bool get show;
factory SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix(bool show) =>
SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
- factory SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix.from(
- [void Function(SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelixBuilder) updates]) =
- _$SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix;
+ factory SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix.from([
+ void Function(SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelixBuilder) updates,
+ ]) = _$SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix;
SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix._();
@@ -816,9 +827,9 @@ abstract class SetDisplayMajorTickWidthsAllHelices
SetDisplayMajorTickWidthsAllHelices.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
- factory SetDisplayMajorTickWidthsAllHelices.from(
- [void Function(SetDisplayMajorTickWidthsAllHelicesBuilder) updates]) =
- _$SetDisplayMajorTickWidthsAllHelices;
+ factory SetDisplayMajorTickWidthsAllHelices.from([
+ void Function(SetDisplayMajorTickWidthsAllHelicesBuilder) updates,
+ ]) = _$SetDisplayMajorTickWidthsAllHelices;
SetDisplayMajorTickWidthsAllHelices._();
@@ -852,7 +863,8 @@ abstract class SetOnlyDisplaySelectedHelices
factory SetOnlyDisplaySelectedHelices(bool only_display_selected_helices) =>
SetOnlyDisplaySelectedHelices.from(
- (b) => b..only_display_selected_helices = only_display_selected_helices);
+ (b) => b..only_display_selected_helices = only_display_selected_helices,
+ );
/************************ begin BuiltValue boilerplate ************************/
factory SetOnlyDisplaySelectedHelices.from([void Function(SetOnlyDisplaySelectedHelicesBuilder) updates]) =
@@ -947,9 +959,9 @@ abstract class CopySelectedStandsToClipboardImage
with BuiltJsonSerializable
implements Action, Built {
/************************ begin BuiltValue boilerplate ************************/
- factory CopySelectedStandsToClipboardImage(
- [void Function(CopySelectedStandsToClipboardImageBuilder) updates]) =
- _$CopySelectedStandsToClipboardImage;
+ factory CopySelectedStandsToClipboardImage([
+ void Function(CopySelectedStandsToClipboardImageBuilder) updates,
+ ]) = _$CopySelectedStandsToClipboardImage;
CopySelectedStandsToClipboardImage._();
@@ -986,18 +998,22 @@ abstract class LoadDNAFile
String? get filename;
/************************ begin BuiltValue boilerplate ************************/
- factory LoadDNAFile(
- {required String content,
- String? filename,
- bool write_local_storage = true,
- bool unit_testing = false,
- DNAFileType dna_file_type = DNAFileType.scadnano_file}) {
- return LoadDNAFile.from((b) => b
- ..content = content
- ..filename = filename
- ..write_local_storage = write_local_storage
- ..unit_testing = unit_testing
- ..dna_file_type = dna_file_type);
+ factory LoadDNAFile({
+ required String content,
+ String? filename,
+ bool write_local_storage = true,
+ bool unit_testing = false,
+ DNAFileType dna_file_type = DNAFileType.scadnano_file,
+ }) {
+ return LoadDNAFile.from(
+ (b) =>
+ b
+ ..content = content
+ ..filename = filename
+ ..write_local_storage = write_local_storage
+ ..unit_testing = unit_testing
+ ..dna_file_type = dna_file_type,
+ );
}
factory LoadDNAFile.from([void Function(LoadDNAFileBuilder) updates]) = _$LoadDNAFile;
@@ -1029,12 +1045,15 @@ abstract class PrepareToLoadDNAFile
bool unit_testing = false,
DNAFileType dna_file_type = DNAFileType.scadnano_file,
}) {
- return PrepareToLoadDNAFile.from((b) => b
- ..content = content
- ..filename = filename
- ..write_local_storage = write_local_storage
- ..unit_testing = unit_testing
- ..dna_file_type = dna_file_type);
+ return PrepareToLoadDNAFile.from(
+ (b) =>
+ b
+ ..content = content
+ ..filename = filename
+ ..write_local_storage = write_local_storage
+ ..unit_testing = unit_testing
+ ..dna_file_type = dna_file_type,
+ );
}
factory PrepareToLoadDNAFile.from([void Function(PrepareToLoadDNAFileBuilder) updates]) =
@@ -1054,9 +1073,12 @@ abstract class NewDesignSet
/************************ begin BuiltValue boilerplate ************************/
factory NewDesignSet(Design design, String short_description_value) {
- return NewDesignSet.from((b) => b
- ..design.replace(design)
- ..short_description_value = short_description_value);
+ return NewDesignSet.from(
+ (b) =>
+ b
+ ..design.replace(design)
+ ..short_description_value = short_description_value,
+ );
}
factory NewDesignSet.from([void Function(NewDesignSetBuilder) updates]) = _$NewDesignSet;
@@ -1178,11 +1200,14 @@ abstract class HelixRollSetAtOther
/************************ begin BuiltValue boilerplate ************************/
factory HelixRollSetAtOther(int helix_idx, int helix_other_idx, bool forward, int anchor) =>
- HelixRollSetAtOther.from((b) => b
- ..helix_idx = helix_idx
- ..helix_other_idx = helix_other_idx
- ..forward = forward
- ..anchor = anchor);
+ HelixRollSetAtOther.from(
+ (b) =>
+ b
+ ..helix_idx = helix_idx
+ ..helix_other_idx = helix_other_idx
+ ..forward = forward
+ ..anchor = anchor,
+ );
factory HelixRollSetAtOther.from([void Function(HelixRollSetAtOtherBuilder) updates]) =
_$HelixRollSetAtOther;
@@ -1250,11 +1275,13 @@ abstract class SelectionBoxCreate
bool get is_main;
/************************ begin BuiltValue boilerplate ************************/
- factory SelectionBoxCreate(Point point, bool toggle, bool is_main) =>
- SelectionBoxCreate.from((b) => b
- ..point = point
- ..toggle = toggle
- ..is_main = is_main);
+ factory SelectionBoxCreate(Point point, bool toggle, bool is_main) => SelectionBoxCreate.from(
+ (b) =>
+ b
+ ..point = point
+ ..toggle = toggle
+ ..is_main = is_main,
+ );
factory SelectionBoxCreate.from([void Function(SelectionBoxCreateBuilder) updates]) = _$SelectionBoxCreate;
@@ -1271,9 +1298,12 @@ abstract class SelectionBoxSizeChange
bool get is_main;
/************************ begin BuiltValue boilerplate ************************/
- factory SelectionBoxSizeChange(Point point, bool is_main) => SelectionBoxSizeChange.from((b) => b
- ..point = point
- ..is_main = is_main);
+ factory SelectionBoxSizeChange(Point point, bool is_main) => SelectionBoxSizeChange.from(
+ (b) =>
+ b
+ ..point = point
+ ..is_main = is_main,
+ );
factory SelectionBoxSizeChange.from([void Function(SelectionBoxSizeChangeBuilder) updates]) =
_$SelectionBoxSizeChange;
@@ -1501,10 +1531,13 @@ abstract class Select with BuiltJsonSerializable implements Action, Built Select.from((b) => b
- ..selectable = selectable
- ..toggle = toggle
- ..only = only);
+ factory Select(Selectable selectable, {required bool toggle, bool only = false}) => Select.from(
+ (b) =>
+ b
+ ..selectable = selectable
+ ..toggle = toggle
+ ..only = only,
+ );
factory Select.from([void Function(SelectBuilder) updates]) = _$Select;
@@ -1611,10 +1644,11 @@ abstract class SelectAllStrandsWithSameAsSelected
bool get exclude_scaffolds;
/************************ begin BuiltValue boilerplate ************************/
- factory SelectAllStrandsWithSameAsSelected(
- {required BuiltList template_strands,
- required BuiltList traits,
- required bool exclude_scaffolds}) = _$SelectAllStrandsWithSameAsSelected._;
+ factory SelectAllStrandsWithSameAsSelected({
+ required BuiltList template_strands,
+ required BuiltList traits,
+ required bool exclude_scaffolds,
+ }) = _$SelectAllStrandsWithSameAsSelected._;
SelectAllStrandsWithSameAsSelected._();
@@ -1722,9 +1756,12 @@ abstract class HelixSelect
bool get toggle;
/************************ begin BuiltValue boilerplate ************************/
- factory HelixSelect(int helix_idx, bool toggle) => HelixSelect.from((b) => b
- ..helix_idx = helix_idx
- ..toggle = toggle);
+ factory HelixSelect(int helix_idx, bool toggle) => HelixSelect.from(
+ (b) =>
+ b
+ ..helix_idx = helix_idx
+ ..toggle = toggle,
+ );
factory HelixSelect.from([void Function(HelixSelectBuilder) updates]) = _$HelixSelect;
@@ -1761,10 +1798,12 @@ abstract class HelixSelectionsAdjust
SelectionBox get selection_box;
/************************ begin BuiltValue boilerplate ************************/
- factory HelixSelectionsAdjust(bool toggle, SelectionBox selection_box) =>
- HelixSelectionsAdjust.from((b) => b
- ..toggle = toggle
- ..selection_box.replace(selection_box));
+ factory HelixSelectionsAdjust(bool toggle, SelectionBox selection_box) => HelixSelectionsAdjust.from(
+ (b) =>
+ b
+ ..toggle = toggle
+ ..selection_box.replace(selection_box),
+ );
factory HelixSelectionsAdjust.from([void Function(HelixSelectionsAdjustBuilder) updates]) =
_$HelixSelectionsAdjust;
@@ -1901,9 +1940,10 @@ abstract class HelixMajorTickPeriodicDistancesChange
BuiltList get major_tick_periodic_distances;
/************************ begin BuiltValue boilerplate ************************/
- factory HelixMajorTickPeriodicDistancesChange(
- {required int helix_idx,
- required BuiltList major_tick_periodic_distances}) = _$HelixMajorTickPeriodicDistancesChange._;
+ factory HelixMajorTickPeriodicDistancesChange({
+ required int helix_idx,
+ required BuiltList major_tick_periodic_distances,
+ }) = _$HelixMajorTickPeriodicDistancesChange._;
HelixMajorTickPeriodicDistancesChange._();
@@ -2148,16 +2188,19 @@ abstract class ExportDNA with BuiltJsonSerializable implements Action, Built b
- ..include_scaffold = include_scaffold
- ..include_only_selected_strands = include_only_selected_strands
- ..exclude_selected_strands = exclude_selected_strands
- ..export_dna_format = export_dna_format
- ..delimiter = delimiter
- ..domain_delimiter = domain_delimiter
- ..strand_order = strand_order
- ..column_major_strand = column_major_strand
- ..column_major_plate = column_major_plate);
+ return ExportDNA.from(
+ (b) =>
+ b
+ ..include_scaffold = include_scaffold
+ ..include_only_selected_strands = include_only_selected_strands
+ ..exclude_selected_strands = exclude_selected_strands
+ ..export_dna_format = export_dna_format
+ ..delimiter = delimiter
+ ..domain_delimiter = domain_delimiter
+ ..strand_order = strand_order
+ ..column_major_strand = column_major_strand
+ ..column_major_plate = column_major_plate,
+ );
}
factory ExportDNA.from([void Function(ExportDNABuilder) updates]) = _$ExportDNA;
@@ -2247,15 +2290,21 @@ abstract class ExtensionDisplayLengthAngleSet
StrandPart get strand_part => ext;
/************************ begin BuiltValue boilerplate ************************/
- factory ExtensionDisplayLengthAngleSet(
- {required Extension ext, required double display_length, required double display_angle}) =>
- ExtensionDisplayLengthAngleSet.from((b) => b
- ..ext.replace(ext)
- ..display_length = display_length
- ..display_angle = display_angle);
+ factory ExtensionDisplayLengthAngleSet({
+ required Extension ext,
+ required double display_length,
+ required double display_angle,
+ }) => ExtensionDisplayLengthAngleSet.from(
+ (b) =>
+ b
+ ..ext.replace(ext)
+ ..display_length = display_length
+ ..display_angle = display_angle,
+ );
- factory ExtensionDisplayLengthAngleSet.from(
- [void Function(ExtensionDisplayLengthAngleSetBuilder) updates]) = _$ExtensionDisplayLengthAngleSet;
+ factory ExtensionDisplayLengthAngleSet.from([
+ void Function(ExtensionDisplayLengthAngleSetBuilder) updates,
+ ]) = _$ExtensionDisplayLengthAngleSet;
ExtensionDisplayLengthAngleSet._();
@@ -2280,10 +2329,13 @@ abstract class ExtensionAdd
/************************ begin BuiltValue boilerplate ************************/
factory ExtensionAdd({required Strand strand, required bool is_5p, required int num_bases}) =>
- ExtensionAdd.from((b) => b
- ..strand.replace(strand)
- ..is_5p = is_5p
- ..num_bases = num_bases);
+ ExtensionAdd.from(
+ (b) =>
+ b
+ ..strand.replace(strand)
+ ..is_5p = is_5p
+ ..num_bases = num_bases,
+ );
factory ExtensionAdd.from([void Function(ExtensionAddBuilder) updates]) = _$ExtensionAdd;
@@ -2308,9 +2360,12 @@ abstract class ExtensionNumBasesChange
StrandPart get strand_part => ext;
/************************ begin BuiltValue boilerplate ************************/
- factory ExtensionNumBasesChange(Extension ext, int num_bases) => ExtensionNumBasesChange.from((b) => b
- ..ext.replace(ext)
- ..num_bases = num_bases);
+ factory ExtensionNumBasesChange(Extension ext, int num_bases) => ExtensionNumBasesChange.from(
+ (b) =>
+ b
+ ..ext.replace(ext)
+ ..num_bases = num_bases,
+ );
factory ExtensionNumBasesChange.from([void Function(ExtensionNumBasesChangeBuilder) updates]) =
_$ExtensionNumBasesChange;
@@ -2332,9 +2387,12 @@ abstract class ExtensionsNumBasesChange
/************************ begin BuiltValue boilerplate ************************/
factory ExtensionsNumBasesChange(Iterable extensions, int num_bases) =>
- ExtensionsNumBasesChange.from((b) => b
- ..extensions.replace(extensions)
- ..num_bases = num_bases);
+ ExtensionsNumBasesChange.from(
+ (b) =>
+ b
+ ..extensions.replace(extensions)
+ ..num_bases = num_bases,
+ );
factory ExtensionsNumBasesChange.from([void Function(ExtensionsNumBasesChangeBuilder) updates]) =
_$ExtensionsNumBasesChange;
@@ -2357,9 +2415,12 @@ abstract class LoopoutLengthChange
StrandPart get strand_part => loopout;
/************************ begin BuiltValue boilerplate ************************/
- factory LoopoutLengthChange(Loopout loopout, int num_bases) => LoopoutLengthChange.from((b) => b
- ..loopout.replace(loopout)
- ..num_bases = num_bases);
+ factory LoopoutLengthChange(Loopout loopout, int num_bases) => LoopoutLengthChange.from(
+ (b) =>
+ b
+ ..loopout.replace(loopout)
+ ..num_bases = num_bases,
+ );
factory LoopoutLengthChange.from([void Function(LoopoutLengthChangeBuilder) updates]) =
_$LoopoutLengthChange;
@@ -2380,9 +2441,12 @@ abstract class LoopoutsLengthChange
int get length;
/************************ begin BuiltValue boilerplate ************************/
- factory LoopoutsLengthChange(Iterable loopouts, int length) => LoopoutsLengthChange.from((b) => b
- ..loopouts.replace(loopouts)
- ..length = length);
+ factory LoopoutsLengthChange(Iterable loopouts, int length) => LoopoutsLengthChange.from(
+ (b) =>
+ b
+ ..loopouts.replace(loopouts)
+ ..length = length,
+ );
factory LoopoutsLengthChange.from([void Function(LoopoutsLengthChangeBuilder) updates]) =
_$LoopoutsLengthChange;
@@ -2408,10 +2472,13 @@ abstract class ConvertCrossoverToLoopout
/************************ begin BuiltValue boilerplate ************************/
factory ConvertCrossoverToLoopout(Crossover crossover, int length, [String? dna_sequence = null]) =>
- ConvertCrossoverToLoopout.from((b) => b
- ..crossover.replace(crossover)
- ..length = length
- ..dna_sequence = dna_sequence);
+ ConvertCrossoverToLoopout.from(
+ (b) =>
+ b
+ ..crossover.replace(crossover)
+ ..length = length
+ ..dna_sequence = dna_sequence,
+ );
factory ConvertCrossoverToLoopout.from([void Function(ConvertCrossoverToLoopoutBuilder) updates]) =
_$ConvertCrossoverToLoopout;
@@ -2433,9 +2500,12 @@ abstract class ConvertCrossoversToLoopouts
/************************ begin BuiltValue boilerplate ************************/
factory ConvertCrossoversToLoopouts(Iterable crossovers, int length) =>
- ConvertCrossoversToLoopouts.from((b) => b
- ..crossovers.replace(crossovers)
- ..length = length);
+ ConvertCrossoversToLoopouts.from(
+ (b) =>
+ b
+ ..crossovers.replace(crossovers)
+ ..length = length,
+ );
factory ConvertCrossoversToLoopouts.from([void Function(ConvertCrossoversToLoopoutsBuilder) updates]) =
_$ConvertCrossoversToLoopouts;
@@ -2489,9 +2559,10 @@ abstract class JoinStrandsByCrossover
DNAEnd get dna_end_second_click;
/************************ begin BuiltValue boilerplate ************************/
- factory JoinStrandsByCrossover(
- {required DNAEnd dna_end_first_click,
- required DNAEnd dna_end_second_click}) = _$JoinStrandsByCrossover._;
+ factory JoinStrandsByCrossover({
+ required DNAEnd dna_end_first_click,
+ required DNAEnd dna_end_second_click,
+ }) = _$JoinStrandsByCrossover._;
JoinStrandsByCrossover._();
@@ -2517,9 +2588,10 @@ abstract class MoveLinker
@memoized
int get hashCode;
- factory MoveLinker(
- {required PotentialCrossover potential_crossover,
- required DNAEnd dna_end_second_click}) = _$MoveLinker._;
+ factory MoveLinker({
+ required PotentialCrossover potential_crossover,
+ required DNAEnd dna_end_second_click,
+ }) = _$MoveLinker._;
factory MoveLinker.from([void Function(MoveLinkerBuilder) updates]) = _$MoveLinker;
@@ -2575,10 +2647,11 @@ abstract class StrandsReflect
bool get reverse_polarity;
/************************ begin BuiltValue boilerplate ************************/
- factory StrandsReflect(
- {required BuiltList strands,
- required bool horizontal,
- required bool reverse_polarity}) = _$StrandsReflect._;
+ factory StrandsReflect({
+ required BuiltList strands,
+ required bool horizontal,
+ required bool reverse_polarity,
+ }) = _$StrandsReflect._;
StrandsReflect._();
@@ -2658,12 +2731,13 @@ abstract class StrandCreateCommit
Color get color;
/************************ begin BuiltValue boilerplate ************************/
- factory StrandCreateCommit(
- {required int helix_idx,
- required bool forward,
- required int start,
- required int end,
- required Color color}) = _$StrandCreateCommit._;
+ factory StrandCreateCommit({
+ required int helix_idx,
+ required bool forward,
+ required int start,
+ required int end,
+ required Color color,
+ }) = _$StrandCreateCommit._;
StrandCreateCommit._();
@@ -2730,9 +2804,12 @@ abstract class ManualPasteInitiate
/************************ begin BuiltValue boilerplate ************************/
factory ManualPasteInitiate({required String clipboard_content, bool in_browser = true}) =>
- ManualPasteInitiate.from((b) => b
- ..clipboard_content = clipboard_content
- ..in_browser = in_browser);
+ ManualPasteInitiate.from(
+ (b) =>
+ b
+ ..clipboard_content = clipboard_content
+ ..in_browser = in_browser,
+ );
ManualPasteInitiate._();
@@ -2754,9 +2831,12 @@ abstract class AutoPasteInitiate
/************************ begin BuiltValue boilerplate ************************/
factory AutoPasteInitiate({required String clipboard_content, bool in_browser = true}) =>
- AutoPasteInitiate.from((b) => b
- ..clipboard_content = clipboard_content
- ..in_browser = in_browser);
+ AutoPasteInitiate.from(
+ (b) =>
+ b
+ ..clipboard_content = clipboard_content
+ ..in_browser = in_browser,
+ );
AutoPasteInitiate._();
@@ -2795,11 +2875,12 @@ abstract class StrandsMoveStart
BuiltMap get original_helices_view_order_inverse;
/************************ begin BuiltValue boilerplate ************************/
- factory StrandsMoveStart(
- {required BuiltList strands,
- required Address address,
- required bool copy,
- required BuiltMap original_helices_view_order_inverse}) = _$StrandsMoveStart._;
+ factory StrandsMoveStart({
+ required BuiltList strands,
+ required Address address,
+ required bool copy,
+ required BuiltMap original_helices_view_order_inverse,
+ }) = _$StrandsMoveStart._;
StrandsMoveStart._();
@@ -2816,10 +2897,11 @@ abstract class StrandsMoveStartSelectedStrands
BuiltMap get original_helices_view_order_inverse;
/************************ begin BuiltValue boilerplate ************************/
- factory StrandsMoveStartSelectedStrands(
- {required Address address,
- required bool copy,
- required BuiltMap original_helices_view_order_inverse}) = _$StrandsMoveStartSelectedStrands._;
+ factory StrandsMoveStartSelectedStrands({
+ required Address address,
+ required bool copy,
+ required BuiltMap original_helices_view_order_inverse,
+ }) = _$StrandsMoveStartSelectedStrands._;
StrandsMoveStartSelectedStrands._();
@@ -2882,9 +2964,10 @@ abstract class DomainsMoveStartSelectedDomains
BuiltMap get original_helices_view_order_inverse;
/************************ begin BuiltValue boilerplate ************************/
- factory DomainsMoveStartSelectedDomains(
- {required Address address,
- required BuiltMap original_helices_view_order_inverse}) = _$DomainsMoveStartSelectedDomains._;
+ factory DomainsMoveStartSelectedDomains({
+ required Address address,
+ required BuiltMap original_helices_view_order_inverse,
+ }) = _$DomainsMoveStartSelectedDomains._;
DomainsMoveStartSelectedDomains._();
@@ -3061,11 +3144,12 @@ abstract class DNAExtensionsMoveSetSelectedExtensionEnds
Helix get helix;
/************************ begin BuiltValue boilerplate ************************/
- factory DNAExtensionsMoveSetSelectedExtensionEnds(
- {required BuiltList moves,
- required Point original_point,
- required BuiltSet strands_affected,
- required Helix helix}) = _$DNAExtensionsMoveSetSelectedExtensionEnds._;
+ factory DNAExtensionsMoveSetSelectedExtensionEnds({
+ required BuiltList moves,
+ required Point original_point,
+ required BuiltSet strands_affected,
+ required Helix helix,
+ }) = _$DNAExtensionsMoveSetSelectedExtensionEnds._;
DNAExtensionsMoveSetSelectedExtensionEnds._();
@@ -3235,9 +3319,9 @@ abstract class AssignDNAComplementFromBoundStrands
return AssignDNAComplementFromBoundStrands.from((b) => b..strands.replace(strands));
}
- factory AssignDNAComplementFromBoundStrands.from(
- [void Function(AssignDNAComplementFromBoundStrandsBuilder) updates]) =
- _$AssignDNAComplementFromBoundStrands;
+ factory AssignDNAComplementFromBoundStrands.from([
+ void Function(AssignDNAComplementFromBoundStrandsBuilder) updates,
+ ]) = _$AssignDNAComplementFromBoundStrands;
AssignDNAComplementFromBoundStrands._();
@@ -3263,8 +3347,8 @@ abstract class AssignDomainNameComplementFromBoundStrands
}
factory AssignDomainNameComplementFromBoundStrands.from(
- void Function(AssignDomainNameComplementFromBoundStrandsBuilder) updates) =
- _$AssignDomainNameComplementFromBoundStrands;
+ void Function(AssignDomainNameComplementFromBoundStrandsBuilder) updates,
+ ) = _$AssignDomainNameComplementFromBoundStrands;
AssignDomainNameComplementFromBoundStrands._();
@@ -3289,9 +3373,9 @@ abstract class AssignDomainNameComplementFromBoundDomains
return AssignDomainNameComplementFromBoundDomains.from((b) => b..domains.replace(domains));
}
- factory AssignDomainNameComplementFromBoundDomains.from(
- [void Function(AssignDomainNameComplementFromBoundDomainsBuilder) updates]) =
- _$AssignDomainNameComplementFromBoundDomains;
+ factory AssignDomainNameComplementFromBoundDomains.from([
+ void Function(AssignDomainNameComplementFromBoundDomainsBuilder) updates,
+ ]) = _$AssignDomainNameComplementFromBoundDomains;
AssignDomainNameComplementFromBoundDomains._();
@@ -3382,18 +3466,21 @@ abstract class InsertionLengthChange
StrandPart get strand_part => domain;
InsertionLengthChange clone_for_other_domain(Domain other_domain) => InsertionLengthChange(
- domain: other_domain,
- insertion: other_domain.insertions.firstWhere((i) => i.offset == offset),
- length: length,
- );
+ domain: other_domain,
+ insertion: other_domain.insertions.firstWhere((i) => i.offset == offset),
+ length: length,
+ );
/************************ begin BuiltValue boilerplate ************************/
factory InsertionLengthChange({required Domain domain, required Insertion insertion, required int length}) {
- return InsertionLengthChange.from((b) => b
- ..domain.replace(domain)
- ..insertion.replace(insertion)
- ..length = length
- ..all_helices = false);
+ return InsertionLengthChange.from(
+ (b) =>
+ b
+ ..domain.replace(domain)
+ ..insertion.replace(insertion)
+ ..length = length
+ ..all_helices = false,
+ );
}
factory InsertionLengthChange.from([void Function(InsertionLengthChangeBuilder) updates]) =
@@ -3421,13 +3508,19 @@ abstract class InsertionsLengthChange
bool get all_helices;
/************************ begin BuiltValue boilerplate ************************/
- factory InsertionsLengthChange(
- {required Iterable insertions, required Iterable domains, required int length}) {
- return InsertionsLengthChange.from((b) => b
- ..insertions.replace(insertions)
- ..domains.replace(domains)
- ..length = length
- ..all_helices = false);
+ factory InsertionsLengthChange({
+ required Iterable insertions,
+ required Iterable domains,
+ required int length,
+ }) {
+ return InsertionsLengthChange.from(
+ (b) =>
+ b
+ ..insertions.replace(insertions)
+ ..domains.replace(domains)
+ ..length = length
+ ..all_helices = false,
+ );
}
factory InsertionsLengthChange.from([void Function(InsertionsLengthChangeBuilder) updates]) =
@@ -3480,16 +3573,19 @@ abstract class InsertionRemove
StrandPart get strand_part => domain;
InsertionRemove clone_for_other_domain(Domain other_domain) => InsertionRemove(
- domain: other_domain,
- insertion: other_domain.insertions.firstWhere((i) => i.offset == offset),
- );
+ domain: other_domain,
+ insertion: other_domain.insertions.firstWhere((i) => i.offset == offset),
+ );
/************************ begin BuiltValue boilerplate ************************/
factory InsertionRemove({required Domain domain, required Insertion insertion}) {
- return InsertionRemove.from((b) => b
- ..domain.replace(domain)
- ..insertion.replace(insertion)
- ..all_helices = false);
+ return InsertionRemove.from(
+ (b) =>
+ b
+ ..domain.replace(domain)
+ ..insertion.replace(insertion)
+ ..all_helices = false,
+ );
}
factory InsertionRemove.from([void Function(InsertionRemoveBuilder) updates]) = _$InsertionRemove;
@@ -3518,10 +3614,13 @@ abstract class DeletionRemove
/************************ begin BuiltValue boilerplate ************************/
factory DeletionRemove({required Domain domain, required int offset}) {
- return DeletionRemove.from((b) => b
- ..domain.replace(domain)
- ..offset = offset
- ..all_helices = false);
+ return DeletionRemove.from(
+ (b) =>
+ b
+ ..domain.replace(domain)
+ ..offset = offset
+ ..all_helices = false,
+ );
}
factory DeletionRemove.from([void Function(DeletionRemoveBuilder) updates]) = _$DeletionRemove;
@@ -3652,10 +3751,11 @@ abstract class ModificationRemove
int? get strand_dna_idx;
/************************ begin BuiltValue boilerplate ************************/
- factory ModificationRemove(
- {required Strand strand,
- required Modification modification,
- int? strand_dna_idx}) = _$ModificationRemove._;
+ factory ModificationRemove({
+ required Strand strand,
+ required Modification modification,
+ int? strand_dna_idx,
+ }) = _$ModificationRemove._;
ModificationRemove._();
@@ -3678,13 +3778,15 @@ abstract class ModificationConnectorLengthSet
@memoized
int get hashCode;
- factory ModificationConnectorLengthSet(
- {required Strand strand,
- required Modification modification,
- required int connector_length}) = _$ModificationConnectorLengthSet._;
+ factory ModificationConnectorLengthSet({
+ required Strand strand,
+ required Modification modification,
+ required int connector_length,
+ }) = _$ModificationConnectorLengthSet._;
- factory ModificationConnectorLengthSet.from(
- [void Function(ModificationConnectorLengthSetBuilder) updates]) = _$ModificationConnectorLengthSet;
+ factory ModificationConnectorLengthSet.from([
+ void Function(ModificationConnectorLengthSetBuilder) updates,
+ ]) = _$ModificationConnectorLengthSet;
ModificationConnectorLengthSet._();
@@ -3705,10 +3807,11 @@ abstract class ModificationEdit
int? get strand_dna_idx;
/************************ begin BuiltValue boilerplate ************************/
- factory ModificationEdit(
- {required Strand strand,
- required Modification modification,
- int? strand_dna_idx}) = _$ModificationEdit._;
+ factory ModificationEdit({
+ required Strand strand,
+ required Modification modification,
+ int? strand_dna_idx,
+ }) = _$ModificationEdit._;
ModificationEdit._();
@@ -3726,12 +3829,16 @@ abstract class Modifications5PrimeEdit
Modification5Prime get new_modification;
/************************ begin BuiltValue boilerplate ************************/
- factory Modifications5PrimeEdit(
- {required Iterable modifications,
- required Modification5Prime new_modification}) {
- return Modifications5PrimeEdit.from((b) => b
- ..modifications.replace(modifications)
- ..new_modification.replace(new_modification));
+ factory Modifications5PrimeEdit({
+ required Iterable modifications,
+ required Modification5Prime new_modification,
+ }) {
+ return Modifications5PrimeEdit.from(
+ (b) =>
+ b
+ ..modifications.replace(modifications)
+ ..new_modification.replace(new_modification),
+ );
}
factory Modifications5PrimeEdit.from([void Function(Modifications5PrimeEditBuilder) updates]) =
@@ -3753,12 +3860,16 @@ abstract class Modifications3PrimeEdit
Modification3Prime get new_modification;
/************************ begin BuiltValue boilerplate ************************/
- factory Modifications3PrimeEdit(
- {required Iterable modifications,
- required Modification3Prime new_modification}) {
- return Modifications3PrimeEdit.from((b) => b
- ..modifications.replace(modifications)
- ..new_modification.replace(new_modification));
+ factory Modifications3PrimeEdit({
+ required Iterable modifications,
+ required Modification3Prime new_modification,
+ }) {
+ return Modifications3PrimeEdit.from(
+ (b) =>
+ b
+ ..modifications.replace(modifications)
+ ..new_modification.replace(new_modification),
+ );
}
factory Modifications3PrimeEdit.from([void Function(Modifications3PrimeEditBuilder) updates]) =
@@ -3780,12 +3891,16 @@ abstract class ModificationsInternalEdit
ModificationInternal get new_modification;
/************************ begin BuiltValue boilerplate ************************/
- factory ModificationsInternalEdit(
- {required Iterable modifications,
- required ModificationInternal new_modification}) {
- return ModificationsInternalEdit.from((b) => b
- ..modifications.replace(modifications)
- ..new_modification.replace(new_modification));
+ factory ModificationsInternalEdit({
+ required Iterable modifications,
+ required ModificationInternal new_modification,
+ }) {
+ return ModificationsInternalEdit.from(
+ (b) =>
+ b
+ ..modifications.replace(modifications)
+ ..new_modification.replace(new_modification),
+ );
}
factory ModificationsInternalEdit.from([void Function(ModificationsInternalEditBuilder) updates]) =
@@ -3993,8 +4108,9 @@ abstract class StrandOrSubstrandColorPickerHide
/************************ begin BuiltValue boilerplate ************************/
factory StrandOrSubstrandColorPickerHide() => StrandOrSubstrandColorPickerHide.from((b) => b);
- factory StrandOrSubstrandColorPickerHide.from(
- [void Function(StrandOrSubstrandColorPickerHideBuilder) updates]) = _$StrandOrSubstrandColorPickerHide;
+ factory StrandOrSubstrandColorPickerHide.from([
+ void Function(StrandOrSubstrandColorPickerHideBuilder) updates,
+ ]) = _$StrandOrSubstrandColorPickerHide;
StrandOrSubstrandColorPickerHide._();
@@ -4178,12 +4294,13 @@ abstract class InlineInsertionsDeletions
// which crossovers to default to when setting helix positions/rolls based on crossover
abstract class DefaultCrossoverTypeForSettingHelixRollsSet
- with
- BuiltJsonSerializable
+ with BuiltJsonSerializable
implements
Action,
- Built {
+ Built<
+ DefaultCrossoverTypeForSettingHelixRollsSet,
+ DefaultCrossoverTypeForSettingHelixRollsSetBuilder
+ > {
bool get scaffold;
bool get staple;
@@ -4241,8 +4358,9 @@ abstract class ShowHelixComponentsMainViewSet
factory ShowHelixComponentsMainViewSet({required bool show_helix_components}) =
_$ShowHelixComponentsMainViewSet._;
- factory ShowHelixComponentsMainViewSet.from(
- [void Function(ShowHelixComponentsMainViewSetBuilder) updates]) = _$ShowHelixComponentsMainViewSet;
+ factory ShowHelixComponentsMainViewSet.from([
+ void Function(ShowHelixComponentsMainViewSetBuilder) updates,
+ ]) = _$ShowHelixComponentsMainViewSet;
ShowHelixComponentsMainViewSet._();
@@ -4329,11 +4447,16 @@ abstract class LoadDnaSequenceImageUri
/************************ begin BuiltValue boilerplate ************************/
factory LoadDnaSequenceImageUri(
- String? uri, double dna_sequence_png_horizontal_offset, double dna_sequence_png_vertical_offset) =>
- LoadDnaSequenceImageUri.from((b) => b
- ..uri = uri
- ..dna_sequence_png_horizontal_offset = dna_sequence_png_horizontal_offset
- ..dna_sequence_png_vertical_offset = dna_sequence_png_vertical_offset);
+ String? uri,
+ double dna_sequence_png_horizontal_offset,
+ double dna_sequence_png_vertical_offset,
+ ) => LoadDnaSequenceImageUri.from(
+ (b) =>
+ b
+ ..uri = uri
+ ..dna_sequence_png_horizontal_offset = dna_sequence_png_horizontal_offset
+ ..dna_sequence_png_vertical_offset = dna_sequence_png_vertical_offset,
+ );
factory LoadDnaSequenceImageUri.from(void Function(LoadDnaSequenceImageUriBuilder) updates) =
_$LoadDnaSequenceImageUri;
@@ -4369,12 +4492,14 @@ abstract class SetExportSvgActionDelayedForPngCache
/************************ begin BuiltValue boilerplate ************************/
factory SetExportSvgActionDelayedForPngCache(ExportSvg? export_svg_action_delayed_for_png_cache) =>
- SetExportSvgActionDelayedForPngCache.from((b) =>
- b..export_svg_action_delayed_for_png_cache = export_svg_action_delayed_for_png_cache?.toBuilder());
+ SetExportSvgActionDelayedForPngCache.from(
+ (b) =>
+ b..export_svg_action_delayed_for_png_cache = export_svg_action_delayed_for_png_cache?.toBuilder(),
+ );
- factory SetExportSvgActionDelayedForPngCache.from(
- [void Function(SetExportSvgActionDelayedForPngCacheBuilder) updates]) =
- _$SetExportSvgActionDelayedForPngCache;
+ factory SetExportSvgActionDelayedForPngCache.from([
+ void Function(SetExportSvgActionDelayedForPngCacheBuilder) updates,
+ ]) = _$SetExportSvgActionDelayedForPngCache;
SetExportSvgActionDelayedForPngCache._();
@@ -4399,18 +4524,19 @@ abstract class ShowBasePairLinesSet
}
abstract class ExportBasePairLinesIfOtherStrandNotSelectedSet
- with
- BuiltJsonSerializable
+ with BuiltJsonSerializable
implements
Action,
- Built {
+ Built<
+ ExportBasePairLinesIfOtherStrandNotSelectedSet,
+ ExportBasePairLinesIfOtherStrandNotSelectedSetBuilder
+ > {
bool get export_base_pair_lines_if_other_strand_not_selected;
/************************ begin BuiltValue boilerplate ************************/
- factory ExportBasePairLinesIfOtherStrandNotSelectedSet(
- {required bool export_base_pair_lines_if_other_strand_not_selected}) =
- _$ExportBasePairLinesIfOtherStrandNotSelectedSet._;
+ factory ExportBasePairLinesIfOtherStrandNotSelectedSet({
+ required bool export_base_pair_lines_if_other_strand_not_selected,
+ }) = _$ExportBasePairLinesIfOtherStrandNotSelectedSet._;
ExportBasePairLinesIfOtherStrandNotSelectedSet._();
@@ -4480,10 +4606,12 @@ abstract class DisablePngCachingDnaSequencesSet
/************************ begin BuiltValue boilerplate ************************/
factory DisablePngCachingDnaSequencesSet(bool disable_png_caching_dna_sequences) =>
DisablePngCachingDnaSequencesSet.from(
- (b) => b..disable_png_caching_dna_sequences = disable_png_caching_dna_sequences);
+ (b) => b..disable_png_caching_dna_sequences = disable_png_caching_dna_sequences,
+ );
- factory DisablePngCachingDnaSequencesSet.from(
- [void Function(DisablePngCachingDnaSequencesSetBuilder) updates]) = _$DisablePngCachingDnaSequencesSet;
+ factory DisablePngCachingDnaSequencesSet.from([
+ void Function(DisablePngCachingDnaSequencesSetBuilder) updates,
+ ]) = _$DisablePngCachingDnaSequencesSet;
DisablePngCachingDnaSequencesSet._();
@@ -4499,10 +4627,12 @@ abstract class RetainStrandColorOnSelectionSet
/************************ begin BuiltValue boilerplate ************************/
factory RetainStrandColorOnSelectionSet(bool retain_strand_color_on_selection) =>
RetainStrandColorOnSelectionSet.from(
- (b) => b..retain_strand_color_on_selection = retain_strand_color_on_selection);
+ (b) => b..retain_strand_color_on_selection = retain_strand_color_on_selection,
+ );
- factory RetainStrandColorOnSelectionSet.from(
- [void Function(RetainStrandColorOnSelectionSetBuilder) updates]) = _$RetainStrandColorOnSelectionSet;
+ factory RetainStrandColorOnSelectionSet.from([
+ void Function(RetainStrandColorOnSelectionSetBuilder) updates,
+ ]) = _$RetainStrandColorOnSelectionSet;
RetainStrandColorOnSelectionSet._();
@@ -4518,10 +4648,12 @@ abstract class DisplayReverseDNARightSideUpSet
/************************ begin BuiltValue boilerplate ************************/
factory DisplayReverseDNARightSideUpSet(bool display_reverse_DNA_right_side_up) =>
DisplayReverseDNARightSideUpSet.from(
- (b) => b..display_reverse_DNA_right_side_up = display_reverse_DNA_right_side_up);
+ (b) => b..display_reverse_DNA_right_side_up = display_reverse_DNA_right_side_up,
+ );
- factory DisplayReverseDNARightSideUpSet.from(
- [void Function(DisplayReverseDNARightSideUpSetBuilder) updates]) = _$DisplayReverseDNARightSideUpSet;
+ factory DisplayReverseDNARightSideUpSet.from([
+ void Function(DisplayReverseDNARightSideUpSetBuilder) updates,
+ ]) = _$DisplayReverseDNARightSideUpSet;
DisplayReverseDNARightSideUpSet._();
@@ -4571,16 +4703,19 @@ abstract class Autobreak with BuiltJsonSerializable implements Action, Built
- Autobreak.from((b) => b
- ..target_length = target_length
- ..min_length = min_length
- ..max_length = max_length
- ..min_distance_to_xover = min_distance_to_xover);
+ factory Autobreak({
+ required int target_length,
+ required int min_length,
+ required int max_length,
+ required int min_distance_to_xover,
+ }) => Autobreak.from(
+ (b) =>
+ b
+ ..target_length = target_length
+ ..min_length = min_length
+ ..max_length = max_length
+ ..min_distance_to_xover = min_distance_to_xover,
+ );
factory Autobreak.from([void Function(AutobreakBuilder) updates]) = _$Autobreak;
diff --git a/lib/src/app.dart b/lib/src/app.dart
index e3349d476..7a54fd080 100644
--- a/lib/src/app.dart
+++ b/lib/src/app.dart
@@ -132,23 +132,41 @@ class App {
// for null-safety we need to make up default values here, but the reducer code
// assumes that the first time the reducer is called it could be null, meaning
// it won't matter what non-null state we assign to initialState
- store_selection_rope = Store(optimized_selection_rope_reducer,
- initialState: null, middleware: [throttle_middleware]);
-
- store_selection_box = Store(optimized_selection_box_reducer,
- initialState: null, middleware: [throttle_middleware]);
-
- store_potential_crossover = Store(optimized_potential_crossover_reducer,
- initialState: null, middleware: [throttle_middleware]);
-
- store_extensions_move = Store(optimized_dna_extensions_move_reducer,
- initialState: null, middleware: [throttle_middleware]);
-
- store_dna_ends_move = Store(optimized_dna_ends_move_reducer,
- initialState: null, middleware: [throttle_middleware]);
-
- store_helix_group_move = Store(optimized_helix_group_move_reducer,
- initialState: null, middleware: [throttle_middleware]);
+ store_selection_rope = Store(
+ optimized_selection_rope_reducer,
+ initialState: null,
+ middleware: [throttle_middleware],
+ );
+
+ store_selection_box = Store(
+ optimized_selection_box_reducer,
+ initialState: null,
+ middleware: [throttle_middleware],
+ );
+
+ store_potential_crossover = Store(
+ optimized_potential_crossover_reducer,
+ initialState: null,
+ middleware: [throttle_middleware],
+ );
+
+ store_extensions_move = Store(
+ optimized_dna_extensions_move_reducer,
+ initialState: null,
+ middleware: [throttle_middleware],
+ );
+
+ store_dna_ends_move = Store(
+ optimized_dna_ends_move_reducer,
+ initialState: null,
+ middleware: [throttle_middleware],
+ );
+
+ store_helix_group_move = Store(
+ optimized_helix_group_move_reducer,
+ initialState: null,
+ middleware: [throttle_middleware],
+ );
}
Future disable_keyboard_shortcuts_while(Future f()) async {
@@ -239,8 +257,9 @@ class App {
// Each time the oxView frame loads, tell it to adjust the camera to be the same angle as the
// main view in scadnano: y down, z right, x out of the screen.
this.view.oxview_view.frame.onLoad.listen((event) {
- Blob blob_js_camera_commands =
- new Blob(['camera.up.multiplyScalar(-1)'], blob_type_to_string(BlobType.text));
+ Blob blob_js_camera_commands = new Blob([
+ 'camera.up.multiplyScalar(-1)',
+ ], blob_type_to_string(BlobType.text));
Map message = {
'message': 'iframe_drop',
'files': [blob_js_camera_commands],
@@ -256,7 +275,8 @@ class App {
warn_wrong_browser() {
if (!(browser.isChrome || browser.isFirefox) || browser.isEdgeChrome) {
- var msg = 'You appear to be using ${browser.name}. '
+ var msg =
+ 'You appear to be using ${browser.name}. '
'scadnano does not currently support this browser. '
'Please use Chrome, Firefox, or Edge instead.';
window.alert(msg);
@@ -269,14 +289,14 @@ setup_undo_redo_keyboard_listeners() {
// previous solution with onKeyPress used event.code == 'KeyZ' and worked inconsistently
window.onKeyDown.listen((KeyboardEvent event) {
int key = event.which!;
-// print('*' * 100);
-// print('charCode: ${event.charCode}');
-// print(' keyCode: ${event.keyCode}');
-// print(' code: ${event.code}');
-// print(' key: ${event.key}');
-// print(' which: ${event.which}');
-// print("Control: ${event.getModifierState('control')}"); // modifiers.control);
-// print("KeyCode: ${event.key.codeUnitAt(0)}");
+ // print('*' * 100);
+ // print('charCode: ${event.charCode}');
+ // print(' keyCode: ${event.keyCode}');
+ // print(' code: ${event.code}');
+ // print(' key: ${event.key}');
+ // print(' which: ${event.which}');
+ // print("Control: ${event.getModifierState('control')}"); // modifiers.control);
+ // print("KeyCode: ${event.key.codeUnitAt(0)}");
// ctrl+Z to undo
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && key == KeyCode.Z && !event.altKey) {
diff --git a/lib/src/constants.dart b/lib/src/constants.dart
index fd77aec2e..5624427bf 100644
--- a/lib/src/constants.dart
+++ b/lib/src/constants.dart
@@ -9,7 +9,7 @@ import 'state/grid.dart';
// WARNING: Do not modify line below, except for the version string
// (and also add new version string to scadnano_versions_to_link).
-const String CURRENT_VERSION = "0.20.0";
+const String CURRENT_VERSION = "0.20.1";
const String INITIAL_VERSION = "0.1.0";
// scadnano versions that we deploy so that older versions can be used.
@@ -228,7 +228,8 @@ const design_modifications_5p_key = 'modifications_5p_in_design';
const design_modifications_3p_key = 'modifications_3p_in_design';
const design_modifications_int_key = 'modifications_int_in_design';
const groups_key = 'groups';
-final design_keys = [
+final design_keys =
+ [
version_key,
grid_key,
helices_key,
@@ -251,7 +252,8 @@ const bases_per_turn_key = 'bases_per_turn';
const minor_groove_angle_key = 'minor_groove_angle';
const legacy_minor_groove_angle_keys = ['groove_angle'];
const inter_helix_gap_key = 'inter_helix_gap';
-final geometry_keys = [
+final geometry_keys =
+ [
rise_per_base_pair_key,
helix_radius_key,
bases_per_turn_key,
@@ -277,7 +279,8 @@ const major_tick_distance_key = 'major_tick_distance';
const major_tick_start_key = 'major_tick_start';
const major_tick_periodic_distances_key = 'major_tick_periodic_distances';
const group_key = 'group';
-final helix_keys = [
+final helix_keys =
+ [
idx_on_helix_key,
max_offset_key,
min_offset_key,
@@ -319,7 +322,8 @@ const legacy_substrands_keys = ['substrands'];
const modification_5p_key = '5prime_modification';
const modification_3p_key = '3prime_modification';
const modifications_int_key = 'internal_modifications';
-final strand_keys = [
+final strand_keys =
+ [
color_key,
dna_sequence_key,
vendor_fields_key,
@@ -342,7 +346,8 @@ const mod_vendor_code_key = 'vendor_code';
const legacy_mod_vendor_code_keys = ['idt_text'];
const mod_allowed_bases_key = 'allowed_bases';
const mod_connector_length_key = 'connector_length';
-final modification_keys = [
+final modification_keys =
+ [
mod_location_key,
mod_display_text_key,
mod_vendor_code_key,
@@ -373,7 +378,8 @@ const start_key = 'start';
const end_key = 'end';
const deletions_key = 'deletions';
const insertions_key = 'insertions';
-final domain_keys = [
+final domain_keys =
+ [
helix_idx_key,
forward_key,
start_key,
@@ -388,12 +394,7 @@ final domain_keys = [
// Loopout keys
const loopout_key = 'loopout';
-const loopout_keys = [
- loopout_key,
- label_key,
- name_key,
- color_key,
-];
+const loopout_keys = [loopout_key, label_key, name_key, color_key];
// Extension keys
const extension_key = 'extension_num_bases';
@@ -493,5 +494,5 @@ enum strand_bounds_status {
max_offset_out_of_bounds,
in_bounds_with_min_offset_changes,
in_bounds_with_max_offset_changes,
- in_bounds
+ in_bounds,
}
diff --git a/lib/src/dna_sequence_constants.dart b/lib/src/dna_sequence_constants.dart
index 43e75a90e..242f39ff2 100644
--- a/lib/src/dna_sequence_constants.dart
+++ b/lib/src/dna_sequence_constants.dart
@@ -15,7 +15,8 @@ class DNASequencePredefined extends EnumClass {
static const DNASequencePredefined Tilibit_CS4 = _$Tilibit_CS4;
//XXX: change this if we change the variants
- static BuiltList get display_names => [
+ static BuiltList get display_names =>
+ [
'M13 (p7249, standard variant)',
'M13 (p7560)',
'M13 (p8064)',
@@ -41,8 +42,9 @@ class DNASequencePredefined extends EnumClass {
static Serializer get serializer => _$dNASequencePredefinedSerializer;
- static BuiltList get names => [
- for (var dna_sequence_predefined in DNASequencePredefined.values) dna_sequence_predefined.name
+ static BuiltList get names =>
+ [
+ for (var dna_sequence_predefined in DNASequencePredefined.values) dna_sequence_predefined.name,
].toBuiltList();
int get default_rotation => this == M13p7249 ? 5587 : 0;
@@ -183,8 +185,7 @@ CAGACTCTCAGGCAATGACCTGATAGCCTTTGTAGATCTCTCAAAAATAGCTACCCTCTCCGGCATTAATTTATCAGCTA
GATGGTGATTTGACTGTCTCCGGCCTTTCTCACCCTTTTGAATCTTTACCTACACATTACTCAGGCATTGCATTTAAAATATATGAGGGTTCTAAAAATT
TTTATCCTTGCGTTGAAATAAAGGCTTCTCCCGCAAAAGTATTACAGGGTCATAATGTTTTTGGTACAACCGATTTAGCTTTATGCTCTGAGGCTTTATT
GCTTAATTTTGCTAATTCTTTGCCTTGCCTGTATGATTTATTGGATGTT
-"""
- .replaceAll(RegExp(r'\s'), '');
+""".replaceAll(RegExp(r'\s'), '');
final _m13_p7560 = """
AGCTTGGCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCTGGC
@@ -263,8 +264,7 @@ TTCGAGCTCGGTACCCGGGGATCCTCCGTCTTTATCGAGGTAACAAGCACCACGTAGCTTAAGCCCTGTTTACTCATTAC
TCGGAGAAATGATTTATGTGAAATGCGTCAGCCGATTCAAGGCCCCTATATTCGTGCCCACCGACGAGTTGCTTACAGATGGCAGGGCCGCACTGTCGGT
ATCATAGAGTCACTCCAGGGCGAGCGTAAATAGATTAGAAGCGGGGTTATTTTGGCGGGACATTGTCATAAGGTTGACAATTCAGCACTAAGGACACTTA
AGTCGTGCGCATGAATTCACAACCACTTAGAAGAACATCCACCCTGGCTTCTCCTGAGAA
-"""
- .replaceAll(RegExp(r'\s'), '');
+""".replaceAll(RegExp(r'\s'), '');
final _m13_p8064 = """
GGCAATGACCTGATAGCCTTTGTAGATCTCTCAAAAATAGCTACCCTCTCCGGCATTAATTTATCAGCTAGAACGGTTGAATATCATATTGATGGTGATT
@@ -348,8 +348,7 @@ TGCACGGTTACGATGCGCCCATCTACACCAACGTGACCTATCCCATTACGGTCAATCCGCCGTTTGTTCCCACGGAGAAT
CACATTTAATGTTGATGAAAGCTGGCTACAGGAAGGCCAGACGCGAATTATTTTTGATGGCGTTCCTATTGGTTAAAAAATGAGCTGATTTAACAAAAAT
TTAATGCGAATTTTAACAAAATATTAACGTTTACAATTTAAATATTTGCTTATACAATCTTCCTGTTTTTGGGGCTTTTCTGATTATCAACCGGGGTACA
TATGATTGACATGCTAGTTTTACGATTACCGTTCATCGATTCTCTTGTTTGCTCCAGACTCTCA
-"""
- .replaceAll(RegExp(r'\s'), '');
+""".replaceAll(RegExp(r'\s'), '');
final _m13_p8634 = """
GAGTCCACGTTCTTTAATAGTGGACTCTTGTTCCAAACTGGAACAACACTCAACCCTATCTCGGGCTATTCTTTTGATTTATAAGGGATTTTGCCGATTT
@@ -439,8 +438,7 @@ CGCTCTGATTCTAACGAGGAAAGCACGTTATACGTGCTCGTCAAAGCAACCATAGTACGCGCCCTGTAGCGGCGCATTAA
ACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTCCTTTCGCTTTCTTCCCTTCCTTTCTCGCCACGTTCGCCGGCTTTCCCCGTCAAG
CTCTAAATCGGGGGCTCCCTTTAGGGTTCCGATTTAGTGCTTTACGGCACCTCGACCCCAAAAAACTTGATTTGGGTGATGGTTCACGTAGTGGGCCATC
GCCCTGATAGACGGTTTTTCGCCCTTTGACGTTG
-"""
- .replaceAll(RegExp(r'\s'), '');
+""".replaceAll(RegExp(r'\s'), '');
final _tilibit_cs3_l = """
CATTAAGCGCGGCGGGTGTGGTGGTTACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTCCTTTCGCTTTCTTCCCTTCCTTTCTCGC
@@ -519,8 +517,7 @@ GTCCCACGGCATGGCCAAATGAGTTCTTGAGTAGCAAAAGGTGCACGAGACCCCGGTGCCTAAGATTTTATACGCTTCAT
TTGCTTTCGTGTTAATAATTTCGACGTAACGGTGCTGTCTAACATCGAGACTGCAATTACCCCGCCAGACCTTTGCACTTCCACACTAATTTGGTCGATC
TTTGCTTAACCGGGAACTATGTAGTCTATATGAGAATATTGAGCATAAGGTGTCAGCCAGCCTTTATCCTTGAGGCAGATCAGGTCTATTCGCTCAGAGT
AAGATGCTAACACCCAGTAGATGACGACGTTTAATTAGGGCCGAGAGACCAATGTCACG
-"""
- .replaceAll(RegExp(r'\s'), '');
+""".replaceAll(RegExp(r'\s'), '');
final _tilibit_cs4 = """
CATTGACCGGGAGCGCCCTGTAGCGGCGCATTAAGCGCGGCGGGTGTGGTGGTTACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTC
@@ -599,5 +596,4 @@ GCAAAAGCACATAGGGTAATGGATTCGCGTGTAAAGTAGAAATAGAGCGCGCTCCATGAACTTGGATAAGTAATATAGCC
CAGTCGGCTAAACAACGCACCCGCCACGTGCATCGACACAGTGAGCTGTAATCTAGTATTAGGAACTATTGCATTATTGACACTATGGGTCCTCTAACCC
GCGTCCATACCCTGTTCGAGTCGACTTAGCTTGCGCACTCATCCATATTTATGAACCGTACTCGCGACGTGCGATATCAAACTCACAACTCATTACACAC
GACTGGCCCGCGATACCCCCGAGGTAGGCAAAGCGCTCACACTACAGGCTGTTGTCT
-"""
- .replaceAll(RegExp(r'\s'), '');
+""".replaceAll(RegExp(r'\s'), '');
diff --git a/lib/src/json_serializable.dart b/lib/src/json_serializable.dart
index 05853f094..d2d55a66c 100644
--- a/lib/src/json_serializable.dart
+++ b/lib/src/json_serializable.dart
@@ -35,8 +35,8 @@ class SuppressableIndentEncoder {
final JsonEncoder encoder_indent;
SuppressableIndentEncoder(Replacer replacer, {String this.indent = " ", bool this.suppress = true})
- : this.replacer = replacer,
- this.encoder_indent = JsonEncoder.withIndent(indent, replacer.default_encode);
+ : this.replacer = replacer,
+ this.encoder_indent = JsonEncoder.withIndent(indent, replacer.default_encode);
String convert(Object? obj) {
String result = this.encoder_indent.convert(obj);
diff --git a/lib/src/middleware/autostaple_and_autobreak.dart b/lib/src/middleware/autostaple_and_autobreak.dart
index 1a74e25c0..c6733049b 100644
--- a/lib/src/middleware/autostaple_and_autobreak.dart
+++ b/lib/src/middleware/autostaple_and_autobreak.dart
@@ -41,7 +41,7 @@ _autobreak(Store store, actions.Autobreak action) async {
'maxStapleLen': action.max_length,
'tgtStapleLen': action.target_length,
},
- 'design': store.state.design.to_json_serializable()
+ 'design': store.state.design.to_json_serializable(),
});
var response = await http.post(
Uri.parse(constants.autobreak_url),
diff --git a/lib/src/middleware/check_mirror_strands_legal.dart b/lib/src/middleware/check_mirror_strands_legal.dart
index 3a2b67c29..1b8adfe74 100644
--- a/lib/src/middleware/check_mirror_strands_legal.dart
+++ b/lib/src/middleware/check_mirror_strands_legal.dart
@@ -21,7 +21,8 @@ check_reflect_strands_legal_middleware(Store store, action, NextDispat
var group_names = design.group_names_of_strands(strands_to_reflect)!;
if (group_names.length != 1) {
- var msg = 'Cannot reflect selected strands unless they are all on the same helix group.\n'
+ var msg =
+ 'Cannot reflect selected strands unless they are all on the same helix group.\n'
'3 These strands occupy the following helix groups: ${group_names.join(", ")}';
window.alert(msg);
return;
@@ -29,9 +30,10 @@ check_reflect_strands_legal_middleware(Store store, action, NextDispat
String group_name = group_names.first;
HelixGroup group = design.groups[group_name]!;
- List reflected_strands = action.horizontal
- ? horizontal_reflection_of_strands(design, strands_to_reflect, action.reverse_polarity)
- : vertical_reflection_of_strands(group, strands_to_reflect, action.reverse_polarity);
+ List reflected_strands =
+ action.horizontal
+ ? horizontal_reflection_of_strands(design, strands_to_reflect, action.reverse_polarity)
+ : vertical_reflection_of_strands(group, strands_to_reflect, action.reverse_polarity);
var altered_design = design.remove_strands(strands_to_reflect);
altered_design = altered_design.add_strands(reflected_strands);
@@ -39,7 +41,8 @@ check_reflect_strands_legal_middleware(Store store, action, NextDispat
try {
altered_design.check_strands_overlap_legally();
} on IllegalDesignError catch (e) {
- var msg = 'Cannot mirror these strands ${action.horizontal ? "horizontally" : "vertically"}\n'
+ var msg =
+ 'Cannot mirror these strands ${action.horizontal ? "horizontally" : "vertically"}\n'
'Strands would overlap each other:\n\n${e.cause}';
window.alert(msg);
return;
@@ -64,15 +67,20 @@ check_reflect_strands_legal_middleware(Store store, action, NextDispat
//XXX: it's critical that these functions return strands in the same order they were received because
// the ReplaceStrands action replaces them "in place" where the index of the original strand was.
List horizontal_reflection_of_strands(
- Design design, List strands_to_mirror, bool reverse_polarity) {
- int min_offset = [
- for (var strand in strands_to_mirror)
- for (var domain in strand.domains) domain.start
- ].min;
- int max_offset = [
- for (var strand in strands_to_mirror)
- for (var domain in strand.domains) domain.end
- ].max;
+ Design design,
+ List strands_to_mirror,
+ bool reverse_polarity,
+) {
+ int min_offset =
+ [
+ for (var strand in strands_to_mirror)
+ for (var domain in strand.domains) domain.start,
+ ].min;
+ int max_offset =
+ [
+ for (var strand in strands_to_mirror)
+ for (var domain in strand.domains) domain.end,
+ ].max;
List mirrored_strands = [];
for (var strand in strands_to_mirror) {
@@ -91,14 +99,17 @@ List horizontal_reflection_of_strands(
bool is_last =
(i == 0 && reverse_polarity) || (i == mirrored_substrands.length - 1 && !reverse_polarity);
- mirrored_substrands[i] = domain.rebuild((b) => b
- ..start = reflected_end
- ..end = reflected_start
- ..forward = reverse_polarity ? domain.forward : !domain.forward
- ..deletions.replace(reflected_deletions)
- ..insertions.replace(reflected_insertions)
- ..is_first = is_first
- ..is_last = is_last);
+ mirrored_substrands[i] = domain.rebuild(
+ (b) =>
+ b
+ ..start = reflected_end
+ ..end = reflected_start
+ ..forward = reverse_polarity ? domain.forward : !domain.forward
+ ..deletions.replace(reflected_deletions)
+ ..insertions.replace(reflected_insertions)
+ ..is_first = is_first
+ ..is_last = is_last,
+ );
}
}
if (reverse_polarity) {
@@ -135,11 +146,14 @@ List reflect_insertions(Domain domain, int min_offset, int max_offset
int reflect_between_min_and_max(int number, int min_num, int max_num) => max_num - number + min_num;
List vertical_reflection_of_strands(
- HelixGroup group, List strands_to_reflect, bool reverse_polarity) {
+ HelixGroup group,
+ List strands_to_reflect,
+ bool reverse_polarity,
+) {
// helix idxs occupied by strands
var helix_idxs_involved = {
for (var strand in strands_to_reflect)
- for (var domain in strand.domains) domain.helix
+ for (var domain in strand.domains) domain.helix,
};
// vertical display order of those helices, sorted
var helix_orders_involved = [for (int idx in helix_idxs_involved) group.helices_view_order_inverse[idx]!];
@@ -165,11 +179,14 @@ List vertical_reflection_of_strands(
bool is_last =
(i == 0 && !reverse_polarity) || (i == mirrored_substrands.length - 1 && reverse_polarity);
- mirrored_substrands[i] = domain.rebuild((b) => b
- ..helix = reflected_helix_idx
- ..forward = reverse_polarity ? domain.forward : !domain.forward
- ..is_first = is_first
- ..is_last = is_last);
+ mirrored_substrands[i] = domain.rebuild(
+ (b) =>
+ b
+ ..helix = reflected_helix_idx
+ ..forward = reverse_polarity ? domain.forward : !domain.forward
+ ..is_first = is_first
+ ..is_last = is_last,
+ );
}
}
if (!reverse_polarity) {
diff --git a/lib/src/middleware/dna_ends_move_start.dart b/lib/src/middleware/dna_ends_move_start.dart
index adef5c301..adfb889e6 100644
--- a/lib/src/middleware/dna_ends_move_start.dart
+++ b/lib/src/middleware/dna_ends_move_start.dart
@@ -41,12 +41,15 @@ dna_ends_move_start_middleware(Store store, action, NextDispatcher nex
// important that we dispatch to app, not to store, because the app dispatch will know to route this
// to the appropriate optimized store for moving DNAEnds
- app.dispatch(actions.DNAEndsMoveSetSelectedEnds(
+ app.dispatch(
+ actions.DNAEndsMoveSetSelectedEnds(
original_offset: action.offset,
moves: moves.toBuiltList(),
helix: action.helix,
strands_affected: strands_affected.toBuiltSet(),
- geometry: geometry));
+ geometry: geometry,
+ ),
+ );
} else {
next(action);
}
@@ -89,9 +92,10 @@ int find_allowable_offset(Design design, DNAEnd end, BuiltSet selected_e
}
int closest_unselected_offset = unselected_end_offsets_to_one_side.reduce(highest ? min : max);
- int num_selected_offsets_between = selected_end_offsets_to_one_side
- .where((o) => highest ? o < closest_unselected_offset : o > closest_unselected_offset)
- .length;
+ int num_selected_offsets_between =
+ selected_end_offsets_to_one_side
+ .where((o) => highest ? o < closest_unselected_offset : o > closest_unselected_offset)
+ .length;
int adjust_factor = highest ? -1 - num_selected_offsets_between : 1 + num_selected_offsets_between;
return closest_unselected_offset + adjust_factor;
diff --git a/lib/src/middleware/dna_extensions_move_start.dart b/lib/src/middleware/dna_extensions_move_start.dart
index f7f6c7532..14cf072c9 100644
--- a/lib/src/middleware/dna_extensions_move_start.dart
+++ b/lib/src/middleware/dna_extensions_move_start.dart
@@ -44,14 +44,19 @@ dna_extensions_move_start_middleware(Store store, action, NextDispatch
extension_start_point += group.translation(geometry);
var extension_end_point = util.compute_extension_free_end_svg(
- extension_start_point, extension, extension.adjacent_domain, geometry);
+ extension_start_point,
+ extension,
+ extension.adjacent_domain,
+ geometry,
+ );
var color = design.extension_end_to_strand(end).color;
var move = DNAExtensionMove(
- dna_end: end,
- color: color,
- original_position: extension_end_point,
- attached_end_position: extension_start_point,
- extension: extension);
+ dna_end: end,
+ color: color,
+ original_position: extension_end_point,
+ attached_end_position: extension_start_point,
+ extension: extension,
+ );
moves.add(move);
}
@@ -64,11 +69,14 @@ dna_extensions_move_start_middleware(Store store, action, NextDispatch
// important that we dispatch to app, not to store, because the app dispatch will know to route this
// to the appropriate optimized store for moving DNAEnds
- app.dispatch(actions.DNAExtensionsMoveSetSelectedExtensionEnds(
+ app.dispatch(
+ actions.DNAExtensionsMoveSetSelectedExtensionEnds(
original_point: action.start_point,
moves: moves.toBuiltList(),
strands_affected: strands_affected.toBuiltSet(),
- helix: action.helix));
+ helix: action.helix,
+ ),
+ );
} else {
next(action);
}
diff --git a/lib/src/middleware/edit_select_mode_change.dart b/lib/src/middleware/edit_select_mode_change.dart
index 23ebaedbc..6751af4ed 100644
--- a/lib/src/middleware/edit_select_mode_change.dart
+++ b/lib/src/middleware/edit_select_mode_change.dart
@@ -46,14 +46,18 @@ edit_select_mode_change_middleware(Store store, action, NextDispatcher
}
set_selectables_css_style_rules(
- Design design, BuiltSet edit_modes, BuiltSet select_modes) {
+ Design design,
+ BuiltSet edit_modes,
+ BuiltSet select_modes,
+) {
bool edit_mode_is_select_or_rope =
edit_modes.contains(EditModeChoice.select) || edit_modes.contains(EditModeChoice.rope_select);
bool scaffold_parts_selectable =
edit_mode_is_select_or_rope && (design.is_origami && select_modes.contains(SelectModeChoice.scaffold));
bool staple_parts_selectable =
edit_mode_is_select_or_rope && (design.is_origami && select_modes.contains(SelectModeChoice.staple));
- bool all_parts_selectable = edit_mode_is_select_or_rope &&
+ bool all_parts_selectable =
+ edit_mode_is_select_or_rope &&
(!design.is_origami || (scaffold_parts_selectable && staple_parts_selectable));
for (var select_mode_choice in [SelectModeChoice.strand] + SelectModeChoice.strand_parts.toList()) {
diff --git a/lib/src/middleware/export_cadnano_file.dart b/lib/src/middleware/export_cadnano_file.dart
index fe44ef13a..cb48fa5bc 100644
--- a/lib/src/middleware/export_cadnano_file.dart
+++ b/lib/src/middleware/export_cadnano_file.dart
@@ -80,7 +80,8 @@ Map to_cadnano_v2_serializable(Design design, [String name = ""
}
if (grid_used.length > 1) {
throw new IllegalCadnanoDesignError(
- 'Designs using helix groups can be exported to cadnano v2 only if all groups share the same grid type.');
+ 'Designs using helix groups can be exported to cadnano v2 only if all groups share the same grid type.',
+ );
} else {
design_grid = grid_type;
}
@@ -110,8 +111,10 @@ Map to_cadnano_v2_serializable(Design design, [String name = ""
for (Strand strand in design.strands) {
for (Substrand substrand in strand.substrands) {
if (substrand is Loopout || substrand is Extension) {
- throw new IllegalCadnanoDesignError('We cannot handle designs with Loopouts or Extensions, '
- 'since they are not cadnano v2 concepts.');
+ throw new IllegalCadnanoDesignError(
+ 'We cannot handle designs with Loopouts or Extensions, '
+ 'since they are not cadnano v2 concepts.',
+ );
}
bool cadnano_expected_direction;
@@ -133,8 +136,9 @@ Map to_cadnano_v2_serializable(Design design, [String name = ""
if (!cadnano_expected_direction) {
throw new IllegalCadnanoDesignError(
- 'We can only convert designs where even helices have the scaffold going forward and odd helices '
- 'have the scaffold going backward see the spec v2.txt Note 4. ${domain}');
+ 'We can only convert designs where even helices have the scaffold going forward and odd helices '
+ 'have the scaffold going backward see the spec v2.txt Note 4. ${domain}',
+ );
}
}
}
@@ -155,7 +159,11 @@ int _get_multiple_of_x_sup_closest_to_y(int x, int y) {
/// Creates blank cadnanov2 helices in and initialized all their fields.
Map _cadnano_v2_fill_blank(
- Design design, Map dct, int num_bases, Grid design_grid) {
+ Design design,
+ Map dct,
+ int num_bases,
+ Grid design_grid,
+) {
Map helices_ids_reverse = new HashMap();
int i = 0;
for (Helix helix in design.helices.values) {
@@ -200,7 +208,8 @@ void _cadnano_v2_place_strand(Strand strand, Map dct, Map dct, Map helix_dct, Domain dom
if (i_base == start) {
if (forward)
- (helix_dct[strand_type][i_base] as List)
- .setRange(2, (helix_dct[strand_type][i_base] as List).length, [to_helix, to_base]);
+ (helix_dct[strand_type][i_base] as List).setRange(
+ 2,
+ (helix_dct[strand_type][i_base] as List).length,
+ [to_helix, to_base],
+ );
else
(helix_dct[strand_type][i_base] as List).setRange(0, 2, [from_helix, from_base]);
} else if (i_base < end - 1) {
@@ -312,8 +325,10 @@ void _cadnano_v2_place_strand_segment(Map helix_dct, Domain dom
if (forward)
helix_dct[strand_type][i_base].setRange(0, 2, [from_helix, from_base]);
else
- helix_dct[strand_type][i_base]
- .setRange(2, (helix_dct[strand_type][i_base] as List).length, [to_helix, to_base]);
+ helix_dct[strand_type][i_base].setRange(2, (helix_dct[strand_type][i_base] as List).length, [
+ to_helix,
+ to_base,
+ ]);
}
}
}
@@ -321,8 +336,13 @@ void _cadnano_v2_place_strand_segment(Map helix_dct, Domain dom
/// Converts a crossover to cadnano v2 format.
/// Returns a conversion table from ids in the structure self.helices to helices ids
/// as given by helix.idx.
-void _cadnano_v2_place_crossover(Map helix_from_dct, Map helix_to_dct,
- Domain domain_from, Domain domain_to, String strand_type) {
+void _cadnano_v2_place_crossover(
+ Map helix_from_dct,
+ Map helix_to_dct,
+ Domain domain_from,
+ Domain domain_to,
+ String strand_type,
+) {
int helix_from = helix_from_dct['num'];
int start_from = domain_from.start;
int end_from = domain_from.end;
@@ -338,16 +358,24 @@ void _cadnano_v2_place_crossover(Map helix_from_dct, Map)
- .setRange(2, (helix_from_dct[strand_type][end_from - 1] as List).length, [helix_to, end_to - 1]);
+ (helix_from_dct[strand_type][end_from - 1] as List).setRange(
+ 2,
+ (helix_from_dct[strand_type][end_from - 1] as List).length,
+ [helix_to, end_to - 1],
+ );
(helix_to_dct[strand_type][end_to - 1] as List).setRange(0, 2, [helix_from, end_from - 1]);
} else if (!forward_from && forward_to) {
- (helix_from_dct[strand_type][start_from] as List)
- .setRange(2, (helix_from_dct[strand_type][start_from] as List).length, [helix_to, start_to]);
+ (helix_from_dct[strand_type][start_from] as List).setRange(
+ 2,
+ (helix_from_dct[strand_type][start_from] as List).length,
+ [helix_to, start_to],
+ );
(helix_to_dct[strand_type][start_to] as List).setRange(0, 2, [helix_from, start_from]);
} else if (forward_from && forward_to) {
- helix_from_dct[strand_type][end_from - 1]
- .setRange(2, helix_from_dct[strand_type][end_from - 1].length, [helix_to, start_to]);
+ helix_from_dct[strand_type][end_from - 1].setRange(2, helix_from_dct[strand_type][end_from - 1].length, [
+ helix_to,
+ start_to,
+ ]);
helix_to_dct[strand_type][end_to - 1].setRange(0, 2, [helix_from, start_from]);
if (helix_from_dct['row'] % 2 != helix_to_dct['row'] % 2) {
throw new IllegalCadnanoDesignError('''\
@@ -356,8 +384,10 @@ row number, here helix num ${helix_from_dct['num']} and helix num ${helix_to_dct
have different parity of row number: respectively ${helix_from_dct['row']} and ${helix_to_dct['row']}''');
}
} else if (!forward_from && !forward_to) {
- helix_from_dct[strand_type][start_from]
- .setRange(2, helix_from_dct[strand_type][start_from].length, [helix_to, end_to - 1]);
+ helix_from_dct[strand_type][start_from].setRange(2, helix_from_dct[strand_type][start_from].length, [
+ helix_to,
+ end_to - 1,
+ ]);
helix_to_dct[strand_type][end_to - 1].setRange(0, 2, [helix_from, start_from]);
if (helix_from_dct['row'] % 2 != helix_to_dct['row'] % 2) {
throw new IllegalCadnanoDesignError('''\
diff --git a/lib/src/middleware/export_dna_sequences.dart b/lib/src/middleware/export_dna_sequences.dart
index 07eee4a7c..629219ee2 100644
--- a/lib/src/middleware/export_dna_sequences.dart
+++ b/lib/src/middleware/export_dna_sequences.dart
@@ -78,20 +78,22 @@ export_dna_sequences_middleware(Store store, action, NextDispatcher ne
);
// See export comments for why we have this stupid special case
if (result is Future>) {
- result.then((response) {
- List content = response;
- util.save_file(filename, content, blob_type: blob_type);
- }).catchError((e, stackTrace) {
- var cause = "";
- if (has_cause(e)) {
- cause = e.cause;
- } else if (has_message(e)) {
- cause = e.message;
- }
- var msg = cause + '\n\n' + stackTrace.toString();
- store.dispatch(actions.ErrorMessageSet(msg));
- app.view.design_view.render(store.state);
- });
+ result
+ .then((response) {
+ List content = response;
+ util.save_file(filename, content, blob_type: blob_type);
+ })
+ .catchError((e, stackTrace) {
+ var cause = "";
+ if (has_cause(e)) {
+ cause = e.cause;
+ } else if (has_message(e)) {
+ cause = e.message;
+ }
+ var msg = cause + '\n\n' + stackTrace.toString();
+ store.dispatch(actions.ErrorMessageSet(msg));
+ app.view.design_view.render(store.state);
+ });
} else {
String content = result;
util.save_file(filename, content, blob_type: blob_type);
@@ -124,21 +126,30 @@ Future export_dna() async {
FixedList items = FixedList(idx_strand_order_str + 1);
- items[idx_delimiter] = DialogText(label: 'delimiter between IDT fields', value: ',', tooltip: '''\
+ items[idx_delimiter] = DialogText(
+ label: 'delimiter between IDT fields',
+ value: ',',
+ tooltip: '''\
Delimiter to separate IDT fields in a "bulk input" text file, for instance if set to ";", then a line
of the file could be
- strand_name;AAAAACCCCCGGGGG;25nm;STD''');
+ strand_name;AAAAACCCCCGGGGG;25nm;STD''',
+ );
- items[idx_domain_delimiter] =
- DialogText(label: 'delimiter between DNA sequences of domains', value: '', tooltip: '''\
+ items[idx_domain_delimiter] = DialogText(
+ label: 'delimiter between DNA sequences of domains',
+ value: '',
+ tooltip: '''\
Delimiter to separate DNA sequences from different domains/loopouts/extensions, for instance if set to " ",
then the exported DNA sequence could be
AAAAA CCCCC GGGGG
-if it had three domains each of length 5.''');
+if it had three domains each of length 5.''',
+ );
items[idx_include_scaffold] = DialogCheckbox(label: 'include scaffold', value: false);
- items[idx_include_only_selected_strands] =
- DialogCheckbox(label: 'include only selected strands', value: false);
+ items[idx_include_only_selected_strands] = DialogCheckbox(
+ label: 'include only selected strands',
+ value: false,
+ );
items[idx_exclude_selected_strands] = DialogCheckbox(label: 'exclude selected strands', value: false);
items[idx_format_str] = DialogRadio(
label: 'export format',
@@ -147,21 +158,30 @@ if it had three domains each of length 5.''');
option_tooltips: ExportDNAFormat.tooltips,
);
items[idx_column_major_plate] = DialogCheckbox(
- label: 'column-major well order (uncheck for row-major order)', value: true, tooltip: """\
+ label: 'column-major well order (uncheck for row-major order)',
+ value: true,
+ tooltip: """\
For exporting to plates, this customizes the order in which wells are enumerated.
Column-major order is A1, B1, C1, ... Row-major order is A1, A2, A3, ...
Note that this is distinct from the notion of "sort strands", which helps specify the
order in which strands are processed (as opposed to order of wells in a plate).
-""");
- items[idx_sort] = DialogCheckbox(label: 'sort strands', value: false, tooltip: """\
+""",
+ );
+ items[idx_sort] = DialogCheckbox(
+ label: 'sort strands',
+ value: false,
+ tooltip: """\
By default strands are exported in the order they are stored in the .sc file.
Checking this box allows some customization of the order in which strands are processed.
(See "column-major" box below for description.) Note that for exporting plates,
this is distinct from the order in which wells are enumerated when putting strands
into the plate. That can be customized by selecting "column-major well order" below.
-""");
+""",
+ );
items[idx_column_major_strand] = DialogCheckbox(
- label: 'column-major strand order (uncheck for row-major order)', value: true, tooltip: """\
+ label: 'column-major strand order (uncheck for row-major order)',
+ value: true,
+ tooltip: """\
When checked, strands are processed in column-major "visual order" by their 5' ends.
Column-major means sort first by offset, then by helix index. For example, if
the 5' addresses are (0,5), meaning helix 0 at offset 5,
@@ -170,7 +190,8 @@ then that is row-major order. Column-major order would be
(0,5), (1,5), (2,5), (0,10), (1,10), (2,10), (0,15), (1,15), (2,15).
Finally, instead of using the addresses of 5' ends, other strand "parts" can be
used to sort; see options under "strand part to sort by".
-""");
+""",
+ );
items[idx_strand_order_str] = DialogRadio(
label: 'strand part to sort by',
options: sort_options,
@@ -183,28 +204,29 @@ which part of the strand to use as the address.
);
var dialog = Dialog(
- title: 'export DNA sequences',
- type: DialogType.export_dna_sequences,
- items: items,
- disable_when_any_checkboxes_on: {
- idx_include_only_selected_strands: [idx_exclude_selected_strands],
- idx_exclude_selected_strands: [idx_include_only_selected_strands],
+ title: 'export DNA sequences',
+ type: DialogType.export_dna_sequences,
+ items: items,
+ disable_when_any_checkboxes_on: {
+ idx_include_only_selected_strands: [idx_exclude_selected_strands],
+ idx_exclude_selected_strands: [idx_include_only_selected_strands],
+ },
+ disable_when_any_checkboxes_off: {
+ idx_column_major_strand: [idx_sort],
+ idx_strand_order_str: [idx_sort],
+ },
+ disable_when_any_radio_button_selected: {
+ idx_column_major_plate: {
+ idx_format_str: [
+ // need to use toString() to get the exact string value displayed for later comparison
+ // using ExportDNAFormat.name instead will return a different string (e.g. 'csv' vs
+ // 'CSV (.csv)') than displayed in the radio button
+ ExportDNAFormat.csv.toString(),
+ ExportDNAFormat.idt_bulk.toString(),
+ ],
},
- disable_when_any_checkboxes_off: {
- idx_column_major_strand: [idx_sort],
- idx_strand_order_str: [idx_sort],
- },
- disable_when_any_radio_button_selected: {
- idx_column_major_plate: {
- idx_format_str: [
- // need to use toString() to get the exact string value displayed for later comparison
- // using ExportDNAFormat.name instead will return a different string (e.g. 'csv' vs
- // 'CSV (.csv)') than displayed in the radio button
- ExportDNAFormat.csv.toString(),
- ExportDNAFormat.idt_bulk.toString(),
- ]
- },
- });
+ },
+ );
List? results = await util.dialog(dialog);
if (results == null) return;
@@ -228,17 +250,19 @@ which part of the strand to use as the address.
assert(!(include_only_selected_strands && exclude_selected_strands));
- app.dispatch(actions.ExportDNA(
- include_scaffold: include_scaffold,
- include_only_selected_strands: include_only_selected_strands,
- exclude_selected_strands: exclude_selected_strands,
- export_dna_format: format,
- delimiter: delimiter,
- domain_delimiter: domain_delimiter,
- strand_order: strand_order,
- column_major_strand: column_major_strand,
- column_major_plate: column_major_plate,
- ));
+ app.dispatch(
+ actions.ExportDNA(
+ include_scaffold: include_scaffold,
+ include_only_selected_strands: include_only_selected_strands,
+ exclude_selected_strands: exclude_selected_strands,
+ export_dna_format: format,
+ delimiter: delimiter,
+ domain_delimiter: domain_delimiter,
+ strand_order: strand_order,
+ column_major_strand: column_major_strand,
+ column_major_plate: column_major_plate,
+ ),
+ );
}
String cando_compatible_csv_export(Iterable strands) {
@@ -262,10 +286,12 @@ String cando_compatible_csv_export(Iterable strands) {
String cando_strand_end = cando_split_name[1]!;
String cando_strand_start = cando_split_name[0]!;
// Write the strand to the CSV file.
- buf.writeln('${cando_strand_start},${cando_strand_end}'
- ',${vendor_sequence_null_aware(strand, "")}'
- ',${vendor_sequence_null_aware(strand, "").length}'
- ',${strand.color.toHexColor().toCssString().toUpperCase()}');
+ buf.writeln(
+ '${cando_strand_start},${cando_strand_end}'
+ ',${vendor_sequence_null_aware(strand, "")}'
+ ',${vendor_sequence_null_aware(strand, "").length}'
+ ',${strand.color.toHexColor().toCssString().toUpperCase()}',
+ );
}
return buf.toString();
}
diff --git a/lib/src/middleware/export_svg.dart b/lib/src/middleware/export_svg.dart
index e6d7ad03c..ad9a7270c 100644
--- a/lib/src/middleware/export_svg.dart
+++ b/lib/src/middleware/export_svg.dart
@@ -26,13 +26,17 @@ export_svg_middleware(Store store, dynamic action, NextDispatcher next
var export_svg_action_delayed_for_png_cache = ui_state.export_svg_action_delayed_for_png_cache;
var disable_png_caching_dna_sequences = ui_state.disable_png_caching_dna_sequences;
- bool using_png_dna_sequence = util.use_png(dna_sequence_png_uri, is_zoom_above_threshold,
- export_svg_action_delayed_for_png_cache, disable_png_caching_dna_sequences);
+ bool using_png_dna_sequence = util.use_png(
+ dna_sequence_png_uri,
+ is_zoom_above_threshold,
+ export_svg_action_delayed_for_png_cache,
+ disable_png_caching_dna_sequences,
+ );
// If main needs to be exported, then the png needs to be disabled if currently being used.
bool need_to_disable_png =
(action is actions.CopySelectedStandsToClipboardImage || action.type == actions.ExportSvgType.main) &&
- using_png_dna_sequence;
+ using_png_dna_sequence;
if (need_to_disable_png) {
// Disables the png
@@ -50,11 +54,15 @@ export_svg_middleware(Store store, dynamic action, NextDispatcher next
if (action.type == actions.ExportSvgType.selected) {
List selected_elts = get_selected_svg_elements(store.state);
if (selected_elts.length == 0) {
- window.alert("No strands are selected, so there is nothing to export.\n"
- "Please select some strands before choosing this option.");
+ window.alert(
+ "No strands are selected, so there is nothing to export.\n"
+ "Please select some strands before choosing this option.",
+ );
} else {
var cloned_svg_element_with_style = get_cloned_svg_element_with_style(
- selected_elts, store.state.ui_state.export_svg_text_separately);
+ selected_elts,
+ store.state.ui_state.export_svg_text_separately,
+ );
_export_from_element(cloned_svg_element_with_style, 'selected');
}
} else {
@@ -86,9 +94,13 @@ List get_selected_svg_elements(AppState state) {
if (app.state.ui_state.base_pair_display_type != BasePairDisplayType.none) {
bool export_bp_if_other_not_selected =
app.state.ui_state.export_base_pair_lines_if_other_strand_not_selected;
- var base_pairs = state.ui_state.show_base_pair_lines_with_mismatches
- ? state.design.selected_base_pairs_with_mismatches(selected_strands, export_bp_if_other_not_selected)
- : state.design.selected_base_pairs(selected_strands, export_bp_if_other_not_selected);
+ var base_pairs =
+ state.ui_state.show_base_pair_lines_with_mismatches
+ ? state.design.selected_base_pairs_with_mismatches(
+ selected_strands,
+ export_bp_if_other_not_selected,
+ )
+ : state.design.selected_base_pairs(selected_strands, export_bp_if_other_not_selected);
selected_elts.addAll(get_svg_elements_of_base_pairs(base_pairs));
}
selected_elts.addAll(get_svg_elements_of_strands(selected_strands));
@@ -140,7 +152,7 @@ DomMatrix dominant_baseline_matrix(String dominant_baseline, double rot, String
0,
0,
1,
- ...rotate_vector([0, (-3 * get_text_height(font)) / 12], rot)
+ ...rotate_vector([0, (-3 * get_text_height(font)) / 12], rot),
]);
case "hanging":
return new DomMatrix([
@@ -148,7 +160,7 @@ DomMatrix dominant_baseline_matrix(String dominant_baseline, double rot, String
0,
0,
1,
- ...rotate_vector([0, (9 * get_text_height(font)) / 12], rot)
+ ...rotate_vector([0, (9 * get_text_height(font)) / 12], rot),
]);
case "central":
return new DomMatrix([
@@ -156,7 +168,7 @@ DomMatrix dominant_baseline_matrix(String dominant_baseline, double rot, String
0,
0,
1,
- ...rotate_vector([0, (4 * get_text_height(font)) / 12], rot)
+ ...rotate_vector([0, (4 * get_text_height(font)) / 12], rot),
]);
default:
return new DomMatrix([1, 0, 0, 1, 0, 0]);
@@ -164,25 +176,11 @@ DomMatrix dominant_baseline_matrix(String dominant_baseline, double rot, String
}
Map matrix_to_map(Matrix matrix) {
- return {
- "a": matrix.a,
- "b": matrix.b,
- "c": matrix.c,
- "d": matrix.d,
- "e": matrix.e,
- "f": matrix.f,
- };
+ return {"a": matrix.a, "b": matrix.b, "c": matrix.c, "d": matrix.d, "e": matrix.e, "f": matrix.f};
}
Map dom_matrix_to_map(DomMatrix matrix) {
- return {
- "a": matrix.a,
- "b": matrix.b,
- "c": matrix.c,
- "d": matrix.d,
- "e": matrix.e,
- "f": matrix.f,
- };
+ return {"a": matrix.a, "b": matrix.b, "c": matrix.c, "d": matrix.d, "e": matrix.e, "f": matrix.f};
}
Map point_to_map(svg.Point point) {
@@ -203,23 +201,31 @@ TextElement create_portable_text(TextContentElement text_ele, int j) {
rot = item.angle! as double;
}
if (char_ele.style.getPropertyValue("dominant-baseline") != "") {
- pos = pos.matrixTransform(dom_matrix_to_map(dominant_baseline_matrix(
- char_ele.style.getPropertyValue("dominant-baseline"),
- rot,
- text_ele.style.fontSize + " " + text_ele.style.fontFamily)));
+ pos = pos.matrixTransform(
+ dom_matrix_to_map(
+ dominant_baseline_matrix(
+ char_ele.style.getPropertyValue("dominant-baseline"),
+ rot,
+ text_ele.style.fontSize + " " + text_ele.style.fontFamily,
+ ),
+ ),
+ );
}
char_ele.style.setProperty("dominant-baseline", "");
char_ele.style.setProperty("text-anchor", "start");
- if (text_ele.classes.any([
- "loopout-extension-length",
- "dna-seq-insertion",
- "dna-seq-loopout",
- "dna-seq-extension",
- "dna-seq"
- ].contains)) {
+ if (text_ele.classes.any(
+ [
+ "loopout-extension-length",
+ "dna-seq-insertion",
+ "dna-seq-loopout",
+ "dna-seq-extension",
+ "dna-seq",
+ ].contains,
+ )) {
char_ele.style.setProperty(
- "text-shadow", // doesn't work in PowerPoint
- "-0.7px -0.7px 0 #fff, 0.7px -0.7px 0 #fff, -0.7px 0.7px 0 #fff, 0.7px 0.7px 0 #fff");
+ "text-shadow", // doesn't work in PowerPoint
+ "-0.7px -0.7px 0 #fff, 0.7px -0.7px 0 #fff, -0.7px 0.7px 0 #fff, 0.7px 0.7px 0 #fff",
+ );
}
char_ele.setAttribute("x", pos.x.toString());
char_ele.setAttribute("y", pos.y.toString());
@@ -248,7 +254,9 @@ RectElement create_portable_rect(RectElement ele) {
Transform item = ele.transform!.baseVal!.getItem(i);
if (item.angle != 0) {
portableEle.setAttribute(
- "transform", "rotate(${item.angle} ${pos.x! + pos.width! / 2} ${pos.y! + pos.height! / 2})");
+ "transform",
+ "rotate(${item.angle} ${pos.x! + pos.width! / 2} ${pos.y! + pos.height! / 2})",
+ );
}
}
return portableEle;
@@ -290,8 +298,8 @@ SvgSvgElement make_portable(SvgSvgElement src) {
}
SvgSvgElement get_cloned_svg_element_with_style(List selected_elts, bool separate_text) {
- var cloned_svg_element_with_style = SvgSvgElement()
- ..children = selected_elts.map(clone_and_apply_style).toList();
+ var cloned_svg_element_with_style =
+ SvgSvgElement()..children = selected_elts.map(clone_and_apply_style).toList();
if (separate_text) {
cloned_svg_element_with_style = make_portable(cloned_svg_element_with_style);
}
@@ -302,8 +310,10 @@ SvgSvgElement get_cloned_svg_element_with_style(List selected_elts, boo
cloned_svg_element_with_style.remove();
// have to add some padding to viewbox, for some reason bbox doesn't always fit it by a few pixels??
- cloned_svg_element_with_style.setAttribute('viewBox',
- '${bbox.x!.floor() - 1} ${bbox.y!.floor() - 1} ${bbox.width!.ceil() + 3} ${bbox.height!.ceil() + 6}');
+ cloned_svg_element_with_style.setAttribute(
+ 'viewBox',
+ '${bbox.x!.floor() - 1} ${bbox.y!.floor() - 1} ${bbox.width!.ceil() + 3} ${bbox.height!.ceil() + 6}',
+ );
return cloned_svg_element_with_style;
}
@@ -394,7 +404,7 @@ Element clone_and_apply_style(Element elt_orig) {
clone_and_apply_style_rec(Element elt_styled, Element elt_orig, {int depth = 0}) {
// print('elt_styled ${elt_styled.id} and elt_orig ${elt_orig.id}');
-// Set children_styled_to_remove = {};
+ // Set children_styled_to_remove = {};
var tag_name = elt_styled.tagName;
if (elt_styled.classes.contains('svg-pan-zoom_viewport')) {
@@ -410,9 +420,9 @@ clone_and_apply_style_rec(Element elt_styled, Element elt_orig, {int depth = 0})
// 'id ${elt_styled.id} fill ${style_def.getPropertyValue("fill")} relevant_styles ${relevant_styles[tag_name]}');
//TODO: figure out how to remove nodes that aren't visible;
// getting error "Unsupported operation: Cannot setRange on filtered list" when removing children
-// if (style_def.visibility == 'hidden') {
-// children_styled_to_remove.add(child_styled);
-// }
+ // if (style_def.visibility == 'hidden') {
+ // children_styled_to_remove.add(child_styled);
+ // }
for (var style_name in relevant_styles[tag_name]!) {
var style_value = style_def.getPropertyValue(style_name);
@@ -432,10 +442,10 @@ clone_and_apply_style_rec(Element elt_styled, Element elt_orig, {int depth = 0})
// elt_styled.setAttribute("style", style_string);
// print(elt_styled.styleMap);
-// print('${' ' * depth * 2} ${tag_name} ${elt_orig.classes.toList()} style: $style_string');
+ // print('${' ' * depth * 2} ${tag_name} ${elt_orig.classes.toList()} style: $style_string');
}
-// svg_elt_styled.children.removeWhere((node) => children_styled_to_remove.contains(node));
+ // svg_elt_styled.children.removeWhere((node) => children_styled_to_remove.contains(node));
// recurse
var children_styled = elt_styled.childNodes;
diff --git a/lib/src/middleware/forbid_create_circular_strand_no_crossovers_middleware.dart b/lib/src/middleware/forbid_create_circular_strand_no_crossovers_middleware.dart
index cbd6713e9..89c811d8a 100644
--- a/lib/src/middleware/forbid_create_circular_strand_no_crossovers_middleware.dart
+++ b/lib/src/middleware/forbid_create_circular_strand_no_crossovers_middleware.dart
@@ -12,7 +12,10 @@ import '../state/helix.dart';
/// Disallows converting all crossovers on a circular strand to loopouts, since then the first
/// substrand would necessarily be a loopout, currently disallowed.
forbid_create_circular_strand_no_crossovers_middleware(
- Store store, dynamic action, NextDispatcher next) {
+ Store store,
+ dynamic action,
+ NextDispatcher next,
+) {
var msg_generic = """\
Unfortunately it is not possible in scadnano to create a circular strand
with no crossovers and only loopouts. (This is because it is unsupported
diff --git a/lib/src/middleware/group_remove.dart b/lib/src/middleware/group_remove.dart
index 66022da7f..45e82319f 100644
--- a/lib/src/middleware/group_remove.dart
+++ b/lib/src/middleware/group_remove.dart
@@ -11,16 +11,20 @@ group_remove_middleware(Store store, dynamic action, NextDispatcher ne
if (action is actions.GroupRemove) {
var helix_idxs_in_group = store.state.design.helix_idxs_in_group[action.name]!;
if (helix_idxs_in_group.isNotEmpty) {
- var confirm_remove = window.confirm('Group "${action.name}" has helices in it. '
- 'If you delete the group, the helices will be removed, '
- 'including any portions of strands on them.\n\n'
- 'Are you sure you wish to remove group "${action.name}"?');
+ var confirm_remove = window.confirm(
+ 'Group "${action.name}" has helices in it. '
+ 'If you delete the group, the helices will be removed, '
+ 'including any portions of strands on them.\n\n'
+ 'Are you sure you wish to remove group "${action.name}"?',
+ );
if (!confirm_remove) {
return;
}
}
var helices_remove_action = actions.BatchAction(
- [for (int idx in helix_idxs_in_group) actions.HelixRemove(idx)]..add(action), "remove group");
+ [for (int idx in helix_idxs_in_group) actions.HelixRemove(idx)]..add(action),
+ "remove group",
+ );
store.dispatch(helices_remove_action);
} else {
next(action);
diff --git a/lib/src/middleware/helices_positions_set_based_on_crossovers.dart b/lib/src/middleware/helices_positions_set_based_on_crossovers.dart
index 4f8d08b75..3820ce6f6 100644
--- a/lib/src/middleware/helices_positions_set_based_on_crossovers.dart
+++ b/lib/src/middleware/helices_positions_set_based_on_crossovers.dart
@@ -12,7 +12,6 @@ import '../state/domain.dart';
import '../state/geometry.dart';
import '../state/helix.dart';
import '../state/position3d.dart';
-import 'package:tuple/tuple.dart';
import '../state/address.dart';
import '../actions/actions.dart' as actions;
@@ -25,7 +24,10 @@ import '../state/app_state.dart';
/// Dispatches a normal HelixPositionSet action (many of them batched).
/// Also changes the roll of each Helix to point those crossovers at each other in the new positions.
helix_positions_set_based_on_crossovers_middleware(
- Store store, dynamic action, NextDispatcher next) {
+ Store store,
+ dynamic action,
+ NextDispatcher next,
+) {
next(action);
if (action is actions.HelicesPositionsSetBasedOnCrossovers) {
var all_actions = get_helix_position_and_roll_actions(store.state);
@@ -43,8 +45,10 @@ List get_helix_position_and_roll_actions(AppState state)
}
}
if (group_names_to_skip.isNotEmpty) {
- window.alert('Skipping helix groups ${group_names_to_skip.join(", ")} '
- 'because their grids are not "none".');
+ window.alert(
+ 'Skipping helix groups ${group_names_to_skip.join(", ")} '
+ 'because their grids are not "none".',
+ );
}
List all_actions = [];
@@ -55,13 +59,18 @@ List get_helix_position_and_roll_actions(AppState state)
var group = state.design.groups[group_name]!;
var geometry = group.geometry ?? state.design.geometry;
List helices = _get_helices_to_process(state, group);
- List>? addresses = _get_addresses_to_process(state, helices);
+ List<(Address, Address)>? addresses = _get_addresses_to_process(state, helices);
if (addresses == null) {
continue;
}
double first_roll = helices[0].roll;
- List rolls_and_positions =
- _calculate_rolls_and_positions(state.design, geometry, helices, addresses, first_roll);
+ List rolls_and_positions = _calculate_rolls_and_positions(
+ state.design,
+ geometry,
+ helices,
+ addresses,
+ first_roll,
+ );
var all_actions_this_group = set_rolls_and_positions(helices, rolls_and_positions, geometry);
all_actions.addAll(all_actions_this_group);
}
@@ -80,7 +89,8 @@ List _get_helices_to_process(AppState state, HelixGroup group) {
helices = [for (var helix_idx in selected_helix_idxs) design.helices[helix_idx]!];
}
helices.sort(
- (h1, h2) => group.helices_view_order_inverse[h1.idx]! - group.helices_view_order_inverse[h2.idx]!);
+ (h1, h2) => group.helices_view_order_inverse[h1.idx]! - group.helices_view_order_inverse[h2.idx]!,
+ );
return helices;
}
@@ -89,17 +99,17 @@ List _get_helices_to_process(AppState state, HelixGroup group) {
/// on the two helices it connects.
/// returns null if two such crossovers are selected
/// if none are selected, finds the first (one with lowest offset on helix earlier in order in [helices])
-List>? _get_addresses_to_process(AppState state, List helices) {
+List<(Address, Address)>? _get_addresses_to_process(AppState state, List helices) {
var design = state.design;
var selected_crossovers = state.ui_state.selectables_store.selected_crossovers;
var addresses_of_selected_crossovers_by_prev_helix_idx =
_get_addresses_of_selected_crossovers_by_prev_helix_idx(selected_crossovers, helices, design);
- List> addresses = [];
+ List<(Address, Address)> addresses = [];
for (int i = 0; i < helices.length - 1; i++) {
var helix_top = helices[i];
var helix_bot = helices[i + 1];
- var helix_idx_top_bot = Tuple2(helix_top.idx, helix_bot.idx);
+ (int, int) helix_idx_top_bot = (helix_top.idx, helix_bot.idx);
var addresses_crossovers_this_helices_pair =
addresses_of_selected_crossovers_by_prev_helix_idx[helix_idx_top_bot]!;
@@ -115,64 +125,73 @@ Please select only one, or select none to default to the first crossover between
return null;
} else if (addresses_crossovers_this_helices_pair.length == 1) {
// first try selected crossovers between this pair of helices
- address_top = addresses_crossovers_this_helices_pair.first.item1;
- address_bot = addresses_crossovers_this_helices_pair.first.item2;
+ (address_top, address_bot) = addresses_crossovers_this_helices_pair.first;
} else {
// otherwise if none are selected, find the addresses of first crossover between this pair of helices
// using boolean scaffold/staple settings from user to possible ignore one of those types
- Tuple2? address_top_bot;
+ (Address, Address)? address_top_bot;
bool use_scaffold = state.ui_state.default_crossover_type_scaffold_for_setting_helix_rolls;
bool use_staple = state.ui_state.default_crossover_type_staple_for_setting_helix_rolls;
if (!state.design.is_origami) {
use_scaffold = use_staple = true;
}
- address_top_bot = _first_crossover_addresses_between_helices(helix_top, helix_bot, design,
- use_scaffold: use_scaffold, use_staple: use_staple);
+ address_top_bot = _first_crossover_addresses_between_helices(
+ helix_top,
+ helix_bot,
+ design,
+ use_scaffold: use_scaffold,
+ use_staple: use_staple,
+ );
if (address_top_bot == null) {
var msg = 'Must have at least one crossover between helices ${helix_top.idx} and ${helix_bot.idx}';
util.async_alert(msg);
return null;
}
- address_top = address_top_bot.item1;
- address_bot = address_top_bot.item2;
+ (address_top, address_bot) = address_top_bot;
}
- addresses.add(Tuple2(address_top, address_bot));
+ addresses.add((address_top, address_bot));
}
return addresses;
}
// "First" refers to having the lowest offset on helix h1.
-Tuple2? _first_crossover_addresses_between_helices(
- Helix helix_top, Helix helix_bot, Design design,
- {required bool use_scaffold, required bool use_staple}) {
- BuiltList> address_crossovers_on_top =
+(Address, Address)? _first_crossover_addresses_between_helices(
+ Helix helix_top,
+ Helix helix_bot,
+ Design design, {
+ required bool use_scaffold,
+ required bool use_staple,
+}) {
+ BuiltList<(Address, Crossover)> address_crossovers_on_top =
design.address_crossover_pairs_by_helix_idx[helix_top.idx]!;
- BuiltList> address_crossovers_on_bot =
+ BuiltList<(Address, Crossover)> address_crossovers_on_bot =
design.address_crossover_pairs_by_helix_idx[helix_bot.idx]!;
// if not using scaffold or crossovers when finding leftmost, filter those out
if (!use_scaffold) {
- address_crossovers_on_bot = address_crossovers_on_bot
- .where((address_crossover) => !address_crossover.item2.is_scaffold)
- .toBuiltList();
+ address_crossovers_on_bot =
+ address_crossovers_on_bot
+ .where((address_crossover) => !address_crossover.$2.is_scaffold)
+ .toBuiltList();
}
if (!use_staple) {
- address_crossovers_on_bot = address_crossovers_on_bot
- .where((address_crossover) => address_crossover.item2.is_scaffold)
- .toBuiltList();
+ address_crossovers_on_bot =
+ address_crossovers_on_bot
+ .where((address_crossover) => address_crossover.$2.is_scaffold)
+ .toBuiltList();
}
// find first crossover on h1 that also goes to h2
- for (Tuple2 address_crossover_top in address_crossovers_on_top) {
- Crossover crossover_top = address_crossover_top.item2;
+ for ((Address, Crossover) address_crossover_top in address_crossovers_on_top) {
+ Crossover crossover_top = address_crossover_top.$2;
for (var address_crossover_bot in address_crossovers_on_bot) {
- var crossover_bot = address_crossover_bot.item2;
+ var crossover_bot = address_crossover_bot.$2;
if (crossover_bot == crossover_top) {
- Address address_top = address_crossover_top.item1;
- Address address_bot = address_crossover_bot.item1;
- return Tuple2(address_top, address_bot);
+ Address address_top = address_crossover_top.$1;
+ Address address_bot = address_crossover_bot.$1;
+ return (address_top, address_bot);
}
}
}
@@ -191,17 +210,20 @@ Tuple2? _first_crossover_addresses_between_helices(
// (7,5): [... (offset,crossover) pairs between 5 and 7, offset is where crossover touches helix 7]
// }
// Sorts each list by the offset on its first helix (first meaning first in order in helices)
-Map, List>> _get_addresses_of_selected_crossovers_by_prev_helix_idx(
- BuiltSet selected_crossovers, List helices, Design design) {
+Map<(int, int), List<(Address, Address)>> _get_addresses_of_selected_crossovers_by_prev_helix_idx(
+ BuiltSet selected_crossovers,
+ List helices,
+ Design design,
+) {
// this is essentially what we return, but each crossover also carries with it the start offset of
// the helix earlier in the ordering, which helps to sort the lists of crossovers before returning
- Map, List>> addresses_top_bot_crossovers = {};
+ Map<(int, int), List<(Address, Address)>> addresses_top_bot_crossovers = {};
// initialize internal map to have empty lists
for (int i = 0; i < helices.length - 1; i++) {
int idx1 = helices[i].idx;
int idx2 = helices[i + 1].idx;
- var pair_idxs = Tuple2(idx1, idx2);
+ (int, int) pair_idxs = (idx1, idx2);
addresses_top_bot_crossovers[pair_idxs] = [];
}
@@ -215,8 +237,8 @@ Map, List>> _get_addresses_of_selected
var next_dom = strand.substrands[crossover.next_domain_idx] as Domain;
var prev_idx = prev_dom.helix;
var next_idx = next_dom.helix;
- var pair_idxs = Tuple2(prev_idx, next_idx);
- var pair_idxs_rev = Tuple2(next_idx, prev_idx);
+ (int, int) pair_idxs = (prev_idx, next_idx);
+ (int, int) pair_idxs_rev = (next_idx, prev_idx);
if (addresses_top_bot_crossovers.containsKey(pair_idxs) ||
addresses_top_bot_crossovers.containsKey(pair_idxs_rev)) {
@@ -255,7 +277,7 @@ Map, List>> _get_addresses_of_selected
}
var address_top = Address(helix_idx: dom_top.helix, offset: offset_top, forward: dom_top.forward);
var address_bot = Address(helix_idx: dom_bot.helix, offset: offset_bot, forward: dom_bot.forward);
- addresses_top_bot_crossovers[pair_idxs]!.add(Tuple2(address_top, address_bot));
+ addresses_top_bot_crossovers[pair_idxs]!.add((address_top, address_bot));
}
}
@@ -278,8 +300,13 @@ class RollXY {
/// Return list of rolls, same length as [helices], giving the roll that each should be to point
/// each pair of helix backbones at each other through the given [addresses].
/// The first roll is [first_roll].
-List _calculate_rolls_and_positions(Design design, Geometry geometry, List helices,
- List> addresses, double first_roll) {
+List _calculate_rolls_and_positions(
+ Design design,
+ Geometry geometry,
+ List helices,
+ List<(Address, Address)> addresses,
+ double first_roll,
+) {
assert(helices.length == addresses.length + 1);
double x = helices[0].position3d(geometry).z;
@@ -287,8 +314,8 @@ List _calculate_rolls_and_positions(Design design, Geometry geometry, Li
List rollxys = [RollXY(roll: first_roll, x: x, y: y)];
for (int i = 0; i < addresses.length; i++) {
- var address_top = addresses[i].item1;
- var address_bot = addresses[i].item2;
+ var (address_top, address_bot) = addresses[i];
+
var roll = rollxys[i].roll;
var x = rollxys[i].x;
var y = rollxys[i].y;
@@ -323,7 +350,10 @@ List _calculate_rolls_and_positions(Design design, Geometry geometry, Li
}
List set_rolls_and_positions(
- List helices, List rolls_and_positions, Geometry geometry) {
+ List helices,
+ List rolls_and_positions,
+ Geometry geometry,
+) {
List all_actions = [];
for (int i = 0; i < helices.length; i++) {
var helix = helices[i];
@@ -335,5 +365,5 @@ List set_rolls_and_positions(
all_actions.add(pos_action);
}
return all_actions;
-// store.dispatch(actions.BatchAction(all_actions));
+ // store.dispatch(actions.BatchAction(all_actions));
}
diff --git a/lib/src/middleware/helix_grid_change.dart b/lib/src/middleware/helix_grid_change.dart
index d324e9649..67d6622f3 100644
--- a/lib/src/middleware/helix_grid_change.dart
+++ b/lib/src/middleware/helix_grid_change.dart
@@ -19,7 +19,7 @@ helix_grid_offsets_middleware(Store store, dynamic action, NextDispatc
Geometry geometry = group.geometry ?? store.state.design.geometry;
Map new_grid_positions_map = {
for (var helix in store.state.design.helices_in_group(action.group_name).values)
- helix.idx: util.position3d_to_grid_position(helix.position(geometry), action.grid, geometry)
+ helix.idx: util.position3d_to_grid_position(helix.position(geometry), action.grid, geometry),
};
Set new_grid_positions_set = Set.from(new_grid_positions_map.values);
// if lengths don't match, there's a duplicate grid position
diff --git a/lib/src/middleware/helix_group_move_start.dart b/lib/src/middleware/helix_group_move_start.dart
index 8911bef36..eae83302f 100644
--- a/lib/src/middleware/helix_group_move_start.dart
+++ b/lib/src/middleware/helix_group_move_start.dart
@@ -82,9 +82,10 @@ int find_allowable_offset(Design design, DNAEnd end, BuiltSet selected_e
}
int closest_unselected_offset = unselected_end_offsets_to_one_side.reduce(highest ? min : max);
- int num_selected_offsets_between = selected_end_offsets_to_one_side
- .where((o) => highest ? o < closest_unselected_offset : o > closest_unselected_offset)
- .length;
+ int num_selected_offsets_between =
+ selected_end_offsets_to_one_side
+ .where((o) => highest ? o < closest_unselected_offset : o > closest_unselected_offset)
+ .length;
int adjust_factor = highest ? -1 - num_selected_offsets_between : 1 + num_selected_offsets_between;
return closest_unselected_offset + adjust_factor;
diff --git a/lib/src/middleware/helix_hide_all.dart b/lib/src/middleware/helix_hide_all.dart
index 900a48c43..40b8f73bb 100644
--- a/lib/src/middleware/helix_hide_all.dart
+++ b/lib/src/middleware/helix_hide_all.dart
@@ -23,7 +23,8 @@ helix_hide_all_middleware(Store store, dynamic action, NextDispatcher
if (ui_state.only_display_selected_helices &&
ui_state.side_selected_helix_idxs.isEmpty &&
design.helices.isNotEmpty) {
- var msg = 'The option "Display only selected helices" is enabled. '
+ var msg =
+ 'The option "Display only selected helices" is enabled. '
'Since no helices are selected, none will be displayed in the main view.\n\n'
'To display the helices, either select some helices in the side view, or disable the option '
'"View-->Helices-->Display only selected helices".';
diff --git a/lib/src/middleware/helix_idxs_change.dart b/lib/src/middleware/helix_idxs_change.dart
index bd1ac8659..fab56462d 100644
--- a/lib/src/middleware/helix_idxs_change.dart
+++ b/lib/src/middleware/helix_idxs_change.dart
@@ -28,9 +28,12 @@ helix_idxs_change_middleware(Store store, dynamic action, NextDispatch
if (key_to_idxs.length != action.idx_replacements.length) {
var msg = 'You tried to assign existing helices ';
- msg += key_to_idxs.entries.where((element) => element.value.length != 1).map((element) {
- return element.value.join(', ') + " to " + element.key.toString();
- }).join(" and helices ");
+ msg += key_to_idxs.entries
+ .where((element) => element.value.length != 1)
+ .map((element) {
+ return element.value.join(', ') + " to " + element.key.toString();
+ })
+ .join(" and helices ");
msg +=
". Each helix must have a unique new index; make sure all the integers you write are distinct from each other and do not appear elsewhere in the design";
diff --git a/lib/src/middleware/helix_remove.dart b/lib/src/middleware/helix_remove.dart
index cfec873d1..af5b9bff4 100644
--- a/lib/src/middleware/helix_remove.dart
+++ b/lib/src/middleware/helix_remove.dart
@@ -9,9 +9,11 @@ import '../state/app_state.dart';
helix_remove_middleware(Store store, dynamic action, NextDispatcher next) {
if (action is actions.HelixRemove) {
if (store.state.design.domains_on_helix(action.helix_idx).isNotEmpty) {
- var confirm_remove = window.confirm('Helix ${action.helix_idx} has domains on it. '
- 'If you delete the helix, the domains will be removed. '
- 'Are you sure you wish to remove helix ${action.helix_idx}?');
+ var confirm_remove = window.confirm(
+ 'Helix ${action.helix_idx} has domains on it. '
+ 'If you delete the helix, the domains will be removed. '
+ 'Are you sure you wish to remove helix ${action.helix_idx}?',
+ );
if (!confirm_remove) {
return;
}
@@ -30,13 +32,16 @@ helix_remove_middleware(Store store, dynamic action, NextDispatcher ne
if (helix_idx_with_substrands.isNotEmpty) {
var helix_idx_string = helix_idx_with_substrands.join(', ');
- var first_line_string = (helix_idx_with_substrands.length == 1)
- ? 'Selected helix ${helix_idx_string} has domains on it. '
- : 'Selected helices: ${helix_idx_string} have domains on them. ';
+ var first_line_string =
+ (helix_idx_with_substrands.length == 1)
+ ? 'Selected helix ${helix_idx_string} has domains on it. '
+ : 'Selected helices: ${helix_idx_string} have domains on them. ';
- var confirm_remove = window.confirm('${first_line_string}'
- 'If you delete the selected helices, the domains will be removed. '
- 'Are you sure you wish to remove selected helices: ${side_selected_helix_idxs.join(', ')}?');
+ var confirm_remove = window.confirm(
+ '${first_line_string}'
+ 'If you delete the selected helices, the domains will be removed. '
+ 'Are you sure you wish to remove selected helices: ${side_selected_helix_idxs.join(', ')}?',
+ );
if (!confirm_remove) {
return;
}
diff --git a/lib/src/middleware/insertion_deletion_batching.dart b/lib/src/middleware/insertion_deletion_batching.dart
index 8573727f9..39c1f87a7 100644
--- a/lib/src/middleware/insertion_deletion_batching.dart
+++ b/lib/src/middleware/insertion_deletion_batching.dart
@@ -18,7 +18,7 @@ insertion_deletion_batching_middleware(Store store, dynamic action, Ne
next(action);
} else {
var other_actions = [
- for (var other_domain in other_domains) action.clone_for_other_domain(other_domain)
+ for (var other_domain in other_domains) action.clone_for_other_domain(other_domain),
];
var batch_action = actions.BatchAction([action] + other_actions, action.short_description());
store.dispatch(batch_action);
diff --git a/lib/src/middleware/load_file.dart b/lib/src/middleware/load_file.dart
index c5252eb8e..2b757400f 100644
--- a/lib/src/middleware/load_file.dart
+++ b/lib/src/middleware/load_file.dart
@@ -18,14 +18,17 @@ load_file_middleware(Store store, action, NextDispatcher next) {
if (action is actions.PrepareToLoadDNAFile && !action.unit_testing) {
store.dispatch(actions.LoadingDialogShow());
Future.delayed(
- const Duration(milliseconds: 50),
- () => store.dispatch(actions.LoadDNAFile(
- content: action.content,
- filename: action.filename,
- write_local_storage: action.write_local_storage,
- unit_testing: action.unit_testing,
- dna_file_type: action.dna_file_type,
- )));
+ const Duration(milliseconds: 50),
+ () => store.dispatch(
+ actions.LoadDNAFile(
+ content: action.content,
+ filename: action.filename,
+ write_local_storage: action.write_local_storage,
+ unit_testing: action.unit_testing,
+ dna_file_type: action.dna_file_type,
+ ),
+ ),
+ );
} else if (action is actions.LoadDNAFile && !action.unit_testing) {
next(action);
@@ -43,7 +46,10 @@ load_file_middleware(Store store, action, NextDispatcher next) {
store.dispatch(actions.LoadingDialogHide());
if (store.state.maybe_design != null) {
set_selectables_css_style_rules(
- store.state.design, store.state.ui_state.edit_modes, store.state.ui_state.select_mode_state.modes);
+ store.state.design,
+ store.state.ui_state.edit_modes,
+ store.state.ui_state.select_mode_state.modes,
+ );
}
} else {
next(action);
diff --git a/lib/src/middleware/local_storage.dart b/lib/src/middleware/local_storage.dart
index a1ba21dae..6acdd27d9 100644
--- a/lib/src/middleware/local_storage.dart
+++ b/lib/src/middleware/local_storage.dart
@@ -58,7 +58,8 @@ restore(Store store, Storable storable) {
try {
_restore(store, storable);
} catch (e, stackTrace) {
- var error_message = 'ERROR: loading ${storable} from localStorage, encountered this error:'
+ var error_message =
+ 'ERROR: loading ${storable} from localStorage, encountered this error:'
'\n${e.toString()}'
'\n\nstack trace:'
'\n\n${stackTrace}';
@@ -83,27 +84,32 @@ _restore(Store store, Storable storable) {
try {
storables = standard_serializers.deserialize(storable_json_map) as AppUIStateStorables;
} catch (e, stackTrace) {
- print('ERROR: in loading storables from localStorage in order to find loaded_filename for design, '
- 'encountered this error, so a default filename has been chosen:'
- '\n${e.toString()}'
- '\n\nstack trace:'
- '\n\n${stackTrace}');
+ print(
+ 'ERROR: in loading storables from localStorage in order to find loaded_filename for design, '
+ 'encountered this error, so a default filename has been chosen:'
+ '\n${e.toString()}'
+ '\n\nstack trace:'
+ '\n\n${stackTrace}',
+ );
}
action = actions.PrepareToLoadDNAFile(
- content: json_str,
- filename: storables?.loaded_filename ?? 'default_filename.sc',
- write_local_storage: false);
+ content: json_str,
+ filename: storables?.loaded_filename ?? 'default_filename.sc',
+ write_local_storage: false,
+ );
} else if (storable == Storable.app_ui_state_storables) {
var storable_json_map = json.decode(json_str);
AppUIStateStorables storables;
try {
storables = standard_serializers.deserialize(storable_json_map) as AppUIStateStorables;
} catch (e, stackTrace) {
- print('ERROR: in loading storables from localStorage, encountered this error trying to load '
- 'app_ui_state_storables, so using defaults for UI settings:'
- '\n${e.toString()}'
- '\n\nstack trace:'
- '\n\n${stackTrace}');
+ print(
+ 'ERROR: in loading storables from localStorage, encountered this error trying to load '
+ 'app_ui_state_storables, so using defaults for UI settings:'
+ '\n${e.toString()}'
+ '\n\nstack trace:'
+ '\n\n${stackTrace}',
+ );
storables = DEFAULT_AppUIStateStorable;
}
action = actions.SetAppUIStateStorable(storables);
@@ -156,9 +162,11 @@ local_storage_middleware(Store store, dynamic action, NextDispatcher n
action is! actions.HelicesPositionsSetBasedOnCrossovers &&
action is! actions.Undo &&
action is! actions.Redo) {
- print('WARNING: some Action changed the design, so I am writing the Design to localStorage,\n'
- 'but that action is not UndoableAction, LoadDNAFile, Undo, or Redo\n'
- 'action is ${action}');
+ print(
+ 'WARNING: some Action changed the design, so I am writing the Design to localStorage,\n'
+ 'but that action is not UndoableAction, LoadDNAFile, Undo, or Redo\n'
+ 'action is ${action}',
+ );
}
save_storable_async(state_after, Storable.design);
}
diff --git a/lib/src/middleware/oxdna_export.dart b/lib/src/middleware/oxdna_export.dart
index 31db96816..19d74b614 100644
--- a/lib/src/middleware/oxdna_export.dart
+++ b/lib/src/middleware/oxdna_export.dart
@@ -15,7 +15,6 @@ import 'package:scadnano/src/state/grid.dart';
import 'package:scadnano/src/state/loopout.dart';
import 'package:scadnano/src/state/position3d.dart';
import 'package:scadnano/src/state/strand.dart';
-import 'package:tuple/tuple.dart';
import '../state/app_state.dart';
import '../actions/actions.dart' as actions;
import '../state/helix.dart';
@@ -41,9 +40,7 @@ First select some strands, or choose Export🡒oxDNA to export all strands in th
}
if (action is actions.OxdnaExport) {
- Tuple2 dat_top = to_oxdna_format(state.design, strands_to_export);
- String dat = dat_top.item1;
- String top = dat_top.item2;
+ var (dat, top) = to_oxdna_format(state.design, strands_to_export); // (String, String)
String default_filename = state.ui_state.loaded_filename;
String default_filename_dat = path.setExtension(default_filename, '.dat');
@@ -100,7 +97,7 @@ String to_oxview_format(Design design, List strands_to_export) {
'class': 'NucleicAcidStrand',
'end5': nuc_count,
'end3': nuc_count + system.strands[i].nucleotides.length,
- 'monomers': oxvnucs
+ 'monomers': oxvnucs,
};
oxview_strand_map[sc_strand.id] = oxv_strand;
@@ -133,7 +130,8 @@ String to_oxview_format(Design design, List strands_to_export) {
}
if (strand_names_without_dna.isNotEmpty) {
- var msg = 'The following strands do not have complete DNA sequences assigned: '
+ var msg =
+ 'The following strands do not have complete DNA sequences assigned: '
'${strand_names_without_dna.join(", ")}. '
'These strands will be exported with a default sequence of "T" '
'for each nucleotide whose base is not specified. '
@@ -143,15 +141,17 @@ String to_oxview_format(Design design, List strands_to_export) {
}
//TODO: this hasn't been tested well
- var base_pairs_map =
- design.base_pairs_with_domain_strand(false, true, strands_to_export.toSet().build(), true);
+ var base_pairs_map = design.base_pairs_with_domain_strand(
+ false,
+ true,
+ strands_to_export.toSet().build(),
+ true,
+ );
for (int helix in base_pairs_map.keys) {
for (var offset_dom_strands in base_pairs_map[helix]!) {
- int offset = offset_dom_strands.item1;
- Domain domain1 = offset_dom_strands.item2;
- Domain domain2 = offset_dom_strands.item3;
- Strand sc_strand1 = offset_dom_strands.item4;
- Strand sc_strand2 = offset_dom_strands.item5;
+ // (int, Domain, Domain, Strand, Strand)
+ var (offset, domain1, domain2, sc_strand1, sc_strand2) = offset_dom_strands;
+
Map oxv_strand1 = oxview_strand_map[sc_strand1.id];
Map oxv_strand2 = oxview_strand_map[sc_strand2.id];
int d1 = sc_strand1.domain_offset_to_strand_dna_idx(domain1, offset, false);
@@ -161,8 +161,10 @@ String to_oxview_format(Design design, List strands_to_export) {
oxv_strand1['monomers'][d1]['bp'] = s2_nuc_idx + d2;
if (oxv_strand2['monomers'][d2].containsKey('bp')) {
if (oxv_strand2['monomers'][d2]['bp'] != s1_nuc_idx + d1) {
- print('${s2_nuc_idx + d2} ${s1_nuc_idx + d1} '
- '${oxv_strand2['monomers'][d2]['bp']} ${domain1} ${domain2}');
+ print(
+ '${s2_nuc_idx + d2} ${s1_nuc_idx + d1} '
+ '${oxv_strand2['monomers'][d2]['bp']} ${domain1} ${domain2}',
+ );
window.alert("You have found a bug in scadnano, please file a bug report.");
}
}
@@ -175,7 +177,7 @@ String to_oxview_format(Design design, List strands_to_export) {
'box': [b.x, b.y, b.z],
'date': DateTime.now().toIso8601String(),
'systems': [
- {'id': 0, 'strands': oxview_strands}
+ {'id': 0, 'strands': oxview_strands},
],
'forces': [],
'selections': [],
@@ -188,10 +190,9 @@ String to_oxview_format(Design design, List strands_to_export) {
return content;
}
-Tuple2 to_oxdna_format(Design design, [List? strands_to_export = null]) {
+(String, String) to_oxdna_format(Design design, [List? strands_to_export = null]) {
OxdnaSystem system = convert_design_to_oxdna_system(design, strands_to_export);
- Tuple2 dat_top = system.oxdna_output();
- return dat_top;
+ return system.oxdna_output();
}
class OxdnaVector {
@@ -313,14 +314,10 @@ class OxdnaSystem {
}
}
- Tuple2 oxdna_output() {
+ (String, String) oxdna_output() {
OxdnaVector bbox = compute_bounding_box();
- List dat_list = [
- 't = 0',
- 'b = ${bbox.x} ${bbox.y} ${bbox.z}',
- 'E = 0 0 0',
- ];
+ List dat_list = ['t = 0', 'b = ${bbox.x} ${bbox.y} ${bbox.z}', 'E = 0 0 0'];
List top_list = [];
int nuc_count = 0;
@@ -340,11 +337,13 @@ class OxdnaSystem {
nuc_index += 1;
top_list.add('${strand_count} ${nuc.base} ${n3} ${n5}');
- dat_list.add('${nuc.r.x} ${nuc.r.y} ${nuc.r.z} ' +
- '${nuc.b.x} ${nuc.b.y} ${nuc.b.z} ' +
- '${nuc.n.x} ${nuc.n.y} ${nuc.n.z} ' +
- '${nuc.v.x} ${nuc.v.y} ${nuc.v.z} ' +
- '${nuc.L.x} ${nuc.L.y} ${nuc.L.z}');
+ dat_list.add(
+ '${nuc.r.x} ${nuc.r.y} ${nuc.r.z} ' +
+ '${nuc.b.x} ${nuc.b.y} ${nuc.b.z} ' +
+ '${nuc.n.x} ${nuc.n.y} ${nuc.n.z} ' +
+ '${nuc.v.x} ${nuc.v.y} ${nuc.v.z} ' +
+ '${nuc.L.x} ${nuc.L.y} ${nuc.L.z}',
+ );
}
}
@@ -353,14 +352,14 @@ class OxdnaSystem {
top = '${nuc_count} ${strand_count}\n' + top;
- return Tuple2(dat, top);
+ return (dat, top);
}
}
const NM_TO_OX_UNITS = 1.0 / 0.8518;
// returns the origin, forward, and normal vectors of a helix
-Tuple3 oxdna_get_helix_vectors(Design design, Helix helix) {
+(OxdnaVector, OxdnaVector, OxdnaVector) oxdna_get_helix_vectors(Design design, Helix helix) {
/*
TODO: document functions/methods with docstrings
:param helix:
@@ -412,15 +411,16 @@ Tuple3 oxdna_get_helix_vectors(Design des
position_in_helix_group = util.grid_position_to_position3d(helix.grid_position!, grid, geometry);
}
- var position_in_helix_group_rotated = ((pitch_axis * position_in_helix_group.x) +
- (yaw_axis * position_in_helix_group.y) +
- (roll_axis * position_in_helix_group.z));
+ var position_in_helix_group_rotated =
+ ((pitch_axis * position_in_helix_group.x) +
+ (yaw_axis * position_in_helix_group.y) +
+ (roll_axis * position_in_helix_group.z));
var helix_group_offset = OxdnaVector(group.position.x, group.position.y, group.position.z);
var origin = (position_in_helix_group_rotated + helix_group_offset) * NM_TO_OX_UNITS;
- return Tuple3(origin, forward, normal);
+ return (origin, forward, normal);
}
OxdnaSystem convert_design_to_oxdna_system(Design design, [List? strands_to_export = null]) {
@@ -462,11 +462,11 @@ OxdnaSystem convert_design_to_oxdna_system(Design design, [List? strands
// for efficiency just calculate each helix's vector once
var helix_vectors = {
for (var idx_helix in design.helices.entries)
- idx_helix.key: oxdna_get_helix_vectors(design, idx_helix.value)
+ idx_helix.key: oxdna_get_helix_vectors(design, idx_helix.value),
};
for (var strand in strands_to_export) {
- List> strand_domains = [];
+ List<(OxdnaStrand, bool)> strand_domains = [];
for (int ss_idx = 0; ss_idx < strand.substrands.length; ss_idx++) {
var domain = strand.substrands[ss_idx];
var ox_strand = OxdnaStrand();
@@ -481,10 +481,7 @@ OxdnaSystem convert_design_to_oxdna_system(Design design, [List? strands
var group = design.groups[helix.group]!;
var geometry = group.geometry ?? design.geometry;
var step_rot = -360 / geometry.bases_per_turn;
- var origin_forward_normal = helix_vectors[helix.idx]!;
- var origin = origin_forward_normal.item1;
- var forward = origin_forward_normal.item2;
- var normal = origin_forward_normal.item3;
+ var (origin, forward, normal) = helix_vectors[helix.idx]!; // (OxdnaVector, OxdnaVector, OxdnaVector)
if (!domain.forward) {
normal = normal.rotate(-geometry.minor_groove_angle, forward);
@@ -515,7 +512,8 @@ OxdnaSystem convert_design_to_oxdna_system(Design design, [List? strands
if (insertions.containsKey(offset)) {
int num = insertions[offset]!;
for (int i = 0; i < num; i++) {
- var cen = origin +
+ var cen =
+ origin +
forward * (offset + mod - num + i) * geometry.rise_per_base_pair * NM_TO_OX_UNITS;
var norm = normal.rotate(step_rot * (offset + mod - num + i), forward);
var forw = domain.forward ? -forward : forward;
@@ -538,7 +536,7 @@ OxdnaSystem convert_design_to_oxdna_system(Design design, [List? strands
if (!domain.forward) {
ox_strand.nucleotides = List