|
29 | 29 | from esm.utils.constants.api import MIMETYPE_ES_PICKLE |
30 | 30 | from esm.utils.misc import deserialize_tensors, maybe_list, maybe_tensor |
31 | 31 | from esm.utils.msa import MSA |
32 | | -from esm.utils.structure.input_builder import ( |
33 | | - StructurePredictionInput, |
34 | | - serialize_structure_prediction_input, |
35 | | -) |
36 | | -from esm.utils.structure.molecular_complex import ( |
37 | | - MolecularComplex, |
38 | | - MolecularComplexResult, |
39 | | -) |
40 | 32 | from esm.utils.types import FunctionAnnotation |
41 | 33 |
|
42 | 34 |
|
@@ -217,70 +209,6 @@ def fold( |
217 | 209 |
|
218 | 210 | return self._process_fold_response(data, sequence) |
219 | 211 |
|
220 | | - @retry_decorator |
221 | | - async def async_fold_all_atom( |
222 | | - self, all_atom_input: StructurePredictionInput, model_name: str | None = None |
223 | | - ) -> MolecularComplexResult | list[MolecularComplexResult] | ESMProteinError: |
224 | | - """Fold a molecular complex containing proteins, nucleic acids, and/or ligands. |
225 | | -
|
226 | | - Args: |
227 | | - all_atom_input: StructurePredictionInput containing sequences for different molecule types |
228 | | - model_name: Override the client level model name if needed |
229 | | - """ |
230 | | - request = self._process_fold_all_atom_request( |
231 | | - all_atom_input, model_name if model_name is not None else self.model |
232 | | - ) |
233 | | - |
234 | | - try: |
235 | | - data = await self._async_post("fold_all_atom", request) |
236 | | - except ESMProteinError as e: |
237 | | - return e |
238 | | - |
239 | | - return self._process_fold_all_atom_response(data) |
240 | | - |
241 | | - @retry_decorator |
242 | | - def fold_all_atom( |
243 | | - self, all_atom_input: StructurePredictionInput, model_name: str | None = None |
244 | | - ) -> MolecularComplexResult | list[MolecularComplexResult] | ESMProteinError: |
245 | | - """Predict coordinates for a molecular complex containing proteins, dna, rna, and/or ligands. |
246 | | -
|
247 | | - Args: |
248 | | - all_atom_input: StructurePredictionInput containing sequences for different molecule types |
249 | | - model_name: Override the client level model name if needed |
250 | | - """ |
251 | | - request = self._process_fold_all_atom_request( |
252 | | - all_atom_input, model_name if model_name is not None else self.model |
253 | | - ) |
254 | | - |
255 | | - try: |
256 | | - data = self._post("fold_all_atom", request) |
257 | | - except ESMProteinError as e: |
258 | | - return e |
259 | | - |
260 | | - return self._process_fold_all_atom_response(data) |
261 | | - |
262 | | - @staticmethod |
263 | | - def _process_fold_all_atom_request( |
264 | | - all_atom_input: StructurePredictionInput, model_name: str | None = None |
265 | | - ) -> dict[str, Any]: |
266 | | - request: dict[str, Any] = { |
267 | | - "all_atom_input": serialize_structure_prediction_input(all_atom_input), |
268 | | - "model": model_name, |
269 | | - } |
270 | | - |
271 | | - return request |
272 | | - |
273 | | - @staticmethod |
274 | | - def _process_fold_all_atom_response(data: dict[str, Any]) -> MolecularComplexResult: |
275 | | - complex_data = data.get("complex") |
276 | | - molecular_complex = MolecularComplex.from_state_dict(complex_data) |
277 | | - return MolecularComplexResult( |
278 | | - complex=molecular_complex, |
279 | | - plddt=maybe_tensor(data.get("plddt"), convert_none_to_nan=True), |
280 | | - ptm=data.get("ptm", None), |
281 | | - distogram=maybe_tensor(data.get("distogram"), convert_none_to_nan=True), |
282 | | - ) |
283 | | - |
284 | 212 | @retry_decorator |
285 | 213 | async def async_inverse_fold( |
286 | 214 | self, |
|
0 commit comments