diff --git a/docs/source/examples.rst b/docs/source/examples.rst new file mode 100644 index 0000000..ce81363 --- /dev/null +++ b/docs/source/examples.rst @@ -0,0 +1,23 @@ +Examples +======== + +ESM model +~~~~~~~~~ + +.. literalinclude:: ../../examples/esm_model.py + :language: python + :linenos: + +AA0 model +~~~~~~~~~ + +.. literalinclude:: ../../examples/aa0_model.py + :language: python + :linenos: + +3'UTR model +~~~~~~~~~~~ + +.. literalinclude:: ../../examples/3utr_model.py + :language: python + :linenos: \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 05e7d3f..e6b7d81 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -23,6 +23,8 @@ Query Parameters .. automodule:: ginkgo_ai_client.query_parameters :members: -.. .. toctree:: -.. :maxdepth: 2 -.. :caption: Contents: +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + examples diff --git a/examples/3utr_model.py b/examples/3utr_model.py index 59f42f7..90df0c9 100644 --- a/examples/3utr_model.py +++ b/examples/3utr_model.py @@ -1,4 +1,5 @@ -"""This runs embedding and masked inference queries on Ginkgo's 3'UTR language model.""" +"""In this example we compute embedding and run masked inference + on Ginkgo's 3'UTR language model.""" from ginkgo_ai_client import ( GinkgoAIClient, diff --git a/examples/aa0_model.py b/examples/aa0_model.py index 6f7a32f..2934ef7 100644 --- a/examples/aa0_model.py +++ b/examples/aa0_model.py @@ -1,23 +1,26 @@ +"""In this example we compute embedding and run masked inference + on Ginkgo's AA0 protein language model.""" + from ginkgo_ai_client import ( GinkgoAIClient, - three_utr_mean_embedding_params, - three_utr_masked_inference_params, + aa0_mean_embedding_params, + aa0_masked_inference_params, ) client = GinkgoAIClient() # Simple query for embedding computation -prediction = client.query(three_utr_mean_embedding_params("ATTGCG")) +prediction = client.query(aa0_mean_embedding_params("ATTGCG")) # prediction["embedding"] == [1.05, -2.34, ...] # Simple query for masked inference -prediction = client.query(three_utr_masked_inference_params("ATTTAC")) +prediction = client.query(aa0_masked_inference_params("ATTTAC")) queries = [ - three_utr_mean_embedding_params("AGCGC"), - three_utr_mean_embedding_params("ATTGCG"), - three_utr_mean_embedding_params("TACCGCA"), + aa0_mean_embedding_params("AGCGC"), + aa0_mean_embedding_params("ATTGCG"), + aa0_mean_embedding_params("TACCGCA"), ] predictions = client.batch_query(queries) diff --git a/examples/esm_model.py b/examples/esm_model.py index 48781ce..e4bbcfe 100644 --- a/examples/esm_model.py +++ b/examples/esm_model.py @@ -1,25 +1,26 @@ -"""This runs embedding and masked inference queries on Ginkgo's 3'UTR language model.""" +"""In this example we compute embedding and run masked inference + on the ESM2 language model.""" from ginkgo_ai_client import ( GinkgoAIClient, - aa0_mean_embedding_params, - aa0_masked_inference_params, + esm_mean_embedding_params, + esm_masked_inference_params, ) client = GinkgoAIClient() # Simple query for embedding computation -prediction = client.query(aa0_mean_embedding_params("MLYLRRL")) +prediction = client.query(esm_mean_embedding_params("MLYLRRL")) # prediction["embedding"] == [1.05, -2.34, ...] # Simple query for masked inference -prediction = client.query(aa0_masked_inference_params("MLYRRL")) +prediction = client.query(esm_masked_inference_params("MLYRRL")) queries = [ - aa0_mean_embedding_params("MLYLRRL"), - aa0_mean_embedding_params("MLYRRL"), - aa0_mean_embedding_params("MLYLLRRL"), + esm_mean_embedding_params("MLYLRRL"), + esm_mean_embedding_params("MLYRRL"), + esm_mean_embedding_params("MLYLLRRL"), ] predictions = client.batch_query(queries)