Skip to main content

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.

  1. Go to the Releases page of the repository.

  2. Find the release tag you want to install (e.g., v0.1.0).

  3. Expand the "Assets" section for that release.

  4. Download the .whl (wheel) file or the .tar.gz (source distribution) file. The wheel file is generally preferred if available for your platform.

  5. 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-0.1.0-py3-none-any.whl
    
    # Example using a downloaded source distribution
    pip install /path/to/pysynthbio-0.1.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 (combined 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysynthbio-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysynthbio-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pysynthbio-0.1.0.tar.gz.

File metadata

  • Download URL: pysynthbio-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pysynthbio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f06ba3637ac34c2964872522b17bd0c8c25467912df8b28981737a1f5b9daf9
MD5 83cc88056244a7018939ef3f4c2dc6e4
BLAKE2b-256 5ccbc30d3ed48a75ea9be5dfcd3b494022c532730d23f1e15c829e99bbfcd8e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysynthbio-0.1.0.tar.gz:

Publisher: new-release.yml on synthesizebio/pysynthbio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysynthbio-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysynthbio-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pysynthbio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0304de3b5af0abe1704cb6c56531614952c4f57fb884e1463f69003c2fd6c96
MD5 80dd5bd5e3ae5e0a04a173119a9acc1e
BLAKE2b-256 0dcec2f0be374ae81b4f7c53a8a749226c3f70351483adcade26b26f0ddcf624

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysynthbio-0.1.0-py3-none-any.whl:

Publisher: new-release.yml on synthesizebio/pysynthbio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page