You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
6
5
7
6
## Installation
8
7
9
-
You can install with pip:
10
-
8
+
To install the python interface using pip, run the following command:
11
9
```
12
10
pip install openprotein-python
13
11
```
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
+
14
21
## Getting started
15
22
16
-
First, create a session using your login credentials.
23
+
To begin, create a session using your login credentials.
17
24
```
18
25
import openprotein
26
+
27
+
# replace USERNAME and PASSWORD with your actual login credentials
19
28
session = openprotein.connect(USERNAME, PASSWORD)
20
29
```
30
+
## Job Status
21
31
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.
23
33
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
25
39
```
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:
30
43
```
44
+
result = future.wait() # wait until done and then fetch results
31
45
46
+
#verbosity is controlled with verbose arg
47
+
result = future.get(verbose=True) # get the result from a finished job
48
+
```
32
49
33
-
###Jobs interface
50
+
## Jobs Interface
34
51
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.
36
54
```
37
-
session.jobs.list() # list all jobs
38
-
session.jobs.get(JOB_ID) # get a specific job
55
+
session.jobs.list()
39
56
```
40
57
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
+
```
44
63
64
+
### Resuming Jobs
65
+
Jobs from prior workflows can be resumed using the load_job method provided by each API.
45
66
```
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
47
68
```
48
-
### PoET interface
49
69
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.
# result is a list of (sequence, score) pydantic objects
71
96
```
72
97
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.
0 commit comments