From cf42376165db2540c6397324a77ce63172c995c5 Mon Sep 17 00:00:00 2001 From: Zulko Date: Mon, 16 Dec 2024 05:42:49 +0000 Subject: [PATCH] deploy: 2e536bea98bb1817dc8ac91ff1266528fb4113cc --- _modules/ginkgo_ai_client/queries.html | 79 +++++++++++++++----------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/_modules/ginkgo_ai_client/queries.html b/_modules/ginkgo_ai_client/queries.html index b5025ff..439b9a2 100644 --- a/_modules/ginkgo_ai_client/queries.html +++ b/_modules/ginkgo_ai_client/queries.html @@ -407,7 +407,7 @@

Source code for ginkgo_ai_client.queries

     promoter_sequence: str
     orf_sequence: str
     tissue_of_interest: Dict[str, List[str]]
-    source: str 
+    source: str
     model: str = "borzoi-human-fold0"
     query_name: Optional[str] = None
 
@@ -702,41 +702,52 @@ 

Source code for ginkgo_ai_client.queries

     query_name: Optional[str] = None
         The name of the query. It will appear in the API response and can be used to
         handle exceptions.
-    """
-
-    sequences: List[Dict[Literal["protein", "ligand"], Union[_Protein, _CCD, _Smiles]]]
-    model: Literal["boltz"] = "boltz"
-    query_name: Optional[str] = None
+
+    Examples
+    --------
+
+    .. code:: python
 
-    def to_request_params(self) -> Dict:
-        return {
-            "model": "boltz",
-            "transforms": [{"type": "INFER_STRUCTURE"}],
-            "text": self.model_dump(exclude=["model", "query_name"], mode="json"),
-        }
+        query = BoltzStructurePredictionQuery.from_yaml_file("input.yaml") # or below:
+        query = BoltzStructurePredictionQuery.from_protein_sequence("MLLKP")
+        response = client.send_request(query)
+        response.download_structure("structure.cif") # or below:
+        response.download_structure("structure.pdb")
+    """
 
-    def parse_response(self, results: Dict) -> BoltzStructurePredictionResponse:
-        return BoltzStructurePredictionResponse(
-            cif_file_url=results["cif_file_url"],
-            confidence_data=results["confidence_data"],
-            query_name=self.query_name,
-        )
-
-    @classmethod
-    def from_yaml_file(cls, path, query_name: Optional[str] = "auto"):
-        path = Path(path)
-        if query_name == "auto":
-            query_name = path.name
-        with open(path, "r") as f:
-            data = yaml.load(f, yaml.SafeLoader)
-        return cls(sequences=data["sequences"], query_name=query_name)
-
-    @classmethod
-    def from_protein_sequence(cls, sequence: str, query_name: Optional[str] = None):
-        return cls(
-            sequences=[{"protein": {"id": "A", "sequence": sequence}}],
-            query_name=query_name,
-        )
+    sequences: List[Dict[Literal["protein", "ligand"], Union[_Protein, _CCD, _Smiles]]]
+    model: Literal["boltz"] = "boltz"
+    query_name: Optional[str] = None
+
+    def to_request_params(self) -> Dict:
+        return {
+            "model": "boltz",
+            "transforms": [{"type": "INFER_STRUCTURE"}],
+            "text": self.model_dump(exclude=["model", "query_name"], mode="json"),
+        }
+
+    def parse_response(self, results: Dict) -> BoltzStructurePredictionResponse:
+        return BoltzStructurePredictionResponse(
+            cif_file_url=results["cif_file_url"],
+            confidence_data=results["confidence_data"],
+            query_name=self.query_name,
+        )
+
+    @classmethod
+    def from_yaml_file(cls, path, query_name: Optional[str] = "auto"):
+        path = Path(path)
+        if query_name == "auto":
+            query_name = path.name
+        with open(path, "r") as f:
+            data = yaml.load(f, yaml.SafeLoader)
+        return cls(sequences=data["sequences"], query_name=query_name)
+
+    @classmethod
+    def from_protein_sequence(cls, sequence: str, query_name: Optional[str] = None):
+        return cls(
+            sequences=[{"protein": {"id": "A", "sequence": sequence}}],
+            query_name=query_name,
+        )