openprotein-python 0.6.0__py3-none-any.whl → 0.6.1__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.
@@ -150,29 +150,46 @@ class DesignConstraint:
150
150
  self.sequence = sequence
151
151
  self.mutations = self.initialize(sequence)
152
152
 
153
- def initialize(self, sequence: str) -> dict[int, list[str]]:
153
+ def initialize(self, sequence: str) -> dict[int, set[str]]:
154
154
  """Initialize with no changes allowed to the sequence."""
155
- return {i: [aa] for i, aa in enumerate(sequence, start=1)}
155
+ return {i: {aa} for i, aa in enumerate(sequence, start=1)}
156
156
 
157
- def allow(self, positions: int | list[int], amino_acids: list[str] | str) -> None:
157
+ def allow(
158
+ self,
159
+ amino_acids: list[str] | str | None = None,
160
+ positions: int | list[int] | None = None,
161
+ ) -> None:
158
162
  """Allow specific amino acids at given positions."""
159
163
  if isinstance(positions, int):
160
164
  positions = [positions]
165
+ elif positions is None:
166
+ positions = [i + 1 for i in range(len(self.sequence))]
161
167
  if isinstance(amino_acids, str):
162
168
  amino_acids = list(amino_acids)
169
+ elif amino_acids is None:
170
+ amino_acids = list(self.sequence)
163
171
 
164
172
  for position in positions:
165
173
  if position in self.mutations:
166
- self.mutations[position].extend(amino_acids)
174
+ for aa in amino_acids:
175
+ self.mutations[position].add(aa)
167
176
  else:
168
- self.mutations[position] = amino_acids
177
+ self.mutations[position] = set(amino_acids)
169
178
 
170
- def remove(self, positions: int | list[int], amino_acids: list[str] | str) -> None:
179
+ def remove(
180
+ self,
181
+ amino_acids: list[str] | str | None = None,
182
+ positions: int | list[int] | None = None,
183
+ ) -> None:
171
184
  """Remove specific amino acids from being allowed at given positions."""
172
185
  if isinstance(positions, int):
173
186
  positions = [positions]
187
+ elif positions is None:
188
+ positions = [i + 1 for i in range(len(self.sequence))]
174
189
  if isinstance(amino_acids, str):
175
190
  amino_acids = list(amino_acids)
191
+ elif amino_acids is None:
192
+ amino_acids = list(self.sequence)
176
193
 
177
194
  for position in positions:
178
195
  if position in self.mutations:
@@ -182,4 +199,4 @@ class DesignConstraint:
182
199
 
183
200
  def as_dict(self) -> dict[int, list[str]]:
184
201
  """Convert the internal mutations representation into a dictionary."""
185
- return self.mutations
202
+ return {i: list(aa) for i, aa in self.mutations.items()}
@@ -44,7 +44,7 @@ class PredictorMetadata(BaseModel):
44
44
  status: JobStatus
45
45
  model_spec: ModelSpec
46
46
  training_dataset: Dataset
47
- traingraphs: list["TrainGraph"]
47
+ traingraphs: list["TrainGraph"] | None = None
48
48
 
49
49
  def is_done(self):
50
50
  return self.status.done()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openprotein_python
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: OpenProtein Python interface.
5
5
  Author-email: Mark Gee <markgee@ne47.bio>
6
6
  License: MIT
@@ -76,13 +76,13 @@ openprotein/predictor/__init__.py,sha256=4jX69K1KVZIraxZmOq_A6Sces5E51nnInGxnP3R
76
76
  openprotein/schemas/__init__.py,sha256=G8gTT5eKeVj12AiQp6HNZrHTbuneS_iNufEpz_qc2_o,1224
77
77
  openprotein/schemas/align.py,sha256=LoAb_L_XavgYUmzzS-v31nN4wMGBFqOktvqcXl9jnfo,1222
78
78
  openprotein/schemas/assaydata.py,sha256=ryoprmbRA_cPQHYTbUa0XGN1gDlWPhLJGgUtdZ5Tt4s,565
79
- openprotein/schemas/design.py,sha256=J_kcgSZQWymeUkbXUJG3zeLfB51fkK-GewylNROYFAk,6122
79
+ openprotein/schemas/design.py,sha256=koTLJvQiteYIQ1TEOtJMVQxDc0wpqjqq0LEJ4x4Cpc4,6668
80
80
  openprotein/schemas/designer.py,sha256=rxhaXiAQTWF9zASoN-puY2gWUnOs2wduCuJjw1yZqBA,835
81
81
  openprotein/schemas/embeddings.py,sha256=YpHJ46Qx0xox46LyyEdMc6iBfk4OP-_DtHJtNGOV-Bw,2176
82
82
  openprotein/schemas/features.py,sha256=RpRBEwJ4oB18jGeJFjyXyvphcCa4SyXnduXk1D57Tbc,87
83
83
  openprotein/schemas/fold.py,sha256=izLG-qTKWLsTeT4XlloFuWnRjdINZb44r6mcCKpJJJ0,185
84
84
  openprotein/schemas/job.py,sha256=koqGBfVqyd8-HlEZrJoAKMhGM91yQgO63jCrm5HJlMU,3904
85
- openprotein/schemas/predictor.py,sha256=IytkNfg4w_aa-Kt0NI2Bu_Bnk8zG3xL_5JLWE5c8u5c,1657
85
+ openprotein/schemas/predictor.py,sha256=7LcldH4affV5_lqYCrVHsgz3UAmHcBjluHMxvjqvSAw,1671
86
86
  openprotein/schemas/svd.py,sha256=yIj14WyZusjy_ZYwKRBvfwN574fuaMdG5nn6iSNWsjA,668
87
87
  openprotein/schemas/umap.py,sha256=Hfg_NwVTRv5uZHEWFYEx73IuZLMUJ50KBsbdsxMH8L4,792
88
88
  openprotein/schemas/deprecated/__init__.py,sha256=TSWiWtx3eeNmWplOSHNuiDz349ptiv_3pBmXsILro78,468
@@ -90,7 +90,7 @@ openprotein/schemas/deprecated/design.py,sha256=L6sKI8Z4JPwr6YIahE_n7A4HEgyVYVoJ
90
90
  openprotein/schemas/deprecated/poet.py,sha256=bWprjLIC7cSCNSMMTco0BGJ3lMCTH9R2X_bSr8BQLZY,1918
91
91
  openprotein/schemas/deprecated/predict.py,sha256=c-ui9HqQMslmjPag9tEUUPqo_qJgAGn1xQYcpZwSFLs,1932
92
92
  openprotein/schemas/deprecated/train.py,sha256=Nfd0iU7ZFW_Dn-YP4Cmii79CzLwh0Xfc96JrfrpxpRQ,643
93
- openprotein_python-0.6.0.dist-info/METADATA,sha256=meTh-NV3vwWQUsZe5K2IN-AiChyUCOysEhsO5joZAbw,7452
94
- openprotein_python-0.6.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
95
- openprotein_python-0.6.0.dist-info/licenses/LICENSE.txt,sha256=amMkJEL2uNWuwaaj25UfyZ37g-KwGF7E3ingj7_Xu4A,1543
96
- openprotein_python-0.6.0.dist-info/RECORD,,
93
+ openprotein_python-0.6.1.dist-info/METADATA,sha256=9p9b62-c2sI96GwX5mMg8jdcjNRXFWK5hYe_43Q9r8I,7452
94
+ openprotein_python-0.6.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
95
+ openprotein_python-0.6.1.dist-info/licenses/LICENSE.txt,sha256=amMkJEL2uNWuwaaj25UfyZ37g-KwGF7E3ingj7_Xu4A,1543
96
+ openprotein_python-0.6.1.dist-info/RECORD,,