benchling-api-client 2.0.416__py3-none-any.whl → 2.0.418__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. benchling_api_client/models/aa_sequence.py +1 -1
  2. benchling_api_client/models/aa_sequence_with_entity_type.py +1 -1
  3. benchling_api_client/models/back_translate.py +85 -1
  4. benchling_api_client/models/back_translate_gc_content_range.py +98 -0
  5. benchling_api_client/models/back_translate_method.py +21 -0
  6. benchling_api_client/models/optimize_codons.py +85 -1
  7. benchling_api_client/models/optimize_codons_gc_content_range.py +98 -0
  8. benchling_api_client/models/optimize_codons_method.py +21 -0
  9. benchling_api_client/models/reduced_pattern.py +3 -1
  10. benchling_api_client/v2/alpha/models/benchling_app_manifest_feature_canvas_locations.py +1 -0
  11. benchling_api_client/v2/alpha/openapi.yaml +3 -2
  12. benchling_api_client/v2/beta/models/aa_sequence.py +1 -1
  13. benchling_api_client/v2/beta/models/aa_sequence_with_entity_type.py +1 -1
  14. benchling_api_client/v2/beta/models/benchling_app_manifest_feature_canvas_locations.py +1 -0
  15. benchling_api_client/v2/beta/openapi.yaml +4 -3
  16. benchling_api_client/v2/stable/models/aa_sequence.py +1 -1
  17. benchling_api_client/v2/stable/models/aa_sequence_with_entity_type.py +1 -1
  18. benchling_api_client/v2/stable/models/back_translate.py +85 -1
  19. benchling_api_client/v2/stable/models/back_translate_gc_content_range.py +98 -0
  20. benchling_api_client/v2/stable/models/back_translate_method.py +21 -0
  21. benchling_api_client/v2/stable/models/optimize_codons.py +85 -1
  22. benchling_api_client/v2/stable/models/optimize_codons_gc_content_range.py +98 -0
  23. benchling_api_client/v2/stable/models/optimize_codons_method.py +21 -0
  24. benchling_api_client/v2/stable/models/reduced_pattern.py +3 -1
  25. benchling_api_client/v2/stable/openapi.yaml +81 -14
  26. {benchling_api_client-2.0.416.dist-info → benchling_api_client-2.0.418.dist-info}/METADATA +1 -1
  27. {benchling_api_client-2.0.416.dist-info → benchling_api_client-2.0.418.dist-info}/RECORD +29 -21
  28. {benchling_api_client-2.0.416.dist-info → benchling_api_client-2.0.418.dist-info}/LICENSE +0 -0
  29. {benchling_api_client-2.0.416.dist-info → benchling_api_client-2.0.418.dist-info}/WHEEL +0 -0
@@ -2839,7 +2839,7 @@ components:
2839
2839
  description: The path of the web URL, omitting the tenant domain
2840
2840
  type: string
2841
2841
  webURL:
2842
- description: URL of the protein.
2842
+ description: URL of the AA sequence.
2843
2843
  example: https://benchling.com/benchling/f/lib_55UxcIps-registry/prtn_7nMBOMm0-kedchain11/edit"
2844
2844
  format: uri
2845
2845
  readOnly: true
@@ -3414,6 +3414,7 @@ components:
3414
3414
  enum:
3415
3415
  - ENTRY
3416
3416
  - ENTRY_TEMPLATE
3417
+ - APP_HOME
3417
3418
  type: string
3418
3419
  BoxCreationTableNotePart:
3419
3420
  allOf:
@@ -7894,8 +7895,8 @@ tags:
7894
7895
  assigned to access an item.
7895
7896
  name: Collaborations
7896
7897
  - description: 'Benchling supports custom entities for biological entities that are
7897
- neither sequences or proteins. Custom entities must have an entity schema set
7898
- and can have both schema fields and custom fields.
7898
+ neither DNA, RNA, nor AA sequences. Custom entities must have an entity schema
7899
+ set and can have both schema fields and custom fields.
7899
7900
 
7900
7901
  '
7901
7902
  name: Custom Entities
@@ -809,7 +809,7 @@ class AaSequence:
809
809
 
810
810
  @property
811
811
  def web_url(self) -> str:
812
- """ URL of the protein. """
812
+ """ URL of the AA sequence. """
813
813
  if isinstance(self._web_url, Unset):
814
814
  raise NotPresentError(self, "web_url")
815
815
  return self._web_url
@@ -851,7 +851,7 @@ class AaSequenceWithEntityType:
851
851
 
852
852
  @property
853
853
  def web_url(self) -> str:
854
- """ URL of the protein. """
854
+ """ URL of the AA sequence. """
855
855
  if isinstance(self._web_url, Unset):
856
856
  raise NotPresentError(self, "web_url")
857
857
  return self._web_url
@@ -4,7 +4,9 @@ import attr
4
4
 
5
5
  from ..extensions import NotPresentError
6
6
  from ..models.back_translate_gc_content import BackTranslateGcContent
7
+ from ..models.back_translate_gc_content_range import BackTranslateGcContentRange
7
8
  from ..models.back_translate_hairpin_parameters import BackTranslateHairpinParameters
9
+ from ..models.back_translate_method import BackTranslateMethod
8
10
  from ..models.reduced_pattern import ReducedPattern
9
11
  from ..types import UNSET, Unset
10
12
 
@@ -20,7 +22,9 @@ class BackTranslate:
20
22
  _avoided_cutsite_enzyme_ids: Union[Unset, List[str]] = UNSET
21
23
  _codon_usage_table_id: Union[Unset, str] = UNSET
22
24
  _gc_content: Union[Unset, BackTranslateGcContent] = BackTranslateGcContent.ANY
25
+ _gc_content_range: Union[Unset, BackTranslateGcContentRange] = UNSET
23
26
  _hairpin_parameters: Union[Unset, BackTranslateHairpinParameters] = UNSET
27
+ _method: Union[Unset, BackTranslateMethod] = BackTranslateMethod.MATCH_CODON_USAGE
24
28
  _reduced_patterns: Union[Unset, List[ReducedPattern]] = UNSET
25
29
  _schema_id: Union[Unset, str] = UNSET
26
30
  _should_deplete_uridine: Union[Unset, bool] = False
@@ -32,7 +36,9 @@ class BackTranslate:
32
36
  fields.append("avoided_cutsite_enzyme_ids={}".format(repr(self._avoided_cutsite_enzyme_ids)))
33
37
  fields.append("codon_usage_table_id={}".format(repr(self._codon_usage_table_id)))
34
38
  fields.append("gc_content={}".format(repr(self._gc_content)))
39
+ fields.append("gc_content_range={}".format(repr(self._gc_content_range)))
35
40
  fields.append("hairpin_parameters={}".format(repr(self._hairpin_parameters)))
41
+ fields.append("method={}".format(repr(self._method)))
36
42
  fields.append("reduced_patterns={}".format(repr(self._reduced_patterns)))
37
43
  fields.append("schema_id={}".format(repr(self._schema_id)))
38
44
  fields.append("should_deplete_uridine={}".format(repr(self._should_deplete_uridine)))
@@ -51,10 +57,18 @@ class BackTranslate:
51
57
  if not isinstance(self._gc_content, Unset):
52
58
  gc_content = self._gc_content.value
53
59
 
60
+ gc_content_range: Union[Unset, Dict[str, Any]] = UNSET
61
+ if not isinstance(self._gc_content_range, Unset):
62
+ gc_content_range = self._gc_content_range.to_dict()
63
+
54
64
  hairpin_parameters: Union[Unset, Dict[str, Any]] = UNSET
55
65
  if not isinstance(self._hairpin_parameters, Unset):
56
66
  hairpin_parameters = self._hairpin_parameters.to_dict()
57
67
 
68
+ method: Union[Unset, int] = UNSET
69
+ if not isinstance(self._method, Unset):
70
+ method = self._method.value
71
+
58
72
  reduced_patterns: Union[Unset, List[Any]] = UNSET
59
73
  if not isinstance(self._reduced_patterns, Unset):
60
74
  reduced_patterns = []
@@ -78,8 +92,12 @@ class BackTranslate:
78
92
  field_dict["codonUsageTableId"] = codon_usage_table_id
79
93
  if gc_content is not UNSET:
80
94
  field_dict["gcContent"] = gc_content
95
+ if gc_content_range is not UNSET:
96
+ field_dict["gcContentRange"] = gc_content_range
81
97
  if hairpin_parameters is not UNSET:
82
98
  field_dict["hairpinParameters"] = hairpin_parameters
99
+ if method is not UNSET:
100
+ field_dict["method"] = method
83
101
  if reduced_patterns is not UNSET:
84
102
  field_dict["reducedPatterns"] = reduced_patterns
85
103
  if schema_id is not UNSET:
@@ -157,6 +175,22 @@ class BackTranslate:
157
175
  raise
158
176
  gc_content = cast(Union[Unset, BackTranslateGcContent], UNSET)
159
177
 
178
+ def get_gc_content_range() -> Union[Unset, BackTranslateGcContentRange]:
179
+ gc_content_range: Union[Unset, Union[Unset, BackTranslateGcContentRange]] = UNSET
180
+ _gc_content_range = d.pop("gcContentRange")
181
+
182
+ if not isinstance(_gc_content_range, Unset):
183
+ gc_content_range = BackTranslateGcContentRange.from_dict(_gc_content_range)
184
+
185
+ return gc_content_range
186
+
187
+ try:
188
+ gc_content_range = get_gc_content_range()
189
+ except KeyError:
190
+ if strict:
191
+ raise
192
+ gc_content_range = cast(Union[Unset, BackTranslateGcContentRange], UNSET)
193
+
160
194
  def get_hairpin_parameters() -> Union[Unset, BackTranslateHairpinParameters]:
161
195
  hairpin_parameters: Union[Unset, Union[Unset, BackTranslateHairpinParameters]] = UNSET
162
196
  _hairpin_parameters = d.pop("hairpinParameters")
@@ -173,6 +207,24 @@ class BackTranslate:
173
207
  raise
174
208
  hairpin_parameters = cast(Union[Unset, BackTranslateHairpinParameters], UNSET)
175
209
 
210
+ def get_method() -> Union[Unset, BackTranslateMethod]:
211
+ method = UNSET
212
+ _method = d.pop("method")
213
+ if _method is not None and _method is not UNSET:
214
+ try:
215
+ method = BackTranslateMethod(_method)
216
+ except ValueError:
217
+ method = BackTranslateMethod.of_unknown(_method)
218
+
219
+ return method
220
+
221
+ try:
222
+ method = get_method()
223
+ except KeyError:
224
+ if strict:
225
+ raise
226
+ method = cast(Union[Unset, BackTranslateMethod], UNSET)
227
+
176
228
  def get_reduced_patterns() -> Union[Unset, List[ReducedPattern]]:
177
229
  reduced_patterns = []
178
230
  _reduced_patterns = d.pop("reducedPatterns")
@@ -218,7 +270,9 @@ class BackTranslate:
218
270
  avoided_cutsite_enzyme_ids=avoided_cutsite_enzyme_ids,
219
271
  codon_usage_table_id=codon_usage_table_id,
220
272
  gc_content=gc_content,
273
+ gc_content_range=gc_content_range,
221
274
  hairpin_parameters=hairpin_parameters,
275
+ method=method,
222
276
  reduced_patterns=reduced_patterns,
223
277
  schema_id=schema_id,
224
278
  should_deplete_uridine=should_deplete_uridine,
@@ -280,7 +334,7 @@ class BackTranslate:
280
334
 
281
335
  @property
282
336
  def gc_content(self) -> BackTranslateGcContent:
283
- """The amount of GC content in the back-translated sequence. If not specified, the back-translation will default to ANY (0-1). LOW is defined as below 0.33, MEDIUM as 0.33-0.66, and HIGH as above 0.66."""
337
+ """The amount of GC content in the optimized sequence. LOW is defined as below 0.33, MEDIUM as 0.33-0.66, and HIGH as above 0.66. If neither gcContent nor gcContentRange is specified, the optimization will default to ANY (0-1). Cannot be specified together with gcContentRange."""
284
338
  if isinstance(self._gc_content, Unset):
285
339
  raise NotPresentError(self, "gc_content")
286
340
  return self._gc_content
@@ -293,6 +347,21 @@ class BackTranslate:
293
347
  def gc_content(self) -> None:
294
348
  self._gc_content = UNSET
295
349
 
350
+ @property
351
+ def gc_content_range(self) -> BackTranslateGcContentRange:
352
+ """Custom GC content range for the optimized sequence, specified as decimal values between 0 and 1. The maximum must be greater than the minimum. Cannot be specified together with gcContent."""
353
+ if isinstance(self._gc_content_range, Unset):
354
+ raise NotPresentError(self, "gc_content_range")
355
+ return self._gc_content_range
356
+
357
+ @gc_content_range.setter
358
+ def gc_content_range(self, value: BackTranslateGcContentRange) -> None:
359
+ self._gc_content_range = value
360
+
361
+ @gc_content_range.deleter
362
+ def gc_content_range(self) -> None:
363
+ self._gc_content_range = UNSET
364
+
296
365
  @property
297
366
  def hairpin_parameters(self) -> BackTranslateHairpinParameters:
298
367
  """These parameters are applied in the AvoidHairpins specification in DNAChisel. If hairpinParameters is not specified, hairpins will not be avoided."""
@@ -308,6 +377,21 @@ class BackTranslate:
308
377
  def hairpin_parameters(self) -> None:
309
378
  self._hairpin_parameters = UNSET
310
379
 
380
+ @property
381
+ def method(self) -> BackTranslateMethod:
382
+ """The codon optimization algorithm to use. Requires codonUsageTableId to be specified. MATCH_CODON_USAGE selects codons probabilistically based on the organism's codon usage frequencies. USE_BEST_CODON always selects the most frequently used codon for each amino acid."""
383
+ if isinstance(self._method, Unset):
384
+ raise NotPresentError(self, "method")
385
+ return self._method
386
+
387
+ @method.setter
388
+ def method(self, value: BackTranslateMethod) -> None:
389
+ self._method = value
390
+
391
+ @method.deleter
392
+ def method(self) -> None:
393
+ self._method = UNSET
394
+
311
395
  @property
312
396
  def reduced_patterns(self) -> List[ReducedPattern]:
313
397
  """List of patterns to avoid when creating the back-translated sequence, on the coding strand only."""
@@ -0,0 +1,98 @@
1
+ from typing import Any, cast, Dict, Type, TypeVar, Union
2
+
3
+ import attr
4
+
5
+ from ..extensions import NotPresentError
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="BackTranslateGcContentRange")
9
+
10
+
11
+ @attr.s(auto_attribs=True, repr=False)
12
+ class BackTranslateGcContentRange:
13
+ """Custom GC content range for the optimized sequence, specified as decimal values between 0 and 1. The maximum must be greater than the minimum. Cannot be specified together with gcContent."""
14
+
15
+ _max: Union[Unset, float] = UNSET
16
+ _min: Union[Unset, float] = UNSET
17
+
18
+ def __repr__(self):
19
+ fields = []
20
+ fields.append("max={}".format(repr(self._max)))
21
+ fields.append("min={}".format(repr(self._min)))
22
+ return "BackTranslateGcContentRange({})".format(", ".join(fields))
23
+
24
+ def to_dict(self) -> Dict[str, Any]:
25
+ max = self._max
26
+ min = self._min
27
+
28
+ field_dict: Dict[str, Any] = {}
29
+ # Allow the model to serialize even if it was created outside of the constructor, circumventing validation
30
+ if max is not UNSET:
31
+ field_dict["max"] = max
32
+ if min is not UNSET:
33
+ field_dict["min"] = min
34
+
35
+ return field_dict
36
+
37
+ @classmethod
38
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any], strict: bool = False) -> T:
39
+ d = src_dict.copy()
40
+
41
+ def get_max() -> Union[Unset, float]:
42
+ max = d.pop("max")
43
+ return max
44
+
45
+ try:
46
+ max = get_max()
47
+ except KeyError:
48
+ if strict:
49
+ raise
50
+ max = cast(Union[Unset, float], UNSET)
51
+
52
+ def get_min() -> Union[Unset, float]:
53
+ min = d.pop("min")
54
+ return min
55
+
56
+ try:
57
+ min = get_min()
58
+ except KeyError:
59
+ if strict:
60
+ raise
61
+ min = cast(Union[Unset, float], UNSET)
62
+
63
+ back_translate_gc_content_range = cls(
64
+ max=max,
65
+ min=min,
66
+ )
67
+
68
+ return back_translate_gc_content_range
69
+
70
+ @property
71
+ def max(self) -> float:
72
+ """ Maximum GC content ratio (e.g., 0.6 for 60%) """
73
+ if isinstance(self._max, Unset):
74
+ raise NotPresentError(self, "max")
75
+ return self._max
76
+
77
+ @max.setter
78
+ def max(self, value: float) -> None:
79
+ self._max = value
80
+
81
+ @max.deleter
82
+ def max(self) -> None:
83
+ self._max = UNSET
84
+
85
+ @property
86
+ def min(self) -> float:
87
+ """ Minimum GC content ratio (e.g., 0.4 for 40%) """
88
+ if isinstance(self._min, Unset):
89
+ raise NotPresentError(self, "min")
90
+ return self._min
91
+
92
+ @min.setter
93
+ def min(self, value: float) -> None:
94
+ self._min = value
95
+
96
+ @min.deleter
97
+ def min(self) -> None:
98
+ self._min = UNSET
@@ -0,0 +1,21 @@
1
+ from enum import Enum
2
+ from functools import lru_cache
3
+ from typing import cast
4
+
5
+ from ..extensions import Enums
6
+
7
+
8
+ class BackTranslateMethod(Enums.KnownString):
9
+ MATCH_CODON_USAGE = "MATCH_CODON_USAGE"
10
+ USE_BEST_CODON = "USE_BEST_CODON"
11
+
12
+ def __str__(self) -> str:
13
+ return str(self.value)
14
+
15
+ @staticmethod
16
+ @lru_cache(maxsize=None)
17
+ def of_unknown(val: str) -> "BackTranslateMethod":
18
+ if not isinstance(val, str):
19
+ raise ValueError(f"Value of BackTranslateMethod must be a string (encountered: {val})")
20
+ newcls = Enum("BackTranslateMethod", {"_UNKNOWN": val}, type=Enums.UnknownString) # type: ignore
21
+ return cast(BackTranslateMethod, getattr(newcls, "_UNKNOWN"))
@@ -4,7 +4,9 @@ import attr
4
4
 
5
5
  from ..extensions import NotPresentError
6
6
  from ..models.optimize_codons_gc_content import OptimizeCodonsGcContent
7
+ from ..models.optimize_codons_gc_content_range import OptimizeCodonsGcContentRange
7
8
  from ..models.optimize_codons_hairpin_parameters import OptimizeCodonsHairpinParameters
9
+ from ..models.optimize_codons_method import OptimizeCodonsMethod
8
10
  from ..models.reduced_pattern import ReducedPattern
9
11
  from ..types import UNSET, Unset
10
12
 
@@ -20,7 +22,9 @@ class OptimizeCodons:
20
22
  _avoided_cutsite_enzyme_ids: Union[Unset, List[str]] = UNSET
21
23
  _codon_usage_table_id: Union[Unset, str] = UNSET
22
24
  _gc_content: Union[Unset, OptimizeCodonsGcContent] = OptimizeCodonsGcContent.ANY
25
+ _gc_content_range: Union[Unset, OptimizeCodonsGcContentRange] = UNSET
23
26
  _hairpin_parameters: Union[Unset, OptimizeCodonsHairpinParameters] = UNSET
27
+ _method: Union[Unset, OptimizeCodonsMethod] = OptimizeCodonsMethod.MATCH_CODON_USAGE
24
28
  _reduced_patterns: Union[Unset, List[ReducedPattern]] = UNSET
25
29
  _schema_id: Union[Unset, str] = UNSET
26
30
  _should_deplete_uridine: Union[Unset, bool] = False
@@ -32,7 +36,9 @@ class OptimizeCodons:
32
36
  fields.append("avoided_cutsite_enzyme_ids={}".format(repr(self._avoided_cutsite_enzyme_ids)))
33
37
  fields.append("codon_usage_table_id={}".format(repr(self._codon_usage_table_id)))
34
38
  fields.append("gc_content={}".format(repr(self._gc_content)))
39
+ fields.append("gc_content_range={}".format(repr(self._gc_content_range)))
35
40
  fields.append("hairpin_parameters={}".format(repr(self._hairpin_parameters)))
41
+ fields.append("method={}".format(repr(self._method)))
36
42
  fields.append("reduced_patterns={}".format(repr(self._reduced_patterns)))
37
43
  fields.append("schema_id={}".format(repr(self._schema_id)))
38
44
  fields.append("should_deplete_uridine={}".format(repr(self._should_deplete_uridine)))
@@ -51,10 +57,18 @@ class OptimizeCodons:
51
57
  if not isinstance(self._gc_content, Unset):
52
58
  gc_content = self._gc_content.value
53
59
 
60
+ gc_content_range: Union[Unset, Dict[str, Any]] = UNSET
61
+ if not isinstance(self._gc_content_range, Unset):
62
+ gc_content_range = self._gc_content_range.to_dict()
63
+
54
64
  hairpin_parameters: Union[Unset, Dict[str, Any]] = UNSET
55
65
  if not isinstance(self._hairpin_parameters, Unset):
56
66
  hairpin_parameters = self._hairpin_parameters.to_dict()
57
67
 
68
+ method: Union[Unset, int] = UNSET
69
+ if not isinstance(self._method, Unset):
70
+ method = self._method.value
71
+
58
72
  reduced_patterns: Union[Unset, List[Any]] = UNSET
59
73
  if not isinstance(self._reduced_patterns, Unset):
60
74
  reduced_patterns = []
@@ -78,8 +92,12 @@ class OptimizeCodons:
78
92
  field_dict["codonUsageTableId"] = codon_usage_table_id
79
93
  if gc_content is not UNSET:
80
94
  field_dict["gcContent"] = gc_content
95
+ if gc_content_range is not UNSET:
96
+ field_dict["gcContentRange"] = gc_content_range
81
97
  if hairpin_parameters is not UNSET:
82
98
  field_dict["hairpinParameters"] = hairpin_parameters
99
+ if method is not UNSET:
100
+ field_dict["method"] = method
83
101
  if reduced_patterns is not UNSET:
84
102
  field_dict["reducedPatterns"] = reduced_patterns
85
103
  if schema_id is not UNSET:
@@ -157,6 +175,22 @@ class OptimizeCodons:
157
175
  raise
158
176
  gc_content = cast(Union[Unset, OptimizeCodonsGcContent], UNSET)
159
177
 
178
+ def get_gc_content_range() -> Union[Unset, OptimizeCodonsGcContentRange]:
179
+ gc_content_range: Union[Unset, Union[Unset, OptimizeCodonsGcContentRange]] = UNSET
180
+ _gc_content_range = d.pop("gcContentRange")
181
+
182
+ if not isinstance(_gc_content_range, Unset):
183
+ gc_content_range = OptimizeCodonsGcContentRange.from_dict(_gc_content_range)
184
+
185
+ return gc_content_range
186
+
187
+ try:
188
+ gc_content_range = get_gc_content_range()
189
+ except KeyError:
190
+ if strict:
191
+ raise
192
+ gc_content_range = cast(Union[Unset, OptimizeCodonsGcContentRange], UNSET)
193
+
160
194
  def get_hairpin_parameters() -> Union[Unset, OptimizeCodonsHairpinParameters]:
161
195
  hairpin_parameters: Union[Unset, Union[Unset, OptimizeCodonsHairpinParameters]] = UNSET
162
196
  _hairpin_parameters = d.pop("hairpinParameters")
@@ -173,6 +207,24 @@ class OptimizeCodons:
173
207
  raise
174
208
  hairpin_parameters = cast(Union[Unset, OptimizeCodonsHairpinParameters], UNSET)
175
209
 
210
+ def get_method() -> Union[Unset, OptimizeCodonsMethod]:
211
+ method = UNSET
212
+ _method = d.pop("method")
213
+ if _method is not None and _method is not UNSET:
214
+ try:
215
+ method = OptimizeCodonsMethod(_method)
216
+ except ValueError:
217
+ method = OptimizeCodonsMethod.of_unknown(_method)
218
+
219
+ return method
220
+
221
+ try:
222
+ method = get_method()
223
+ except KeyError:
224
+ if strict:
225
+ raise
226
+ method = cast(Union[Unset, OptimizeCodonsMethod], UNSET)
227
+
176
228
  def get_reduced_patterns() -> Union[Unset, List[ReducedPattern]]:
177
229
  reduced_patterns = []
178
230
  _reduced_patterns = d.pop("reducedPatterns")
@@ -218,7 +270,9 @@ class OptimizeCodons:
218
270
  avoided_cutsite_enzyme_ids=avoided_cutsite_enzyme_ids,
219
271
  codon_usage_table_id=codon_usage_table_id,
220
272
  gc_content=gc_content,
273
+ gc_content_range=gc_content_range,
221
274
  hairpin_parameters=hairpin_parameters,
275
+ method=method,
222
276
  reduced_patterns=reduced_patterns,
223
277
  schema_id=schema_id,
224
278
  should_deplete_uridine=should_deplete_uridine,
@@ -280,7 +334,7 @@ class OptimizeCodons:
280
334
 
281
335
  @property
282
336
  def gc_content(self) -> OptimizeCodonsGcContent:
283
- """The amount of GC content in the optimized sequence. If not specified, the optimization will default to ANY (0-1). LOW is defined as below 0.33, MEDIUM as 0.33-0.66, and HIGH as above 0.66."""
337
+ """The amount of GC content in the optimized sequence. LOW is defined as below 0.33, MEDIUM as 0.33-0.66, and HIGH as above 0.66. If neither gcContent nor gcContentRange is specified, the optimization will default to ANY (0-1). Cannot be specified together with gcContentRange."""
284
338
  if isinstance(self._gc_content, Unset):
285
339
  raise NotPresentError(self, "gc_content")
286
340
  return self._gc_content
@@ -293,6 +347,21 @@ class OptimizeCodons:
293
347
  def gc_content(self) -> None:
294
348
  self._gc_content = UNSET
295
349
 
350
+ @property
351
+ def gc_content_range(self) -> OptimizeCodonsGcContentRange:
352
+ """Custom GC content range for the optimized sequence, specified as decimal values between 0 and 1. The maximum must be greater than the minimum. Cannot be specified together with gcContent."""
353
+ if isinstance(self._gc_content_range, Unset):
354
+ raise NotPresentError(self, "gc_content_range")
355
+ return self._gc_content_range
356
+
357
+ @gc_content_range.setter
358
+ def gc_content_range(self, value: OptimizeCodonsGcContentRange) -> None:
359
+ self._gc_content_range = value
360
+
361
+ @gc_content_range.deleter
362
+ def gc_content_range(self) -> None:
363
+ self._gc_content_range = UNSET
364
+
296
365
  @property
297
366
  def hairpin_parameters(self) -> OptimizeCodonsHairpinParameters:
298
367
  """These parameters are applied in the AvoidHairpins specification in DNAChisel. If hairpinParameters is not specified, hairpins will not be avoided."""
@@ -308,6 +377,21 @@ class OptimizeCodons:
308
377
  def hairpin_parameters(self) -> None:
309
378
  self._hairpin_parameters = UNSET
310
379
 
380
+ @property
381
+ def method(self) -> OptimizeCodonsMethod:
382
+ """The codon optimization algorithm to use. Requires codonUsageTableId to be specified. MATCH_CODON_USAGE selects codons probabilistically based on the organism's codon usage frequencies. USE_BEST_CODON always selects the most frequently used codon for each amino acid."""
383
+ if isinstance(self._method, Unset):
384
+ raise NotPresentError(self, "method")
385
+ return self._method
386
+
387
+ @method.setter
388
+ def method(self, value: OptimizeCodonsMethod) -> None:
389
+ self._method = value
390
+
391
+ @method.deleter
392
+ def method(self) -> None:
393
+ self._method = UNSET
394
+
311
395
  @property
312
396
  def reduced_patterns(self) -> List[ReducedPattern]:
313
397
  """List of patterns to avoid when creating the optimized sequence, on the coding strand only."""
@@ -0,0 +1,98 @@
1
+ from typing import Any, cast, Dict, Type, TypeVar, Union
2
+
3
+ import attr
4
+
5
+ from ..extensions import NotPresentError
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="OptimizeCodonsGcContentRange")
9
+
10
+
11
+ @attr.s(auto_attribs=True, repr=False)
12
+ class OptimizeCodonsGcContentRange:
13
+ """Custom GC content range for the optimized sequence, specified as decimal values between 0 and 1. The maximum must be greater than the minimum. Cannot be specified together with gcContent."""
14
+
15
+ _max: Union[Unset, float] = UNSET
16
+ _min: Union[Unset, float] = UNSET
17
+
18
+ def __repr__(self):
19
+ fields = []
20
+ fields.append("max={}".format(repr(self._max)))
21
+ fields.append("min={}".format(repr(self._min)))
22
+ return "OptimizeCodonsGcContentRange({})".format(", ".join(fields))
23
+
24
+ def to_dict(self) -> Dict[str, Any]:
25
+ max = self._max
26
+ min = self._min
27
+
28
+ field_dict: Dict[str, Any] = {}
29
+ # Allow the model to serialize even if it was created outside of the constructor, circumventing validation
30
+ if max is not UNSET:
31
+ field_dict["max"] = max
32
+ if min is not UNSET:
33
+ field_dict["min"] = min
34
+
35
+ return field_dict
36
+
37
+ @classmethod
38
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any], strict: bool = False) -> T:
39
+ d = src_dict.copy()
40
+
41
+ def get_max() -> Union[Unset, float]:
42
+ max = d.pop("max")
43
+ return max
44
+
45
+ try:
46
+ max = get_max()
47
+ except KeyError:
48
+ if strict:
49
+ raise
50
+ max = cast(Union[Unset, float], UNSET)
51
+
52
+ def get_min() -> Union[Unset, float]:
53
+ min = d.pop("min")
54
+ return min
55
+
56
+ try:
57
+ min = get_min()
58
+ except KeyError:
59
+ if strict:
60
+ raise
61
+ min = cast(Union[Unset, float], UNSET)
62
+
63
+ optimize_codons_gc_content_range = cls(
64
+ max=max,
65
+ min=min,
66
+ )
67
+
68
+ return optimize_codons_gc_content_range
69
+
70
+ @property
71
+ def max(self) -> float:
72
+ """ Maximum GC content ratio (e.g., 0.6 for 60%) """
73
+ if isinstance(self._max, Unset):
74
+ raise NotPresentError(self, "max")
75
+ return self._max
76
+
77
+ @max.setter
78
+ def max(self, value: float) -> None:
79
+ self._max = value
80
+
81
+ @max.deleter
82
+ def max(self) -> None:
83
+ self._max = UNSET
84
+
85
+ @property
86
+ def min(self) -> float:
87
+ """ Minimum GC content ratio (e.g., 0.4 for 40%) """
88
+ if isinstance(self._min, Unset):
89
+ raise NotPresentError(self, "min")
90
+ return self._min
91
+
92
+ @min.setter
93
+ def min(self, value: float) -> None:
94
+ self._min = value
95
+
96
+ @min.deleter
97
+ def min(self) -> None:
98
+ self._min = UNSET
@@ -0,0 +1,21 @@
1
+ from enum import Enum
2
+ from functools import lru_cache
3
+ from typing import cast
4
+
5
+ from ..extensions import Enums
6
+
7
+
8
+ class OptimizeCodonsMethod(Enums.KnownString):
9
+ MATCH_CODON_USAGE = "MATCH_CODON_USAGE"
10
+ USE_BEST_CODON = "USE_BEST_CODON"
11
+
12
+ def __str__(self) -> str:
13
+ return str(self.value)
14
+
15
+ @staticmethod
16
+ @lru_cache(maxsize=None)
17
+ def of_unknown(val: str) -> "OptimizeCodonsMethod":
18
+ if not isinstance(val, str):
19
+ raise ValueError(f"Value of OptimizeCodonsMethod must be a string (encountered: {val})")
20
+ newcls = Enum("OptimizeCodonsMethod", {"_UNKNOWN": val}, type=Enums.UnknownString) # type: ignore
21
+ return cast(OptimizeCodonsMethod, getattr(newcls, "_UNKNOWN"))
@@ -10,7 +10,9 @@ T = TypeVar("T", bound="ReducedPattern")
10
10
 
11
11
  @attr.s(auto_attribs=True, repr=False)
12
12
  class ReducedPattern:
13
- """Patterns must consist of ATGC bases only, and are case-insensitive ("gat" will reduce usage of "GAT"). If avoidReverseComplement is true, then the pattern's reverse complement will also be avoided."""
13
+ """DNA patterns to avoid during optimization. Supports two formats: 1) DNA base patterns: strings of ATGC bases (case-insensitive, e.g., "ATGC" or "gat") 2) Repeat patterns: format "nxkmer" specifying n repeats of k-sized sequences (e.g., "3x4mer" matches 3 consecutive 4-base repeats). Maximum total length for repeat patterns is 50 bases (n * k ≤ 50).
14
+ If avoidReverseComplement is true, the pattern's reverse complement will also be avoided. Note: avoidReverseComplement cannot be true for repeat patterns (nxkmer format).
15
+ """
14
16
 
15
17
  _avoid_reverse_complement: Union[Unset, bool] = False
16
18
  _pattern: Union[Unset, str] = UNSET