Skip to content

Commit 999d9e3

Browse files
author
mbarber
committed
updated readme
1 parent e05c74d commit 999d9e3

File tree

2 files changed

+53
-26
lines changed

2 files changed

+53
-26
lines changed

README.md

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,78 @@
11
[![PyPI version](https://badge.fury.io/py/openprotein-python.svg)](https://pypi.org/project/openprotein-python/)
22
[![Coverage](https://dev.docs.openprotein.ai/api-python/_images/coverage.svg)](https://pypi.org/project/openprotein-python/)
3-
43
# openprotein-python
5-
Python interface for the OpenProtein.AI REST API.
4+
The OpenProtein.AI Python Interface provides a user-friendly library to interact with the OpenProtein.AI REST API, enabling various tasks related to protein analysis and modeling.
65

76
## Installation
87

9-
You can install with pip:
10-
8+
To install the python interface using pip, run the following command:
119
```
1210
pip install openprotein-python
1311
```
12+
## Requirements
13+
14+
- Python 3.7 or higher.
15+
- pydantic version 1.0 or newer.
16+
- requests version 2.0 or newer.
17+
- tqdm version 4.0 or newer.
18+
- pandas version 1.0 or newer.
19+
20+
1421
## Getting started
1522

16-
First, create a session using your login credentials.
23+
To begin, create a session using your login credentials.
1724
```
1825
import openprotein
26+
27+
# replace USERNAME and PASSWORD with your actual login credentials
1928
session = openprotein.connect(USERNAME, PASSWORD)
2029
```
30+
## Job Status
2131

22-
Async calls return `AsyncJobFuture` objects that allow tracking the status of the job and retrieving the result when it's ready.
32+
The interface offers `AsyncJobFuture` objects for asynchronous calls, allowing tracking of job status and result retrieval when ready. Given a future, you can check its status and retrieve results.
2333

24-
Given a future, check its status and retrieve results
34+
### Checking Job Status
35+
Check the status of an `AsyncJobFuture` using the following methods:
36+
```
37+
future.refresh() # call the backend to update the job status
38+
future.done() # returns True if the job is done, meaning the status could be SUCCESS, FAILED, or CANCELLED
2539
```
26-
future.refresh() # call the backend to update the job status
27-
future.done() # returns True if the job is done, meaning the status could be SUCCESS, FAILED, or CANCELLED
28-
future.wait() # wait until done and then fetch results, verbosity is controlled with verbose arg.
29-
result = future.get() # get the result from a finished job
40+
41+
### Retrieving Job Results
42+
Once the job has finished, retrieve the results using the following methods:
3043
```
44+
result = future.wait() # wait until done and then fetch results
3145
46+
#verbosity is controlled with verbose arg
47+
result = future.get(verbose=True) # get the result from a finished job
48+
```
3249

33-
### Jobs interface
50+
## Jobs Interface
3451

35-
List your jobs, optionally filtered by date, job type, and status.
52+
### Listing Jobs
53+
To view all jobs associated with each session, the following method is available, providing an option to filter results by date, job type, or status.
3654
```
37-
session.jobs.list() # list all jobs
38-
session.jobs.get(JOB_ID) # get a specific job
55+
session.jobs.list()
3956
```
4057

41-
Resume an `AsyncJobFuture` from where you left off with each API's load_job:
42-
43-
For example for training jobs:
58+
### Retrieving Specific Job
59+
For detailed information about a particular job, use the following command with the corresponding job ID:
60+
```
61+
session.jobs.get(JOB_ID) # Replace JOB_ID with the ID of the specific job to be retrieved
62+
```
4463

64+
### Resuming Jobs
65+
Jobs from prior workflows can be resumed using the load_job method provided by each API.
4566
```
46-
session.train.load_job(JOB_ID)
67+
session.train.load_job(JOB_ID) # Replace JOB_ID with the ID of the training job to resume
4768
```
48-
### PoET interface
4969

50-
Score sequences using the PoET interface.
70+
## PoET interface
71+
The PoET Interface allows scoring, generating, and retrieving sequences using the PoET model.
72+
73+
### Scoring Sequences
74+
To score sequences, use the score function. Provide a prompt and a list of queries. The results will be a list of (sequence, score) pydantic objects.
75+
5176
```
5277
prompt_seqs = b'MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN'
5378
@@ -70,17 +95,18 @@ result = future.wait()
7095
# result is a list of (sequence, score) pydantic objects
7196
```
7297

73-
Score single site variants using the PoET interface.
98+
### Scoring Single Site Variants
99+
For scoring single site variants, use the `single_site function`, providing the original sequence and setting `prompt_is_seed` to True if the prompt is a seed sequence.
74100
```
75101
sequence = "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN"
76102
future = session.poet.single_site(prompt, sequence, prompt_is_seed=True)
77103
result = future.wait()
78104
# result is a dictionary of {variant: score}
79105
```
80106

81-
Generate sequences from the PoET model.
107+
### Generating Sequences
108+
To generate sequences from the PoET model, use the `generate` function with relevant parameters. The result will be a list of generated samples.
82109
```
83-
84110
future = session.poet.generate(
85111
prompt,
86112
max_seqs_from_msa=1024,
@@ -91,7 +117,8 @@ future = session.poet.generate(
91117
samples = future.wait()
92118
```
93119

94-
Retrieve the prompt, MSA, or input (seed) sequences for a PoET job.
120+
### Retrieving Input Sequences
121+
You can retrieve the prompt, MSA, or seed sequences for a PoET job using the `get_input` function or the individual functions for each type.
95122
```
96123
future.get_input(INPUT_TYPE)
97124
# or, functions for each type

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "openprotein_python"
33
packages = [{include = "openprotein"}]
4-
version = "0.1.2b1"
4+
version = "0.1.2b2"
55
description = "OpenProtein Python interface."
66
license = "MIT"
77
readme = "README.md"

0 commit comments

Comments
 (0)