Learn R Programming

rsynthbio

rsynthbio is an R package that provides a convenient interface to the Synthesize Bio API, allowing users to generate realistic gene expression data based on specified biological conditions. This package enables researchers to easily access AI-generated transcriptomic data for various modalities, including bulk RNA-seq and single-cell RNA-seq.

To generate datasets without code, use our web platform.

See the full documentation here.

For questions, suggestions, and support, email us at support@synthesize.bio.

How to Install

You can install rsynthbio from CRAN:

install.packages("rsynthbio")

To install the development version from GitHub:

remotes::install_github("synthesizebio/rsynthbio")

Authentication

Set up your API token (obtain one at app.synthesize.bio):

library(rsynthbio)

# Securely prompt for your token (recommended)
set_synthesize_token()

# Or store in system keyring for persistence across sessions
set_synthesize_token(use_keyring = TRUE)

# Load from keyring in future sessions
load_synthesize_token_from_keyring()

Quick Start

library(rsynthbio)

# See available models
list_models()

# Get an example query for bulk RNA-seq
query <- get_example_query(model_id = "gem-1-bulk")$example_query

# Generate synthetic expression data
result <- predict_query(query, model_id = "gem-1-bulk")

# Access the results
metadata <- result$metadata
expression <- result$expression

Available Models

Model TypeBulkSingle-CellDescription
Baselinegem-1-bulkgem-1-scGenerate expression from metadata
Reference Conditioninggem-1-bulk_reference-conditioninggem-1-sc_reference-conditioningGenerate expression anchored to a reference sample
Metadata Predictiongem-1-bulk_predict-metadatagem-1-sc_predict-metadataPredict metadata from expression

Only baseline models are available to all users. You can check which models are available programmatically, use list_models(). Contact us at support@synthesize.bio if you have any questions.

Documentation

For detailed usage instructions, see the vignettes:

Rate Limits

Free usage of Synthesize Bio is limited. If you exceed this limit, you will receive an error message. To generate more samples, please contact us at support@synthesize.bio.

Copy Link

Version

Install

install.packages('rsynthbio')

Monthly Downloads

249

Version

4.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Synthesize Bio

Last Published

February 13th, 2026

Functions in rsynthbio (4.0.1)

default_output_transformer

Transform Metadata Model Output (Internal)
get_example_query

Get Example Query for Model
clear_synthesize_token

Clear Synthesize Bio API Token
predict_query

Predict Gene Expression
has_synthesize_token

Check if Synthesize Bio API Token is Set
list_models

List Available Models
load_synthesize_token_from_keyring

Load Synthesize Bio API Token from Keyring
set_synthesize_token

Set Synthesize Bio API Token
get_output_transformer

Get Output Transformer for Model (Internal)
API_BASE_URL

API Base URL
DEFAULT_POLL_INTERVAL_SECONDS

Default Poll Interval
OUTPUT_TRANSFORMERS

Output Transformer Registry
get_json

Get JSON from URL
make_api_request

Make Authenticated API Request
DEFAULT_POLL_TIMEOUT_SECONDS

Default Poll Timeout
DEFAULT_TIMEOUT

Default Timeout
transform_baseline_output

Transform Standard Model Output (Internal)
poll_model_query

Poll Model Query
start_model_query

Start Model Query