knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The synapserutils
package provides a set of utility functions, built on top of the synapser
package.
synapserutils
is available as a ready-built package for Microsoft Windows and Mac OSX. For Linux systems, it is available to install from source. It can be installed or upgraded using the standard install.packages()
command, adding the Sage Bionetworks R Archive Network (RAN) to the repository list, e.g.:
install.packages("synapserutils", repos=c("http://ran.synapse.org", "https://cloud.r-project.org"))
Alternatively, edit your ~/.Rprofile
and configure your default repositories:
options(repos=c("http://ran.synapse.org", "https://cloud.r-project.org"))
after which you may run install.packages
without specifying the repositories:
install.packages("synapserutils")
If you have been asked to validate a release candidate, please replace the URL https://sage-bionetworks.github.io/ran with https://sage-bionetworks.github.io/staging-ran, that is:
install.packages("synapserutils", repos=c("http://staging-ran.synapse.org", "https://cloud.r-project.org"))
To get started, try logging into Synapse. If you don't already have a Synapse account, register here:
library(synapserutils) synLogin()
The example below copies File ID syn123
to Project ID syn456
:
copy("syn123", "syn456")
The first parameter in copy()
can be a File ID, a Table ID, or a Link ID. The second parameter must be a Folder ID or a Project ID.
For more information on copy()
, please see:
?copy
To copy a wiki page that is associated with an Entity (Project/ File/ Folder/ Table) syn123
to another Entity syn789
:
copyWiki("syn123", "syn789")
For more information on copyWiki()
, please see:
?copyWiki
syncToSynapse()
takes a manifest file and uploads the files listed in the manifest file to Synapse:
syncToSynapse("/path/to/manifest.tsv")
The manifest file format and instructions on how to create one can be found here and by:
?syncToSynapse
To recursively download all files within a container (Folder/ Project) syn123
:
syncFromSynapse("syn123")
More information on downloading data in bulk is available here and by:
?syncFromSynapse
To recursively getting Entity (File/ Folder/ Table/ Link/ Project) metadata from a container (Folder/ Project):
walk("syn123")
For more information about walk()
, please see:
?walk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.