A package to retrieve data and models from Synthesize Bio's API
Reason this release was yanked:
API dependency has been retired, rendering this package version non-functional.
Project description
pysynthbio
The Pythonic API calling package for Synthesize Bio
Installation
To start using pysynthbio, first you need to have an account with synthesize.bio. Go here to create one
Then on your machine you can install using pip:
pip install pysynthbio
To ensure it installed you can run pip show pysynthbio.
Installing from a GitHub Release
Alternatively, you can install a specific version directly from its GitHub Release page. This is useful for testing pre-releases or specific tagged versions.
-
Go to the Releases page of the repository.
-
Find the release tag you want to install (e.g.,
v2.2.0). -
Expand the "Assets" section for that release.
-
Download the
.whl(wheel) file or the.tar.gz(source distribution) file. The wheel file is generally preferred if available for your platform. -
Install the downloaded file using pip, replacing
<path_to_downloaded_file>with the actual path to the file:# Example using a downloaded wheel file pip install /path/to/pysynthbio-2.2.0-py3-none-any.whl # Example using a downloaded source distribution pip install /path/to/pysynthbio-2.2.0.tar.gz
Usage
Get your API key
Go to https://app.synthesize.bio/profile to generate an API key. Then set this key as an environment variable named SYNTHESIZE_API_KEY to authenticate your API requests.
Form a request
First, import the necessary functions from the package:
import pysynthbio
Discover Valid Modalities
To see which output modalities are supported by the current model, use get_valid_modalities. This function returns a set of strings representing the allowed values for the output_modality key in your query.
supported_modalities = pysynthbio.get_valid_modalities()
print(supported_modalities)
# Output might look like: {'bulk_rna-seq', 'lincs', 'sra', ...}
Generate Example Queries
The structure of the query required by the API is fixed for the current supported model (v1.0). You can use get_valid_query to get a correctly structured example dictionary.
# Get the example query structure
example_query = pysynthbio.get_valid_query()
Get Predictions
Use predict_query to send a query to the API and get expression predictions. You'll typically use get_valid_query to help structure your request. This function also requires the API key.
# You can modify the example_query or create your own following the structure
my_query = pysynthbio.get_valid_query() # Example: using the default valid query
# Modify my_query as needed...
results = pysynthbio.predict_query(
query=my_query,
as_counts=True # Get results as estimated counts (default). Set to False for logCPM.
)
# Access results:
metadata_df = results["metadata"]
expression_df = results["expression"]
This covers the basic workflow: understanding the required query structure and making predictions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysynthbio-2.2.0.tar.gz.
File metadata
- Download URL: pysynthbio-2.2.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1428a55490ecb907abd8019c9a64167fea7a8bc4dee36ecf3916823c133f2c6c
|
|
| MD5 |
647bb3cc1c65ae8403f1b84fa9bee595
|
|
| BLAKE2b-256 |
09678f92a43528cb2fb0cc59bd2180fe7453df8ae016b42943529ba07d42ba4b
|
Provenance
The following attestation bundles were made for pysynthbio-2.2.0.tar.gz:
Publisher:
new-release.yml on synthesizebio/pysynthbio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysynthbio-2.2.0.tar.gz -
Subject digest:
1428a55490ecb907abd8019c9a64167fea7a8bc4dee36ecf3916823c133f2c6c - Sigstore transparency entry: 391274978
- Sigstore integration time:
-
Permalink:
synthesizebio/pysynthbio@a412fd9741ddadcb6e12fc28211ef8371dcca69a -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/synthesizebio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
new-release.yml@a412fd9741ddadcb6e12fc28211ef8371dcca69a -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysynthbio-2.2.0-py3-none-any.whl.
File metadata
- Download URL: pysynthbio-2.2.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b9a5ca672a9b2b7f28d9e8f00c8f826b60d33ed40c56ede60fb4d3014cd56a5
|
|
| MD5 |
fba1b87c20a8bb8e91ca04a5af0daa46
|
|
| BLAKE2b-256 |
5b37763d5107f40ed8a20457becc473c7c1acbd57b65407611107b45cb6520b9
|
Provenance
The following attestation bundles were made for pysynthbio-2.2.0-py3-none-any.whl:
Publisher:
new-release.yml on synthesizebio/pysynthbio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysynthbio-2.2.0-py3-none-any.whl -
Subject digest:
2b9a5ca672a9b2b7f28d9e8f00c8f826b60d33ed40c56ede60fb4d3014cd56a5 - Sigstore transparency entry: 391275001
- Sigstore integration time:
-
Permalink:
synthesizebio/pysynthbio@a412fd9741ddadcb6e12fc28211ef8371dcca69a -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/synthesizebio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
new-release.yml@a412fd9741ddadcb6e12fc28211ef8371dcca69a -
Trigger Event:
push
-
Statement type: