Skip to content

Commit c79287a

Browse files
authored
Merge pull request #972 from UC-Davis-molecular-computing/dev
Dev
2 parents af78cb4 + c8e5792 commit c79287a

38 files changed

+1148
-159
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# scadnano
22

33
[scadnano](http://scadnano.org)
4-
("
5-
scriptable-cadnano", [source code repository here](https://github.com/UC-Davis-molecular-computing/scadnano))
4+
("scriptable-cadnano", [source code repository here](https://github.com/UC-Davis-molecular-computing/scadnano))
65
is a program for designing synthetic DNA structures such as DNA origami.
76
The scadnano project is developed and maintained by the UC Davis Molecular Computing group.
87
Note that [cadnano](https://cadnano.org) is a separate project, developed and maintained by

lib/src/actions/actions.dart

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,9 +1571,13 @@ abstract class SelectAllWithSameAsSelected
15711571

15721572
BuiltList<SelectableTrait> get traits;
15731573

1574+
bool get exclude_scaffolds;
1575+
15741576
/************************ begin BuiltValue boilerplate ************************/
1575-
factory SelectAllWithSameAsSelected({BuiltList<Selectable> templates, BuiltList<SelectableTrait> traits}) =
1576-
_$SelectAllWithSameAsSelected._;
1577+
factory SelectAllWithSameAsSelected(
1578+
{BuiltList<Selectable> templates,
1579+
BuiltList<SelectableTrait> traits,
1580+
bool exclude_scaffolds}) = _$SelectAllWithSameAsSelected._;
15771581

15781582
SelectAllWithSameAsSelected._();
15791583

@@ -2076,6 +2080,8 @@ abstract class ExportDNA with BuiltJsonSerializable implements Action, Built<Exp
20762080

20772081
bool get include_only_selected_strands;
20782082

2083+
bool get exclude_selected_strands;
2084+
20792085
ExportDNAFormat get export_dna_format;
20802086

20812087
@nullable
@@ -2093,16 +2099,19 @@ abstract class ExportDNA with BuiltJsonSerializable implements Action, Built<Exp
20932099
factory ExportDNA({
20942100
bool include_scaffold,
20952101
bool include_only_selected_strands,
2102+
bool exclude_selected_strands,
20962103
ExportDNAFormat export_dna_format,
20972104
String delimiter,
20982105
String domain_delimiter,
20992106
StrandOrder strand_order = null,
21002107
bool column_major_strand = true,
21012108
bool column_major_plate = true,
21022109
}) {
2110+
assert(!(include_only_selected_strands && exclude_selected_strands));
21032111
return ExportDNA.from((b) => b
21042112
..include_scaffold = include_scaffold
21052113
..include_only_selected_strands = include_only_selected_strands
2114+
..exclude_selected_strands = exclude_selected_strands
21062115
..export_dna_format = export_dna_format
21072116
..delimiter = delimiter
21082117
..domain_delimiter = domain_delimiter
@@ -2153,6 +2162,27 @@ abstract class ExportSvg with BuiltJsonSerializable implements Action, Built<Exp
21532162
ExportSvgType get type;
21542163
}
21552164

2165+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
2166+
// Export every text in a DNA sequence separately
2167+
2168+
abstract class ExportSvgTextSeparatelySet
2169+
with BuiltJsonSerializable
2170+
implements Action, Built<ExportSvgTextSeparatelySet, ExportSvgTextSeparatelySetBuilder> {
2171+
bool get export_svg_text_separately;
2172+
2173+
/************************ begin BuiltValue boilerplate ************************/
2174+
factory ExportSvgTextSeparatelySet(bool export_svg_text_separately) =>
2175+
ExportSvgTextSeparatelySet.from((b) => b..export_svg_text_separately = export_svg_text_separately);
2176+
2177+
/************************ begin BuiltValue boilerplate ************************/
2178+
factory ExportSvgTextSeparatelySet.from([void Function(ExportSvgTextSeparatelySetBuilder) updates]) =
2179+
_$ExportSvgTextSeparatelySet;
2180+
2181+
ExportSvgTextSeparatelySet._();
2182+
2183+
static Serializer<ExportSvgTextSeparatelySet> get serializer => _$exportSvgTextSeparatelySetSerializer;
2184+
}
2185+
21562186
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
21572187
// Strand part action
21582188

@@ -3981,6 +4011,22 @@ abstract class ExampleDesignsLoad
39814011
static Serializer<ExampleDesignsLoad> get serializer => _$exampleDesignsLoadSerializer;
39824012
}
39834013

4014+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
4015+
// pair lines display
4016+
4017+
abstract class BasePairTypeSet
4018+
with BuiltJsonSerializable
4019+
implements Action, Built<BasePairTypeSet, BasePairTypeSetBuilder> {
4020+
int get selected_idx;
4021+
4022+
/************************ begin BuiltValue boilerplate ************************/
4023+
factory BasePairTypeSet({int selected_idx}) = _$BasePairTypeSet._;
4024+
4025+
BasePairTypeSet._();
4026+
4027+
static Serializer<BasePairTypeSet> get serializer => _$basePairTypeSetSerializer;
4028+
}
4029+
39844030
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
39854031
// change helix position
39864032

@@ -4348,6 +4394,25 @@ abstract class DisablePngCachingDnaSequencesSet
43484394
_$disablePngCachingDnaSequencesSetSerializer;
43494395
}
43504396

4397+
abstract class RetainStrandColorOnSelectionSet
4398+
with BuiltJsonSerializable
4399+
implements Action, Built<RetainStrandColorOnSelectionSet, RetainStrandColorOnSelectionSetBuilder> {
4400+
bool get retain_strand_color_on_selection;
4401+
4402+
/************************ begin BuiltValue boilerplate ************************/
4403+
factory RetainStrandColorOnSelectionSet(bool retain_strand_color_on_selection) =>
4404+
RetainStrandColorOnSelectionSet.from(
4405+
(b) => b..retain_strand_color_on_selection = retain_strand_color_on_selection);
4406+
4407+
factory RetainStrandColorOnSelectionSet.from(
4408+
[void Function(RetainStrandColorOnSelectionSetBuilder) updates]) = _$RetainStrandColorOnSelectionSet;
4409+
4410+
RetainStrandColorOnSelectionSet._();
4411+
4412+
static Serializer<RetainStrandColorOnSelectionSet> get serializer =>
4413+
_$retainStrandColorOnSelectionSetSerializer;
4414+
}
4415+
43514416
abstract class DisplayReverseDNARightSideUpSet
43524417
with BuiltJsonSerializable
43534418
implements Action, Built<DisplayReverseDNARightSideUpSet, DisplayReverseDNARightSideUpSetBuilder> {
@@ -4458,3 +4523,40 @@ abstract class OxdnaExport
44584523
@memoized
44594524
int get hashCode;
44604525
}
4526+
4527+
abstract class OxviewExport
4528+
with BuiltJsonSerializable
4529+
implements Action, Built<OxviewExport, OxviewExportBuilder> {
4530+
bool get selected_strands_only;
4531+
4532+
/************************ begin BuiltValue boilerplate ************************/
4533+
factory OxviewExport({bool selected_strands_only = false}) {
4534+
return OxviewExport.from((b) => b..selected_strands_only = selected_strands_only);
4535+
}
4536+
4537+
OxviewExport._();
4538+
4539+
factory OxviewExport.from([void Function(OxviewExportBuilder) updates]) = _$OxviewExport;
4540+
4541+
static Serializer<OxviewExport> get serializer => _$oxviewExportSerializer;
4542+
4543+
@memoized
4544+
int get hashCode;
4545+
}
4546+
4547+
abstract class OxExportOnlySelectedStrandsSet
4548+
with BuiltJsonSerializable
4549+
implements Action, Built<OxExportOnlySelectedStrandsSet, OxExportOnlySelectedStrandsSetBuilder> {
4550+
bool get only_selected;
4551+
4552+
/************************ begin BuiltValue boilerplate ************************/
4553+
factory OxExportOnlySelectedStrandsSet({bool only_selected}) = _$OxExportOnlySelectedStrandsSet._;
4554+
4555+
OxExportOnlySelectedStrandsSet._();
4556+
4557+
static Serializer<OxExportOnlySelectedStrandsSet> get serializer =>
4558+
_$oxExportOnlySelectedStrandsSetSerializer;
4559+
4560+
@memoized
4561+
int get hashCode;
4562+
}

lib/src/constants.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import 'state/grid.dart';
88

99
// WARNING: Do not modify line below, except for the version string
1010
// (and also add new version string to scadnano_versions_to_link).
11-
const String CURRENT_VERSION = "0.19.1";
11+
const String CURRENT_VERSION = "0.19.2";
1212
const String INITIAL_VERSION = "0.1.0";
1313

1414
// scadnano versions that we deploy so that older versions can be used.
1515
final scadnano_older_versions_to_link = [
16-
"0.19.0",
16+
"0.19.1",
1717
"0.18.10",
1818
"0.17.14",
1919
// "0.17.13",
@@ -428,8 +428,10 @@ const css_selector_scaffold = 'scaffold';
428428
const css_selector_staple = 'staple';
429429
const css_selector_domain = 'domain-line';
430430
const css_selector_base_pair_line = 'base-pair-line';
431+
const css_selector_base_pair_rect = 'base-pair-rect';
431432
const css_selector_extension = 'extension-line';
432433
const css_selector_crossover = 'crossover-curve';
434+
const css_selector_crossover_same_helix = 'crossover-curve-same-helix';
433435
const css_selector_loopout = 'loopout-curve';
434436
const css_selector_end_5p_strand = 'five-prime-end-first-substrand';
435437
const css_selector_end_3p_strand = 'three-prime-end-last-substrand';
@@ -465,6 +467,7 @@ const css_selector_deletion = 'deletion-cross';
465467
const css_selector_insertion_group = 'insertion-group';
466468
const css_selector_deletion_group = 'deletion-group';
467469
const css_selector_selected = 'selected';
470+
const css_selector_selected_pink = 'selected-pink';
468471

469472
const css_selector_context_menu_item_disabled = 'context_menu_item_disabled';
470473

lib/src/middleware/export_dna_sequences.dart

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export_dna_sequences_middleware(Store<AppState> store, action, NextDispatcher ne
4545
List<Strand> strands;
4646
if (action.include_only_selected_strands) {
4747
strands = state.ui_state.selectables_store.selected_strands.toList();
48+
} else if (action.exclude_selected_strands) {
49+
strands = state.design.strands.toList();
50+
for (var strand in state.ui_state.selectables_store.selected_strands) {
51+
strands.remove(strand);
52+
}
4853
} else {
4954
strands = state.design.strands.toList();
5055
}
@@ -107,15 +112,16 @@ Future<void> export_dna() async {
107112

108113
int idx_include_scaffold = 0;
109114
int idx_include_only_selected_strands = 1;
110-
int idx_format_str = 2;
111-
int idx_delimiter = 3;
112-
int idx_domain_delimiter = 4;
113-
int idx_column_major_plate = 5;
114-
int idx_sort = 6;
115-
int idx_column_major_strand = 7;
116-
int idx_strand_order_str = 8;
115+
int idx_exclude_selected_strands = 2;
116+
int idx_format_str = 3;
117+
int idx_delimiter = 4;
118+
int idx_domain_delimiter = 5;
119+
int idx_column_major_plate = 6;
120+
int idx_sort = 7;
121+
int idx_column_major_strand = 8;
122+
int idx_strand_order_str = 9;
117123

118-
List<DialogItem> items = List<DialogItem>.filled(9, null);
124+
List<DialogItem> items = List<DialogItem>.filled(idx_strand_order_str + 1, null);
119125

120126
items[idx_delimiter] = DialogText(label: 'delimiter between IDT fields', value: ',', tooltip: '''\
121127
Delimiter to separate IDT fields in a "bulk input" text file, for instance if set to ";", then a line
@@ -132,6 +138,7 @@ if it had three domains each of length 5.''');
132138
items[idx_include_scaffold] = DialogCheckbox(label: 'include scaffold', value: false);
133139
items[idx_include_only_selected_strands] =
134140
DialogCheckbox(label: 'include only selected strands', value: false);
141+
items[idx_exclude_selected_strands] = DialogCheckbox(label: 'exclude selected strands', value: false);
135142
items[idx_format_str] = DialogRadio(
136143
label: 'export format',
137144
options: export_options,
@@ -178,6 +185,10 @@ which part of the strand to use as the address.
178185
title: 'export DNA sequences',
179186
type: DialogType.export_dna_sequences,
180187
items: items,
188+
disable_when_any_checkboxes_on: {
189+
idx_include_only_selected_strands: [idx_exclude_selected_strands],
190+
idx_exclude_selected_strands: [idx_include_only_selected_strands],
191+
},
181192
disable_when_any_checkboxes_off: {
182193
idx_column_major_strand: [idx_sort],
183194
idx_strand_order_str: [idx_sort],
@@ -199,6 +210,7 @@ which part of the strand to use as the address.
199210

200211
bool include_scaffold = (results[idx_include_scaffold] as DialogCheckbox).value;
201212
bool include_only_selected_strands = (results[idx_include_only_selected_strands] as DialogCheckbox).value;
213+
bool exclude_selected_strands = (results[idx_exclude_selected_strands] as DialogCheckbox).value;
202214
String format_str = (results[idx_format_str] as DialogRadio).value;
203215
bool sort = (results[idx_sort] as DialogCheckbox).value;
204216
StrandOrder strand_order = null;
@@ -213,9 +225,12 @@ which part of the strand to use as the address.
213225
String delimiter = (results[idx_delimiter] as DialogText).value;
214226
String domain_delimiter = (results[idx_domain_delimiter] as DialogText).value;
215227

228+
assert(!(include_only_selected_strands && exclude_selected_strands));
229+
216230
app.dispatch(actions.ExportDNA(
217231
include_scaffold: include_scaffold,
218232
include_only_selected_strands: include_only_selected_strands,
233+
exclude_selected_strands: exclude_selected_strands,
219234
export_dna_format: format,
220235
delimiter: delimiter,
221236
domain_delimiter: domain_delimiter,

0 commit comments

Comments
 (0)