synapser

Introduction

The synapser package provides an interface to Synapse, a collaborative workspace for reproducible data intensive research projects, providing support for:

The synapser package lets you communicate with the Synapse platform to create collaborative data analysis projects and access data using the R programming language. Other Synapse clients exist for Python, Java, and the web browser.

Supported Models and Functions

synapser 3.0.0 supports the following Synapse models. Each model’s reference page also lists the functions that work on it, such as synGetAcl(), synSetPermissions(), or synSyncFromSynapse().

Area Models
Projects, folders, and files Project, Folder, File, Link
Tables and views Table, Column, VirtualTable, EntityView, MaterializedView, SubmissionView, DatasetCollection, EntityRef
Provenance Activity, UsedEntity, UsedURL
Wikis WikiPage, WikiHeader, WikiHistorySnapshot, WikiOrderHint
Challenges and evaluations Evaluation, Submission, SubmissionStatus, SubmissionBundle
Users, teams, and organizations Team, UserProfile, UserPreference, Organization
Storage StorageLocation, StorageLocationType
AI agents Agent, AgentSession, AgentPrompt

The Dataset, JSONSchema, and JsonSubColumn models are also available, but don’t have reference pages yet.

These functions work across models:

Task Functions
Connecting to Synapse synLogin, synLogout, synSetEndpoints
Getting, storing, and deleting entities synGet, synStore, synDelete, synSetProperties
Options for getting and storing FileOptions, ActivityOptions, TableOptions, LinkOptions, StoreFileOptions, StoreContainerOptions, StoreTableOptions, StoreJSONSchemaOptions, StoreGridOptions
Querying tables and views synQuery, synQueryPartMask
Download list (cart) synDownloadListAdd, synDownloadListRemove, synDownloadListClear, synDownloadListManifest, synDownloadListFiles, DownloadListItem
Utilities synFindEntityId, synIsSynapseId, synOnweb, synPrintEntity, synMd5Query, synSendMessage
REST API synRestGet, synRestPost, synRestPut, synRestDelete

See the reference index for the full list.

Requirements

Note: You do not need to install Python yourself. When synapser is loaded it declares its Python requirement via reticulate::py_require(), and reticulate downloads a compatible Python and the Synapse Python client into a managed environment on first use. If you would rather point synapser at a Python environment you manage, it must be Python 3.10 to 3.14 — the range supported by synapseclient 4.12. See the install guide for how reticulate chooses between the two.

Documentation

Full documentation for synapser is on the docs site:

For Internal Testing: the docs site may not show this version yet, so build it locally: from the root of your synapser clone, run pkgdown::build_site() and open docs/index.html in a browser.

Installation

synapser is available as a ready-built package for Microsoft Windows and Mac OSX. For Linux systems, it is available to install from source. Please also check out our System Dependencies article for instructions on how to install system dependencies on Linux environments.

Check out the dedicated install guide for additional instructions

In short you may install synapser via:

For Internal Testing:

# Install remotes if not already installed
if (!require("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

remotes::install_github("Sage-Bionetworks/synapser", ref = "SYNR-1649-upgrade-pythonclient-4-14")

We recommend that you DO NOT update synapser’s dependencies during installation.

Release Candidate Installation (WIP)

If you have been asked to validate a release candidate, please use:

# remotes::install_github("Sage-Bionetworks/synapser")
install.packages("synapser", repos = c('https://sage-bionetworks.r-universe.dev', 'https://cloud.r-project.org'))
remotes::install_cran("synapser", repos = c("http://staging-ran.synapse.org"))

Troubleshooting Installation Issues (WIP)

If installation fails, please see our Troubleshooting vignette for detailed resolution steps. Note that the rjson and reticulate version conflicts reported against synapser 2.x no longer apply: 3.0.0 works with current versions of both.

R Version Compatibility (WIP)

Important: synapser 3.0.0 requires R 4.2.0 or later. R 4.1.x is not supported — it is the last Windows release with 32-bit (i386) multiarch, and the version of reticulate that synapser requires does not build for 32-bit Windows.

Under the hood, synapser uses reticulate and the synapsePythonClient. reticulate provisions a compatible Python for you on first use, so you only need to install Python yourself if you prefer to manage your own environment. See instructions below on installing/upgrading Python.

Usage

To get started, try logging into Synapse. If you don’t already have a Synapse account, register here:

library(synapser)
synLogin()

Please visit the synapser docs site or view our vignettes for using the synapser package:

browseVignettes(package = "synapser")

Usage Examples

knit2synapse

Knit RMarkdown files to Synapse wikis

syndccutils

Code for managing data coordinating operations (e.g., development of the CSBC/PS-ON Knowledge Portal and individual Center pages) for Sage-supported communities through Synapse.

How to Upgrade Python

On Windows

On macOS

On Linux

How to Upgrade R

On Windows

On Mac