From 4301c2511b9625211465b1d57da04a113370264e Mon Sep 17 00:00:00 2001
From: Dan Lu <90745557+danlu1@users.noreply.github.com>
Date: Wed, 31 Jul 2024 18:37:47 +0000
Subject: [PATCH 01/16] [SYN-1520] upgrade python client version and R version
(#336)
* upgraded synapseclient version to v4.4.0
* updated R version and package dependencies
* added/extended reference documents for both new and modified functions
* updated Github action to reflect most recent compatible R versions
* resolved infinite recursion issues and package building failures on Ubuntu and Windows
---
.github/workflows/build.yml | 20 +-
DESCRIPTION | 4 +-
R/table.R | 6 +-
R/zzz.R | 59 ++---
auto-man/Project-class.Rd | 3 +-
auto-man/Project.Rd | 4 +-
auto-man/synCreateExternalS3FileHandle.Rd | 4 +-
auto-man/synCreateTeam.Rd | 39 ++++
auto-man/synDeleteTeam.Rd | 28 +++
auto-man/synGet.Rd | 9 +-
auto-man/synGetClient.Rd | 38 ++++
auto-man/synGetTeamOpenInvitations.Rd | 2 +-
auto-man/synLogin.Rd | 12 +-
auto-man/synRestDeleteAsync.Rd | 39 ++++
auto-man/synRestGetAsync.Rd | 43 ++++
auto-man/synRestPostAsync.Rd | 45 ++++
auto-man/synRestPutAsync.Rd | 45 ++++
auto-man/synSetClient.Rd | 25 +++
auto-man/synSetPermissions.Rd | 2 +-
auto-man/synStore.Rd | 7 +-
man/Project-class.Rd | 31 ++-
man/Project.Rd | 26 +--
man/synCreateExternalS3FileHandle.Rd | 39 ++--
man/synCreateTeam.Rd | 30 +++
man/synDeleteTeam.Rd | 28 +++
man/synGet.Rd | 55 ++---
man/synGetTeamOpenInvitations.Rd | 8 +-
man/synLogin.Rd | 53 +++--
man/synRestDeleteAsync.Rd | 41 ++++
man/synRestGetAsync.Rd | 39 ++++
man/synRestPostAsync.Rd | 45 ++++
man/synRestPutAsync.Rd | 53 +++++
man/synSetPermissions.Rd | 20 +-
man/synStore.Rd | 67 +++---
tests/testthat/test_table.R | 249 ++++++++++++----------
tools/installPythonClient.R | 8 +-
vignettes/tables.Rmd | 4 +-
vignettes/views.Rmd | 2 +
38 files changed, 914 insertions(+), 318 deletions(-)
create mode 100644 auto-man/synCreateTeam.Rd
create mode 100644 auto-man/synDeleteTeam.Rd
create mode 100644 auto-man/synGetClient.Rd
create mode 100644 auto-man/synRestDeleteAsync.Rd
create mode 100644 auto-man/synRestGetAsync.Rd
create mode 100644 auto-man/synRestPostAsync.Rd
create mode 100644 auto-man/synRestPutAsync.Rd
create mode 100644 auto-man/synSetClient.Rd
create mode 100644 man/synCreateTeam.Rd
create mode 100644 man/synDeleteTeam.Rd
create mode 100644 man/synRestDeleteAsync.Rd
create mode 100644 man/synRestGetAsync.Rd
create mode 100644 man/synRestPostAsync.Rd
create mode 100644 man/synRestPutAsync.Rd
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index fc242440..d847535f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,3 +1,4 @@
+
# build and test synapser. Additionally deploys to S3 RAN server on GitHub release.
name: build
@@ -28,14 +29,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
- r: [4.1.3, 4.2.3, 4.3.1]
+ r: [4.1.3, 4.2.3, 4.3.1, 4.4.1]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Python Version
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: '3.10'
@@ -137,6 +138,10 @@ jobs:
- name: linux-build-package
if: ${{runner.os == 'linux'}}
run: |
+ Rscript -e "install.packages('remotes'); remotes::install_version('reticulate', version = '1.28')"
+ Rscript -e "reticulate::install_miniconda()"
+ echo "options(reticulate.conda_binary = reticulate:::miniconda_conda())" >> .Rprofile
+ Rscript -e "reticulate::conda_create('r-reticulate', packages = c('python==3.10'))"
R CMD build ./
R CMD INSTALL ./ --library=$R_LIBS_USER --no-test-load
@@ -145,7 +150,7 @@ jobs:
- name: mac-build-package
if: ${{runner.os == 'macOS'}}
run: |
- Rscript -e "install.packages(c('remotes', 'reticulate'))"
+ Rscript -e "install.packages('remotes'); remotes::install_version('reticulate', version = '1.28')"
Rscript -e "reticulate::install_miniconda()"
echo "options(reticulate.conda_binary = reticulate:::miniconda_conda())" >> .Rprofile
Rscript -e "reticulate::conda_create('r-reticulate', packages = c('python==3.10'))"
@@ -158,6 +163,11 @@ jobs:
if: ${{runner.os == 'Windows'}}
shell: bash
run: |
+ echo "options(repos = c(CRAN = 'https://cloud.r-project.org'))" >> .Rprofile
+ Rscript -e "install.packages('remotes'); remotes::install_version('reticulate', version = '1.28')"
+ Rscript -e "reticulate::install_python(version = '3.10.11')"
+ Rscript -e "reticulate::virtualenv_create(envname='r-reticulate',version = '3.10.11')"
+ Rscript -e "reticulate::use_virtualenv('r-reticulate')"
R CMD build ./
R CMD INSTALL --build ${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.gz --library=$R_LIBS_USER --no-test-load --no-multiarch
@@ -193,7 +203,7 @@ jobs:
echo "UPLOAD_NAME=$UPLOAD_NAME" >> $GITHUB_ENV
- name: upload-artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: ${{env.UPLOAD_NAME}}
path: ${{env.ARTIFACT_NAME}}
@@ -278,7 +288,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-13]
- r: [4.1.3, 4.2.3, 4.3.1]
+ r: [4.1.3, 4.2.3, 4.3.1, 4.4.1]
runs-on: ${{ matrix.os }}
diff --git a/DESCRIPTION b/DESCRIPTION
index a9b1eea1..15cd4e78 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -15,12 +15,14 @@ Encoding: UTF-8
License: Apache License 2.0
Imports:
reticulate(>= 1.25),
+ reticulate(<= 1.28),
methods,
rjson,
stats,
utils
Depends:
- R(>= 4.0)
+ R(>= 4.1.3),
+ R(< 4.5)
Remotes:
reticulate@1.28
Suggests: pack, R6, testthat, knitr, rmarkdown
diff --git a/R/table.R b/R/table.R
index d5b76cd5..cd7d7fc1 100644
--- a/R/table.R
+++ b/R/table.R
@@ -124,7 +124,7 @@
df <- data.frame(
Map(.convertToRType, list = df, synapseType = types),
stringsAsFactors = F)
-
+
# The Map function mangles column names (which are in the Schema), so let's fix them
colnames(df) <- .extractColumnNames(columnSchema)
df
@@ -137,7 +137,7 @@
df <- data.frame(
Map(.convertToSynapseType, list = df, synapseType = types),
stringsAsFactors = F)
-
+
# The Map function mangles column names (which are in the Schema), so let's fix them
colnames(df) <- .extractColumnNames(columnSchema)
df
@@ -181,4 +181,4 @@
} else {
.saveToCsv(values, file)
}
-}
+}
\ No newline at end of file
diff --git a/R/zzz.R b/R/zzz.R
index 3bd29ee7..d5c5d283 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -12,28 +12,28 @@
# Ideally we would source tools/installPythonClient.R to not
# have to duplicate the synapseclient install code
# system2(paste("Rscript ", getwd(), "/tools/installPythonClient.R ", getwd(), sep=""))
- PYTHON_CLIENT_VERSION <- '4.0.0'
+ PYTHON_CLIENT_VERSION <- '4.4.0'
# reticulate::virtualenv_create('r-reticulate')
# reticulate::use_virtualenv('r-reticulate')
- reticulate::py_install(c("requests<3", "pandas~=2.0.0", "pysftp", "jinja2", "markupsafe"))
+ reticulate::py_install(c("pandas>=1.5,<=2.0.3", "jinja2", "markupsafe","numpy<=1.24.4"))
reticulate::py_install(c(paste("synapseclient==", PYTHON_CLIENT_VERSION, sep="")), pip=T)
reticulate::py_run_string("import synapseclient")
}
)
-
+
reticulate::py_run_string(sprintf("synapserVersion = 'synapser/%s' ", utils::packageVersion("synapser")))
reticulate::py_run_string("synapseclient.USER_AGENT['User-Agent'] = synapserVersion + ' '+ synapseclient.USER_AGENT['User-Agent']")
reticulate::py_run_string("synapseclient.core.config.single_threaded = True")
- reticulate::py_run_string("syn=synapseclient.Synapse(skip_checks=True)")
+ reticulate::py_run_string("syn=synapseclient.Synapse(skip_checks=True, debug=False)")
# make syn available in the global environment
syn <<- reticulate::py_eval("syn")
-
+
.addPythonAndFoldersToSysPath(system.file(package = "synapser"))
.defineRPackageFunctions()
# .defineOverloadFunctions() must come AFTER .defineRPackageFunctions()
# because it redefines selected generic functions
.defineOverloadFunctions()
-
+
# mute Python warnings
reticulate::py_run_string("import warnings")
reticulate::py_run_string("warnings.filterwarnings('ignore')")
@@ -57,7 +57,6 @@
assignEnumCallback = .assignEnumCallback,
functionFilter = .synapseClassFunctionFilter,
functionPrefix = "syn",
- transformReturnObject = .objectDefinitionHelper,
pySingletonName = "syn")
# exposing all supporting classes except for Synapse itself and some selected classes.
generateRWrappers(pyPkg = "synapseclient",
@@ -73,23 +72,25 @@
assignEnumCallback = .assignEnumCallback,
functionFilter = .cherryPickTableFunctionFilter,
classFilter = .removeAllClassesClassFilter,
- functionPrefix = "syn",
- transformReturnObject = .objectDefinitionHelper)
+ functionPrefix = "syn")
}
-.objectDefinitionHelper <- function(object) {
- if (methods::is(object, "CsvFileTable")) {
- # reading from csv
- # Removed due to Error in unlockBinding("asDataFrame", object) : no binding for "asDataFrame"
- # unlockBinding("asDataFrame", object)
- object$asDataFrame <- function() {
- .readCsvBasedOnSchema(object)
- }
- # Removed due to Error in lockBinding("asDataFrame", object) : no binding for "asDataFrame"
- # lockBinding("asDataFrame", object)
- }
- object
-}
+# TODO: This section is removed since it causes the infinite recursion
+# issue when reading downloaded entity to a dataframe. Revisit this
+# when deprecating PythonEmbedInR code
+# .objectDefinitionHelper <- function(object) {
+# if (methods::is(object, "CsvFileTable")) {
+# # reading from csv
+# # Removed due to Error in unlockBinding("asDataFrame", object) : no binding for "asDataFrame"
+# # unlockBinding("asDataFrame", object)
+# object$asDataFrame <- function() {
+# .readCsvBasedOnSchema(object)
+# }
+# # Removed due to Error in lockBinding("asDataFrame", object) : no binding for "asDataFrame"
+# # lockBinding("asDataFrame", object)
+# }
+# object
+# }
.onAttach <- function(libname, pkgname) {
tou <- "\nTERMS OF USE NOTICE:
@@ -98,7 +99,7 @@
2) Not discriminate, identify, or recontact individuals or groups represented by the data.
3) Use and contribute only data de-identified to HIPAA standards.
4) Redistribute data only under these same terms of use.\n"
-
+
.checkForUpdate()
packageStartupMessage(tou)
}
@@ -128,7 +129,7 @@
Table(schema, file)
}
)
-
+
methods::setMethod(
f = "synBuildTable",
signature = c("ANY", "ANY", "data.frame"),
@@ -144,10 +145,10 @@
f = "as.data.frame",
signature = c(x = "CsvFileTable"),
definition = function(x) {
- x$asDataFrame()
+ .readCsvBasedOnSchema(x)
}
)
-
+
methods::setClass("GeneratorWrapper")
methods::setMethod(
f = "as.list",
@@ -156,14 +157,14 @@
x$asList()
}
)
-
+
methods::setGeneric(
name = "nextElem",
def = function(x) {
standardGeneric("nextElem")
}
)
-
+
methods::setMethod(
f = "nextElem",
signature = c(x = "GeneratorWrapper"),
@@ -171,4 +172,4 @@
x$nextElem()
}
)
-}
+}
\ No newline at end of file
diff --git a/auto-man/Project-class.Rd b/auto-man/Project-class.Rd
index f9b00108..1475cfec 100644
--- a/auto-man/Project-class.Rd
+++ b/auto-man/Project-class.Rd
@@ -18,13 +18,14 @@ Projects in Synapse must be uniquely named. Trying to create a project with a na
Attributes:
name: The name of the project
+ alias: The project alias for use in friendly project urls.
properties: A map of Synapse properties
annotations: A map of user defined annotations
local_state: Internal use only
}
\section{Methods}{
\itemize{
-\item \code{Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL)}: Constructor for \code{\link{Project}}
+\item \code{Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL)}: Constructor for \code{\link{Project}}
\item \code{local_state(state=NULL)}: Set or get the object's internal state, excluding properties, or annotations.\cr
\cr
Arguments:\cr
diff --git a/auto-man/Project.Rd b/auto-man/Project.Rd
index 5d8bc377..4381f8c2 100644
--- a/auto-man/Project.Rd
+++ b/auto-man/Project.Rd
@@ -17,18 +17,20 @@ Projects in Synapse must be uniquely named. Trying to create a project with a na
Attributes:
name: The name of the project
+ alias: The project alias for use in friendly project urls.
properties: A map of Synapse properties
annotations: A map of user defined annotations
local_state: Internal use only
}
\usage{
-Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL)
+Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL)
}
\arguments{
\item{name}{}
\item{properties}{}
\item{annotations}{}
\item{local_state}{}
+\item{alias}{}
}
\value{
An object of type Project
diff --git a/auto-man/synCreateExternalS3FileHandle.Rd b/auto-man/synCreateExternalS3FileHandle.Rd
index 574856cb..814729b2 100644
--- a/auto-man/synCreateExternalS3FileHandle.Rd
+++ b/auto-man/synCreateExternalS3FileHandle.Rd
@@ -23,12 +23,13 @@ Arguments:
storage_location_id: Explicit storage location id to create the file handle in, mutually exclusive
with parent
mimetype: Mimetype of the file, if known
+ md5: MD5 of the file, if known
Raises:
ValueError: If neither parent nor storage_location_id is specified, or if both are specified.
}
\usage{
-synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL)
+synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL, md5=NULL)
}
\arguments{
\item{bucket_name}{}
@@ -37,6 +38,7 @@ synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL,
\item{parent}{}
\item{storage_location_id}{}
\item{mimetype}{}
+\item{md5}{}
}
\value{
diff --git a/auto-man/synCreateTeam.Rd b/auto-man/synCreateTeam.Rd
new file mode 100644
index 00000000..e2fc1c07
--- /dev/null
+++ b/auto-man/synCreateTeam.Rd
@@ -0,0 +1,39 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synCreateTeam}
+\alias{synCreateTeam}
+\docType{methods}
+\title{
+synCreateTeam
+}
+\description{
+Creates a new team.
+
+Arguments:
+ name: The name of the team to create.
+ description: A description of the team.
+ icon: The FileHandleID of the icon to be used for the team.
+ canPublicJoin: Whether the team can be joined by anyone. Defaults to False.
+ canRequestMembership: Whether the team can request membership. Defaults to True.
+
+Returns:
+ An object of type [synapseclient.team.Team][]
+}
+\usage{
+synCreateTeam(name, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE)
+}
+\arguments{
+\item{name}{}
+\item{description}{}
+\item{icon}{}
+\item{can_public_join}{}
+\item{can_request_membership}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synDeleteTeam.Rd b/auto-man/synDeleteTeam.Rd
new file mode 100644
index 00000000..da7105e4
--- /dev/null
+++ b/auto-man/synDeleteTeam.Rd
@@ -0,0 +1,28 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synDeleteTeam}
+\alias{synDeleteTeam}
+\docType{methods}
+\title{
+synDeleteTeam
+}
+\description{
+Deletes a team.
+
+Arguments:
+ id: The ID of the team to delete.
+}
+\usage{
+synDeleteTeam(id)
+}
+\arguments{
+\item{id}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synGet.Rd b/auto-man/synGet.Rd
index 6d66c561..d4f2b098 100644
--- a/auto-man/synGet.Rd
+++ b/auto-man/synGet.Rd
@@ -13,10 +13,11 @@ synGet
Gets a Synapse entity from the repository service.
Arguments:
- entity: A Synapse ID, a Synapse Entity object, a plain dictionary in which 'id' maps to a
- Synapse ID or a local file that is stored in Synapse (found by the file MD5)
+ entity: A Synapse ID (e.g. syn123 or syn123.1, with .1 denoting version), a Synapse Entity object,
+ a plain dictionary in which 'id' maps to a Synapse ID or a local file that is stored in
+ Synapse (found by the file MD5)
version: The specific version to get.
- Defaults to the most recent version.
+ Defaults to the most recent version. If not denoted in the entity input.
downloadFile: Whether associated files(s) should be downloaded.
Defaults to True.
downloadLocation: Directory where to download the Synapse File Entity.
@@ -29,6 +30,8 @@ Arguments:
limitSearch: A Synanpse ID used to limit the search in Synapse if entity is specified as a local
file. That is, if the file is stored in multiple locations in Synapse only the ones
in the specified folder/project will be returned.
+ md5: The MD5 checksum for the file, if known. Otherwise if the file is a
+ local file, it will be calculated automatically.
Returns:
A new Synapse Entity object of the appropriate type.
diff --git a/auto-man/synGetClient.Rd b/auto-man/synGetClient.Rd
new file mode 100644
index 00000000..7bf7c413
--- /dev/null
+++ b/auto-man/synGetClient.Rd
@@ -0,0 +1,38 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synGetClient}
+\alias{synGetClient}
+\docType{methods}
+\title{
+synGetClient
+}
+\description{
+Convience function to get an instance of 'Synapse'. The latest instance created
+by 'login()' or set via `set_client` will be returned.
+
+When 'logout()' is called it will delete the instance.
+
+Arguments:
+ synapse_client: An instance of 'Synapse' or None. This is used to simplify logical checks
+ in cases where synapse is passed into them.
+
+Returns:
+ An instance of 'Synapse'.
+
+Raises:
+ SynapseError: No instance has been created - Please use login() first
+}
+\usage{
+synGetClient(synapse_client)
+}
+\arguments{
+\item{synapse_client}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synGetTeamOpenInvitations.Rd b/auto-man/synGetTeamOpenInvitations.Rd
index b019f585..3f809249 100644
--- a/auto-man/synGetTeamOpenInvitations.Rd
+++ b/auto-man/synGetTeamOpenInvitations.Rd
@@ -17,7 +17,7 @@ Arguments:
team: A [synapseclient.team.Team][] object or a team's ID.
Yields:
- Generator of MembershipRequest
+ Generator of MembershipRequest dictionaries
}
\usage{
synGetTeamOpenInvitations(team)
diff --git a/auto-man/synLogin.Rd b/auto-man/synLogin.Rd
index 06f8017c..8a348e5a 100644
--- a/auto-man/synLogin.Rd
+++ b/auto-man/synLogin.Rd
@@ -17,10 +17,10 @@ Valid combinations of login() arguments:
If no login arguments are provided or only username is provided, login() will attempt to log in using
information from these sources (in order of preference):
-1. User defined arguments during a CLI session
-2. User's Personal Access Token (aka: Synapse Auth Token)
+1. .synapseConfig file (in user home folder unless configured otherwise)
+2. User defined arguments during a CLI session
+3. User's Personal Access Token (aka: Synapse Auth Token)
from the environment variable: SYNAPSE_AUTH_TOKEN
-3. .synapseConfig file (in user home folder unless configured otherwise)
4. Retrieves user's authentication token from AWS SSM Parameter store (if configured)
Arguments:
@@ -28,14 +28,18 @@ Arguments:
authToken: A bearer authorization token, e.g. a
[personal access token](https://python-docs.synapse.org/tutorials/authentication/).
silent: Defaults to False. Suppresses the "Welcome ...!" message.
+ cache_client: Whether to cache the Synapse client object in the Synapse module. Defaults to True.
+ When set to True anywhere a `Synapse` object is optional you do not need to pass an
+ instance of `Synapse` to that function, method, or class.
}
\usage{
-synLogin(email=NULL, silent=FALSE, authToken=NULL)
+synLogin(email=NULL, silent=FALSE, authToken=NULL, cache_client=TRUE)
}
\arguments{
\item{email}{}
\item{silent}{}
\item{authToken}{}
+\item{cache_client}{}
}
\value{
diff --git a/auto-man/synRestDeleteAsync.Rd b/auto-man/synRestDeleteAsync.Rd
new file mode 100644
index 00000000..3c247534
--- /dev/null
+++ b/auto-man/synRestDeleteAsync.Rd
@@ -0,0 +1,39 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synRestDeleteAsync}
+\alias{synRestDeleteAsync}
+\docType{methods}
+\title{
+synRestDeleteAsync
+}
+\description{
+Sends an HTTP DELETE request to the Synapse server.
+
+Arguments:
+ uri: URI of resource to be deleted
+ endpoint: Server endpoint, defaults to self.repoEndpoint
+ headers: Dictionary of headers to use.
+ retry_policy: A retry policy that matches the arguments of
+ [synapseclient.core.retry.with_retry_time_based_async][].
+ requests_session_async_synapse: The async client to use when making this
+ specific call
+ kwargs: Any other arguments taken by a [request](https://www.python-httpx.org/api/) method
+}
+\usage{
+synRestDeleteAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+}
+\arguments{
+\item{uri}{}
+\item{endpoint}{}
+\item{headers}{}
+\item{retry_policy}{}
+\item{requests_session_async_synapse}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synRestGetAsync.Rd b/auto-man/synRestGetAsync.Rd
new file mode 100644
index 00000000..81f8770d
--- /dev/null
+++ b/auto-man/synRestGetAsync.Rd
@@ -0,0 +1,43 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synRestGetAsync}
+\alias{synRestGetAsync}
+\docType{methods}
+\title{
+synRestGetAsync
+}
+\description{
+Sends an HTTP GET request to the Synapse server.
+
+Arguments:
+ uri: URI on which get is performed
+ endpoint: Server endpoint, defaults to self.repoEndpoint
+ headers: Dictionary of headers to use.
+ retry_policy: A retry policy that matches the arguments of
+ [synapseclient.core.retry.with_retry_time_based_async][].
+ requests_session_async_synapse: The async client to use when making this
+ specific call.
+ kwargs: Any other arguments taken by a
+ [request](https://www.python-httpx.org/api/) method
+
+Returns:
+ JSON encoding of response
+}
+\usage{
+synRestGetAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+}
+\arguments{
+\item{uri}{}
+\item{endpoint}{}
+\item{headers}{}
+\item{retry_policy}{}
+\item{requests_session_async_synapse}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synRestPostAsync.Rd b/auto-man/synRestPostAsync.Rd
new file mode 100644
index 00000000..0e288d0f
--- /dev/null
+++ b/auto-man/synRestPostAsync.Rd
@@ -0,0 +1,45 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synRestPostAsync}
+\alias{synRestPostAsync}
+\docType{methods}
+\title{
+synRestPostAsync
+}
+\description{
+Sends an HTTP POST request to the Synapse server.
+
+Arguments:
+ uri: URI on which get is performed
+ body: The payload to be delivered
+ endpoint: Server endpoint, defaults to self.repoEndpoint
+ headers: Dictionary of headers to use.
+ retry_policy: A retry policy that matches the arguments of
+ [synapseclient.core.retry.with_retry_time_based_async][].
+ requests_session_async_synapse: The async client to use when making this
+ specific call.
+ kwargs: Any other arguments taken by a
+ [request](https://www.python-httpx.org/api/) method
+
+Returns:
+ JSON encoding of response
+}
+\usage{
+synRestPostAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+}
+\arguments{
+\item{uri}{}
+\item{body}{}
+\item{endpoint}{}
+\item{headers}{}
+\item{retry_policy}{}
+\item{requests_session_async_synapse}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synRestPutAsync.Rd b/auto-man/synRestPutAsync.Rd
new file mode 100644
index 00000000..0fcd3a61
--- /dev/null
+++ b/auto-man/synRestPutAsync.Rd
@@ -0,0 +1,45 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synRestPutAsync}
+\alias{synRestPutAsync}
+\docType{methods}
+\title{
+synRestPutAsync
+}
+\description{
+Sends an HTTP PUT request to the Synapse server.
+
+Arguments:
+ uri: URI on which get is performed
+ body: The payload to be delivered.
+ endpoint: Server endpoint, defaults to self.repoEndpoint
+ headers: Dictionary of headers to use.
+ retry_policy: A retry policy that matches the arguments of
+ [synapseclient.core.retry.with_retry_time_based_async][].
+ requests_session_async_synapse: The async client to use when making this
+ specific call.
+ kwargs: Any other arguments taken by a
+ [request](https://www.python-httpx.org/api/) method
+
+Returns
+ JSON encoding of response
+}
+\usage{
+synRestPutAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+}
+\arguments{
+\item{uri}{}
+\item{body}{}
+\item{endpoint}{}
+\item{headers}{}
+\item{retry_policy}{}
+\item{requests_session_async_synapse}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synSetClient.Rd b/auto-man/synSetClient.Rd
new file mode 100644
index 00000000..d8b64001
--- /dev/null
+++ b/auto-man/synSetClient.Rd
@@ -0,0 +1,25 @@
+%
+% Auto-generated file, do not modify.
+% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
+% Use Git to identify changes in this file which suggest where to change your edited copy.
+%
+\name{synSetClient}
+\alias{synSetClient}
+\docType{methods}
+\title{
+synSetClient
+}
+\description{
+
+}
+\usage{
+synSetClient(synapse_client)
+}
+\arguments{
+\item{synapse_client}{}
+}
+\value{
+
+}
+
+
diff --git a/auto-man/synSetPermissions.Rd b/auto-man/synSetPermissions.Rd
index b195c174..294210e1 100644
--- a/auto-man/synSetPermissions.Rd
+++ b/auto-man/synSetPermissions.Rd
@@ -16,7 +16,7 @@ An Entity may have its own ACL or inherit its ACL from a benefactor.
Arguments:
entity: An Entity or Synapse ID to modify
principalId: Identifier of a user or group. '273948' is for all registered Synapse users
- and '273949' is for public access.
+ and '273949' is for public access. None implies public access.
accessType: Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE,
DELETE, CHANGE_PERMISSIONS
modify_benefactor: Set as True when modifying a benefactor's ACL
diff --git a/auto-man/synStore.Rd b/auto-man/synStore.Rd
index 4e195ec3..d97c2b6e 100644
--- a/auto-man/synStore.Rd
+++ b/auto-man/synStore.Rd
@@ -29,14 +29,13 @@ Arguments:
process of adding terms-of-use or review board approval for this entity.
You will be contacted with regards to the specific data being restricted and the
requirements of access.
- opentelemetry_context: OpenTelemetry context to propogate to this function to use for tracing. Used
- cases where multi-threaded operations need to be linked to parent spans.
+ set_annotations: If True, set the annotations on the entity. If False, do not set the annotations.
Returns:
A Synapse Entity, Evaluation, or Wiki
}
\usage{
-synStore(obj, createOrUpdate=TRUE, forceVersion=TRUE, versionLabel=NULL, isRestricted=FALSE, activity=NULL, used=NULL, executed=NULL, activityName=NULL, activityDescription=NULL, opentelemetry_context=NULL)
+synStore(obj, createOrUpdate=TRUE, forceVersion=TRUE, versionLabel=NULL, isRestricted=FALSE, activity=NULL, used=NULL, executed=NULL, activityName=NULL, activityDescription=NULL, set_annotations=TRUE)
}
\arguments{
\item{obj}{}
@@ -49,7 +48,7 @@ synStore(obj, createOrUpdate=TRUE, forceVersion=TRUE, versionLabel=NULL, isRestr
\item{executed}{}
\item{activityName}{}
\item{activityDescription}{}
-\item{opentelemetry_context}{}
+\item{set_annotations}{}
}
\value{
diff --git a/man/Project-class.Rd b/man/Project-class.Rd
index 37a2d754..a1213217 100644
--- a/man/Project-class.Rd
+++ b/man/Project-class.Rd
@@ -8,12 +8,35 @@ Project
\description{
Represents a project in Synapse.
-Projects in Synapse must be uniquely named. Trying to create a project with
-a name that's already taken, say 'My project', will result in an error
+Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say
+'My project', will result in an error
}
-\section{Methods}{
+
+\section{Attributes}{
\itemize{
-\item \code{Project(name=NULL, properties=NULL, annotations=NULL)}: Constructor for \code{\link{Project}}
+\item{name:}{ The name of the project\cr
+}
+\item{alias:}{ The project alias for use in friendly project urls\cr
+}
+\item{properties:}{ A map of Synapse properties\cr
+}
+\item{annotations:}{ A map of user defined annotations\cr
+}
+\item{local_state:}{ Internal use only\cr
+}
}
}
+\section{Methods}{
+\itemize{
+\item \code{Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL)}: Constructor for \code{\link{Project}}
+\item \code{local_state(state=NULL)}: Set or get the object's internal state, excluding properties, or annotations.\cr
+
+\subsection{Arguments}{
+state: A dictionary containing the object's internal state
+}
+\subsection{Returns}{
+The object's internal state, excluding properties, or annotations
+}
+}
+}
\ No newline at end of file
diff --git a/man/Project.Rd b/man/Project.Rd
index bf2f9f78..a0293c85 100644
--- a/man/Project.Rd
+++ b/man/Project.Rd
@@ -7,34 +7,30 @@ Constructor for objects of type Project
\description{
Represents a project in Synapse.
-Projects in Synapse must be uniquely named. Trying to create a project with
-a name that's already taken, say 'My project', will result in an error
+Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say
+'My project', will result in an error
}
\usage{
-Project(name=NULL, properties=NULL, annotations=NULL)
+Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL)
}
\arguments{
-\item{name}{ The name of the project\cr
-}
-\item{properties}{ A named list/vector of Synapse properties. The only valid property name is 'alias'.\cr
-}
-\item{annotations}{ A named list/vector of user defined annotations.\cr
-}
+\item{name}{The name of the project}
+\item{properties}{A map of Synapse properties}
+\item{annotations}{A map of user defined annotations}
+\item{local_state}{Internal use only}
+\item{alias}{The project alias for use in friendly project urls}
}
\value{
An object of type Project
}
%
-% Verified that the following works on 2018Jan16.
+% Verified that the following works on 2024June27.
%
\examples{
\dontrun{
-project <- Project('Foobarbat project', properties=c(alias='foobarbat'), annotations=c(foo='bar', bat=101))
+project <- Project('Foobarbat ddd project', properties=list(alias='foobarbat'), annotations=list(foo='bar', bat=101))
project <- synStore(project)
project$properties
project$annotations$foo
}
-}
-
-
-
+}
\ No newline at end of file
diff --git a/man/synCreateExternalS3FileHandle.Rd b/man/synCreateExternalS3FileHandle.Rd
index b0319368..1a6c4317 100644
--- a/man/synCreateExternalS3FileHandle.Rd
+++ b/man/synCreateExternalS3FileHandle.Rd
@@ -7,27 +7,29 @@ synCreateExternalS3FileHandle
\description{
Create an external S3 file handle for e.g. a file that has been uploaded directly to
an external S3 storage location.
+
}
\usage{
-synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL)
+synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL, md5=NULL)
}
\arguments{
-\item{bucket_name}{ Name of the S3 bucket\cr
-}
-\item{s3_file_key}{ S3 key of the uploaded object\cr
-}
-\item{file_path}{ Local path of the uploaded file\cr
-}
-\item{parent}{ Parent entity to create the file handle in, the file handle will be created\cr
- in the default storage location of the parent. Mutually exclusive with\cr
- storage_location_id\cr
-}
-\item{storage_location_id}{ Explicit storage location id to create the file handle in, mutually exclusive\cr
- with parent\cr
-}
-\item{mimetype}{ Mimetype of the file, if known}
-}
-
+\item{bucket_name}{Name of the S3 bucket}
+\item{s3_file_key}{S3 key of the uploaded object}
+\item{file_path}{Local path of the uploaded file}
+\item{parent}{Parent entity to create the file handle in, the file handle will be created
+ in the default storage location of the parent. Mutually exclusive with
+ storage_location_id}
+\item{storage_location_id}{Explicit storage location id to create the file handle in, mutually exclusive
+ with parent}
+\item{mimetype}{Mimetype of the file, if known}
+\item{md5}{MD5 of the file, if known}
+}
+\section{Error}{
+If neither parent nor storage_location_id is specified, or if both are specified.
+}
+%
+% Verified that the following works on 2024July5.
+%
\examples{
\dontrun{
library("aws.s3")
@@ -46,11 +48,10 @@ sts_write_token <- synGetStsStorageToken(entity=folder_id, permission='read_writ
Sys.setenv('AWS_ACCESS_KEY_ID'=sts_write_token$accessKeyId, 'AWS_SECRET_ACCESS_KEY'=sts_write_token$secretAccessKey, 'AWS_SESSION_TOKEN'=sts_write_token$sessionToken)
# upload a file directly to s3
-put_object(file='/tmp/foo.txt', object='test/foo.txt', bucket='aws-bucket-name')
+put_object(file='/tmp/foo.txt', object='test/foo.txt', bucket='aws-bucket-name', acl= 'bucket-owner-full-control')
# create a file handle for the object
synCreateExternalS3FileHandle(bucket_name='aws-bucket-name', s3_file_key='test/foo.txt', file_path='/tmp/foo.txt', storage_location_id=storage_location$storageLocationId)
-
}
}
diff --git a/man/synCreateTeam.Rd b/man/synCreateTeam.Rd
new file mode 100644
index 00000000..d7ea516e
--- /dev/null
+++ b/man/synCreateTeam.Rd
@@ -0,0 +1,30 @@
+\name{synCreateTeam}
+\alias{synCreateTeam}
+\docType{methods}
+\title{
+synCreateTeam
+}
+\description{
+Creates a new team
+}
+\usage{
+synCreateTeam(name, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE)
+}
+\arguments{
+\item{name}{The name of the team to create.}
+\item{description}{A description of the team.}
+\item{icon}{The FileHandleID of the icon to be used for the team.}
+\item{can_public_join}{Whether the team can be joined by anyone. Defaults to FALSE.}
+\item{can_request_membership}{Whether the team can request membership. Defaults to TRUE.}
+}
+\value{
+An Team object
+}
+%
+% Verified that the following works on 2024July1.
+%
+\examples{
+\dontrun{
+synCreateTeam('your_team_name')
+}
+}
diff --git a/man/synDeleteTeam.Rd b/man/synDeleteTeam.Rd
new file mode 100644
index 00000000..48944e23
--- /dev/null
+++ b/man/synDeleteTeam.Rd
@@ -0,0 +1,28 @@
+\name{synDeleteTeam}
+\alias{synDeleteTeam}
+\docType{methods}
+\title{
+synDeleteTeam
+}
+\description{
+Deletes a team
+}
+\usage{
+synDeleteTeam(id)
+}
+\arguments{
+\item{id}{The ID of the team to delete.}
+}
+\value{
+NULL
+}
+%
+% Verified that the following works on 2024July1.
+%
+\examples{
+\dontrun{
+synDeleteTeam('your_team_id')
+}
+}
+
+
diff --git a/man/synGet.Rd b/man/synGet.Rd
index 42b99e93..1bc722fb 100644
--- a/man/synGet.Rd
+++ b/man/synGet.Rd
@@ -8,39 +8,36 @@ synGet
Gets a Synapse entity from the repository service.
}
\usage{
-synGet(entity, version=NULL, downloadFile=NULL, downloadLocation=NULL, followLink=NULL, ifcollision=NULL, limitSearch=NULL)
+synGet(entity)
}
\arguments{
-\item{entity}{ A Synapse ID, a Synapse Entity object,\cr
- a named list in which 'id' maps to a Synapse ID or\cr
- a local file that is stored in Synapse (found by hash of file)\cr
-}
-\item{version}{optional named parameter: The specific version to get.\cr
- Defaults to the most recent version.\cr
-}
-\item{downloadFile}{optional named parameter: Whether associated files(s) should be downloaded.\cr
- Defaults to TRUE\cr
-}
-\item{downloadLocation}{optional named parameter: Directory where to download the Synapse File Entity.\cr
- Defaults to the local cache.\cr
-}
-\item{followLink}{optional named parameter: Whether the link returns the target Entity.\cr
- Defaults to FALSE\cr
-}
-\item{ifcollision}{optional named parameter: Determines how to handle file collisions.\cr
- May be "overwrite.local", "keep.local", or "keep.both".\cr
- Defaults to "keep.both".\cr
-}
-\item{limitSearch}{optional named parameter: a Synanpse ID used to limit the search in Synapse if entity is\cr
- specified as a local file. That is, if the file is stored in multiple\cr
- locations in Synapse only the ones in the specified folder/project will be\cr
- returned.}
+\item{entity}{ A Synapse ID (e.g. syn123 or syn123.1, with .1 denoting version), a Synapse Entity object,
+ a plain dictionary in which 'id' maps to a Synapse ID or a local file that is stored in
+ Synapse (found by the file MD5)
+}
+\item{version}{Optional. The specific version to get.
+ Defaults to the most recent version. If not denoted in the entity input.}
+\item{downloadFile}{Optional. Whether associated files(s) should be downloaded.
+ Defaults to TRUE.}
+\item{downloadLocation}{Optional. Directory where to download the Synapse File Entity.
+ Defaults to the local cache.}
+\item{followLink}{Optional. Whether the link returns the target Entity.
+ Defaults to FALSE.}
+\item{ifcollision}{Optional. Determines how to handle file collisions.
+ May be "overwrite.local", "keep.local", or "keep.both".
+ Defaults to "keep.both".}
+\item{limitSearch}{Optional. A Synanpse ID used to limit the search in Synapse if entity is specified as a local
+ file. That is, if the file is stored in multiple locations in Synapse only the ones
+ in the specified folder/project will be returned.}
+\item{md5}{Optional. The MD5 checksum for the file, if known. Otherwise if the file is a
+ local file, it will be calculated automatically.}
}
+
\value{
- A new Synapse Entity object of the appropriate type
+A new Synapse Entity object of the appropriate type.
}
%
-% Verified that the following works on 2018Jan11.
+% Verified that the following works on 2024June28.
%
\examples{
\dontrun{
@@ -49,6 +46,10 @@ file <- synGet('syn1906479')
print(file$properties$name)
print(file$path)
+## download a specific version of a file
+file <- synGet('syn1906479', version=1)
+print(file$versionLabel)
+
## to access the file's metadata without downloading the file
file <- synGet("syn1906479", downloadFile = FALSE)
md5 <- file$get("md5")
diff --git a/man/synGetTeamOpenInvitations.Rd b/man/synGetTeamOpenInvitations.Rd
index 20d46cfe..b09fdfa3 100644
--- a/man/synGetTeamOpenInvitations.Rd
+++ b/man/synGetTeamOpenInvitations.Rd
@@ -5,18 +5,16 @@
synGetTeamOpenInvitations
}
\description{
-Retrieve the open requests submitted to a Team
-https://docs.synapse.org/rest/GET/team/id/openInvitation.html
+Retrieve the open requests submitted to a \href{https://rest-docs.synapse.org/rest/GET/team/id/openInvitation.html}{Team}
}
\usage{
synGetTeamOpenInvitations(team)
}
\arguments{
-\item{team}{ A Team object or a\cr
- team's ID.}
+\item{team}{A Team object or a team's ID.}
}
\value{
- generator of MembershipRequest
+Generator of MembershipRequest dictionaries
}
diff --git a/man/synLogin.Rd b/man/synLogin.Rd
index c25b3b76..2b155dbb 100644
--- a/man/synLogin.Rd
+++ b/man/synLogin.Rd
@@ -6,49 +6,48 @@ synLogin
}
\description{
Logs the user in.
+
+If no login arguments are provided or only username is provided, login() will attempt to log in using
+ information from these sources (in order of preference):
+\enumerate{
+\item synapseConfig file (in user home folder unless configured otherwise)\cr
+\item User defined arguments during a CLI session\cr
+\item User's Personal Access Token (aka: Synapse Auth Token) from the environment variable: SYNAPSE_AUTH_TOKEN\cr
+\item Retrieves user's authentication token from AWS SSM Parameter store (if configured)\cr
+}
}
\usage{
-synLogin(email=NULL, password=NULL, apiKey=NULL, sessionToken=NULL, rememberMe=FALSE, silent=FALSE, forced=FALSE)
+synLogin(email=NULL, silent=FALSE, authToken=NULL, cache_client=TRUE)
}
\arguments{
-\item{email}{ Synapse user name (or an email address associated with a Synapse account)\cr
-}
-\item{password}{ **!!WILL BE DEPRECATED!!** password. Please use authToken (Synapse personal access token)\cr
-}
-\item{apiKey}{ **!!WILL BE DEPRECATED!!** Base64 encoded Synapse API key\cr
+\item{email}{ Synapse user name (or an email address associated with a Synapse account). Defaults to NULL.\cr
}
-\item{sessionToken}{ **!!DEPRECATED FIELD!!** User's current session token. Using this field will ignore the following fields: email, password, apiKey\cr
+\item{silent}{ Suppresses the "Welcome ...!" message. Defaults to FALSE. \cr
}
-\item{rememberMe}{ Whether the authentication information should be cached in your operating system's credential storage.\cr
+\item{authToken}{ A bearer authorization token, e.g. a personal access token, can be used in lieu of a\cr
+ password or apiKey}
+\item{cache_client}{Whether to cache the Synapse client object in the Synapse module. Defaults to TRUE. When set to TRUE anywhere a Synapse object is optional you do not need to pass an instance of Synapse to that function, method, or class.}
+\item{rememberMe}{ \bold{DEPRECATED}. Whether the authentication information should be cached in your operating system's credential storage.\cr
**GNOME Keyring** (recommended) or **KWallet** is recommonded to be installed for credential storage on **Linux** systems.\cr
If it is not installed/setup, credentials will be stored as PLAIN-TEXT file with read and write permissions for the current user only (chmod 600).\cr
On Windows and Mac OS, a default credentials storage exists so it will be preferred over the plain-text file.\cr
}
-\item{silent}{ Defaults to FALSE. Suppresses the "Welcome ...!" message.\cr
+\item{password}{ \bold{DEPRECATED}. Please use authToken (Synapse personal access token)\cr
}
-\item{forced}{ Defaults to FALSE. Bypass the credential cache if set.}
-
-\item{authToken}{ A bearer authorization token, e.g. a personal access token, can be used in lieu of a\cr
- password or apiKey}
+\item{apiKey}{ \bold{DEPRECATED}. Base64 encoded Synapse API key\cr
+}
+\item{sessionToken}{ \bold{DEPRECATED}. User's current session token. Using this field will ignore the following fields: email, password, apiKey\cr
}
-\details{
-Valid combinations of login() arguments:\cr
-\cr
-- email/username and password (**WILL BE DEPRECATED**)\cr
-- email/username and apiKey (Base64 encoded string) (**WILL BE DEPRECATED**)\cr
-- authToken\cr
-- sessionToken (**DEPRECATED**)\cr
-If no login arguments are provided or only username is provided, login() will attempt to log in using information from these sources (in order of preference):\cr
-- User's personal access token from environment the variable: SYNAPSE_AUTH_TOKEN\cr
-- .synapseConfig file (in user home folder unless configured otherwise)\cr
-- cached credentials from previous `login()` where `rememberMe=True` was passed as a parameter\cr
+\item{forced}{ \bold{DEPRECATED}. Defaults to FALSE. Bypass the credential cache if set.}
+
+
}
+%
+% Verified that the following works on 2024June28.
+%
\examples{
\dontrun{
-# with username/pass
-synLogin('myUsername', 'secretPassword')
-
# with a token, e.g. an access obtained from your Synapse profile
synLogin(authToken=token)
diff --git a/man/synRestDeleteAsync.Rd b/man/synRestDeleteAsync.Rd
new file mode 100644
index 00000000..4d56f5ab
--- /dev/null
+++ b/man/synRestDeleteAsync.Rd
@@ -0,0 +1,41 @@
+\name{synRestDeleteAsync}
+\alias{synRestDeleteAsync}
+\docType{methods}
+\title{
+synRestDeleteAsync
+}
+\description{
+Sends an HTTP DELETE request to the Synapse server.
+}
+\usage{
+synRestDeleteAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+}
+\arguments{
+\item{uri}{URI of resource to be deleted}
+\item{endpoint}{Server endpoint. Defaults to repoEndpoint}
+\item{headers}{Dictionary of headers to use}
+\item{retry_policy}{A retry policy that matches the arguments of \href{https://github.com/Sage-Bionetworks/synapsePythonClient/blob/0310ba9ad39a599b9d2240028a79792b05f45ee1/synapseclient/core/retry.py#L262}{synapseclient.core.retry.with_retry_time_based_async}.}
+\item{requests_session_async_synapse}{The async client to use when making this
+ specific call}
+\item{...}{Any other arguments taken by a \href{https://www.python-httpx.org/api/}{request} method}
+}
+\value{
+Null
+}
+%
+% Verified that the following works on 2024July2.
+%
+\examples{
+\dontrun{
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine
+result <- run_coroutine(synRestDeleteAsync(uri="/entity/Docker
Bruce Hoff
- 2024-02-04
+ 2024-08-01
Source: vignettes/docker.Rmd
docker.Rmd
Installation
Tom Yu
- 2024-02-04
+ 2024-08-01
Source: vignettes/installation.Rmd
installation.Rmd
Manage Synapse Credentials
Tom Yu
- 2024-02-04
+ 2024-08-01
Source: vignettes/manageSynapseCredentials.Rmd
manageSynapseCredentials.Rmd
Synapse R Client Overview
Bruce Hoff
- 2024-02-04
+ 2024-08-01
Source: vignettes/synapser.Rmd
synapser.Rmd
Accessing DataView the entity’s metadata in the R console:
print(fileEntity)
-## File(id='syn53468047', etag='92ba143c-226b-421a-9ac3-3992742831b1', modifiedBy='3324230', versionLabel='1', isLatestVersion=True, name='file8d8159001777', versionComment='Some sort of comment about the new version of the file.', synapseStore=True, _file_handle={'id': '132873000', 'etag': '276042e9-0ec1-4bd7-8dfe-3edc5d00b7a9', 'createdBy': '3324230', 'createdOn': '2024-02-04T19:31:46.000Z', 'modifiedOn': '2024-02-04T19:31:46.000Z', 'concreteType': 'org.sagebionetworks.repo.model.file.S3FileHandle', 'contentType': 'application/octet-stream', 'contentMd5': '8465d33d9f407ef250ce519e92f300fb', 'fileName': 'file8d8159001777', 'storageLocationId': 1, 'contentSize': 23, 'status': 'AVAILABLE', 'bucketName': 'proddata.sagebase.org', 'key': '3324230/2e56b45e-7227-4624-ba7b-8c1f043b8bbd/file8d8159001777', 'isPreview': False, 'externalURL': None}, versionNumber=1, cacheDir='/var/folders/67/ghxb0p_j4r5gjj95l9z3502c0000gq/T/RtmpxF8ZnS', path='/var/folders/67/ghxb0p_j4r5gjj95l9z3502c0000gq/T/RtmpxF8ZnS/file8d8159001777', createdBy='3324230', createdOn='2024-02-04T19:31:46.346Z', parentId='syn53468046', dataFileHandleId='132873000', files=['file8d8159001777'], concreteType='org.sagebionetworks.repo.model.FileEntity', modifiedOn='2024-02-04T19:31:46.346Z')
This is one simple way to read in a small matrix (we load just the first few rows):
@@ -292,7 +292,7 @@Organizing Data in a Project## [1] "Data" ## ## [[1]]$id -## [1] "syn53468048" +## [1] "syn61936059" ## ## [[1]]$type ## [1] "org.sagebionetworks.repo.model.Folder" @@ -307,27 +307,27 @@
Organizing Data in a Project## [1] TRUE ## ## [[1]]$benefactorId -## [1] 53468046 +## [1] 61936057 ## ## [[1]]$createdOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## [[1]]$modifiedOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## [[1]]$createdBy -## [1] "3324230" +## [1] "3434599" ## ## [[1]]$modifiedBy -## [1] "3324230" +## [1] "3434599" ## ## ## [[2]] ## [[2]]$name -## [1] "file8d8159001777" +## [1] "file5d9a34d94eef" ## ## [[2]]$id -## [1] "syn53468047" +## [1] "syn61936058" ## ## [[2]]$type ## [1] "org.sagebionetworks.repo.model.FileEntity" @@ -342,19 +342,19 @@
Organizing Data in a Project## [1] TRUE ## ## [[2]]$benefactorId -## [1] 53468046 +## [1] 61936057 ## ## [[2]]$createdOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## [[2]]$modifiedOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## [[2]]$createdBy -## [1] "3324230" +## [1] "3434599" ## ## [[2]]$modifiedBy -## [1] "3324230"
You can also filter by type:
filesAndFolders <- synGetChildren(project$properties$id, includeTypes = c("file", "folder"))
@@ -364,7 +364,7 @@ Organizing Data in a Project## [1] "Data"
##
## [[1]]$id
-## [1] "syn53468048"
+## [1] "syn61936059"
##
## [[1]]$type
## [1] "org.sagebionetworks.repo.model.Folder"
@@ -379,27 +379,27 @@ Organizing Data in a Project## [1] TRUE
##
## [[1]]$benefactorId
-## [1] 53468046
+## [1] 61936057
##
## [[1]]$createdOn
-## [1] "2024-02-04T19:31:47.353Z"
+## [1] "2024-08-01T16:24:18.830Z"
##
## [[1]]$modifiedOn
-## [1] "2024-02-04T19:31:47.353Z"
+## [1] "2024-08-01T16:24:18.830Z"
##
## [[1]]$createdBy
-## [1] "3324230"
+## [1] "3434599"
##
## [[1]]$modifiedBy
-## [1] "3324230"
+## [1] "3434599"
##
##
## [[2]]
## [[2]]$name
-## [1] "file8d8159001777"
+## [1] "file5d9a34d94eef"
##
## [[2]]$id
-## [1] "syn53468047"
+## [1] "syn61936058"
##
## [[2]]$type
## [1] "org.sagebionetworks.repo.model.FileEntity"
@@ -414,19 +414,19 @@ Organizing Data in a Project## [1] TRUE
##
## [[2]]$benefactorId
-## [1] 53468046
+## [1] 61936057
##
## [[2]]$createdOn
-## [1] "2024-02-04T19:31:46.346Z"
+## [1] "2024-08-01T16:24:17.543Z"
##
## [[2]]$modifiedOn
-## [1] "2024-02-04T19:31:46.346Z"
+## [1] "2024-08-01T16:24:17.543Z"
##
## [[2]]$createdBy
-## [1] "3324230"
+## [1] "3434599"
##
## [[2]]$modifiedBy
-## [1] "3324230"
You can avoid reading all children into memory at once by iterating through one at a time:
@@ -443,7 +443,7 @@Organizing Data in a Project## [1] "Data" ## ## $id -## [1] "syn53468048" +## [1] "syn61936059" ## ## $type ## [1] "org.sagebionetworks.repo.model.Folder" @@ -458,25 +458,25 @@
Organizing Data in a Project## [1] TRUE ## ## $benefactorId -## [1] 53468046 +## [1] 61936057 ## ## $createdOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## $modifiedOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## $createdBy -## [1] "3324230" +## [1] "3434599" ## ## $modifiedBy -## [1] "3324230" +## [1] "3434599" ## ## $name -## [1] "file8d8159001777" +## [1] "file5d9a34d94eef" ## ## $id -## [1] "syn53468047" +## [1] "syn61936058" ## ## $type ## [1] "org.sagebionetworks.repo.model.FileEntity" @@ -491,19 +491,19 @@
Organizing Data in a Project## [1] TRUE ## ## $benefactorId -## [1] 53468046 +## [1] 61936057 ## ## $createdOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## $modifiedOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## $createdBy -## [1] "3324230" +## [1] "3434599" ## ## $modifiedBy -## [1] "3324230" +## [1] "3434599" ## ## [1] "Reached end of list."
You can move files to a different parent:
@@ -530,7 +530,7 @@In addition to simple data storage, Synapse entities can be annotated with key/value metadata, described in markdown documents (wikis), and linked together in provenance graphs to create a reproducible record of @@ -703,13 +703,13 @@
To learn more about writing an evaluation query, please see: http://docs.synapse.org/rest/GET/evaluation/submission/query.html
For more information, please see:
@@ -822,13 +873,13 @@Sharing Access to Contentacl <- synSetPermissions(project, principalId = 273949, accessType = list("READ")) acl ## $id -## [1] "syn53468051" +## [1] "syn61936062" ## ## $creationDate -## [1] "2024-02-04T19:31:53.162Z" +## [1] "2024-08-01T16:24:22.686Z" ## ## $etag -## [1] "fcd01110-b0b7-4f7b-9fa2-630b4fa3b072" +## [1] "2990bf07-085e-42d1-b985-13fcce8ac7c8" ## ## $resourceAccess ## $resourceAccess[[1]] @@ -841,12 +892,12 @@
Sharing Access to Content## ## $resourceAccess[[2]] ## $resourceAccess[[2]]$principalId -## [1] 3324230 +## [1] 3434599 ## ## $resourceAccess[[2]]$accessType -## [1] "CHANGE_SETTINGS" "CREATE" "MODERATE" -## [4] "DELETE" "UPDATE" "CHANGE_PERMISSIONS" -## [7] "READ" "DOWNLOAD"
Now public can read:
synGetAcl(project, principal_id = 273950)
diff --git a/docs/articles/systemDependencies.html b/docs/articles/systemDependencies.html
index dac3b180..367737a8 100644
--- a/docs/articles/systemDependencies.html
+++ b/docs/articles/systemDependencies.html
@@ -33,7 +33,7 @@
vignettes/systemDependencies.Rmd
systemDependencies.Rmd
vignettes/tables.Rmd
tables.Rmd
table <- synBuildTable("My Favorite Genes", project, genes)
table$schema
-## Schema(columns_to_store=[{'name': 'Name', 'columnType': 'STRING', 'maximumSize': 30, 'defaultValue': '', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Chromosome', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Start', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'End', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Strand', 'columnType': 'STRING', 'maximumSize': 30, 'defaultValue': '', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'TranscriptionFactor', 'columnType': 'BOOLEAN', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Time', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}], concreteType='org.sagebionetworks.repo.model.table.TableEntity', name='My Favorite Genes', parentId='syn53468053', columnIds=[])
synBuildTable
creates a Table Schema based on the data
and returns a Table object that can be stored in Synapse using
synStore()
. To create a custom Table Schema, defines the
@@ -189,20 +189,14 @@
We now have a table populated with data. Let’s try to query:
-results <- synTableQuery(sprintf('select * from %s where Chromosome=1 and Start < 41000 and "End" > 20000', tableId))
results <- synTableQuery(sprintf('select * from %s where Chromosome=1 and Start < 41000 and "End" > 20000', tableId), resultsAs = 'csv')
synTableQuery()
downloads the data and saves it to a csv
file at location:
results$filepath
To load the data into an R data.frame:
-as.data.frame(results)
-## ROW_ID ROW_VERSION Name Chromosome Start End Strand TranscriptionFactor
-## 1 1 1 foo 1 12345 126000 + FALSE
-## 2 4 1 bah 1 40444 41444 - FALSE
-## Time
-## 1 2017-02-14 03:23:11
-## 2 2020-11-02 20:59:59
df <- as.data.frame(results)
For example, let’s update the names of some of our favorite genes:
@@ -253,14 +247,14 @@Changing Data## 7 7 2 abc 2 12345 126000 + FALSE ## 8 8 2 def 2 20001 20200 + FALSE ## Time -## 1 2017-02-14 03:23:11 -## 2 1969-12-31 16:00:00 -## 3 2018-09-30 17:00:00 -## 4 2020-11-02 20:59:59 -## 5 2011-12-15 22:23:11 -## 6 1999-03-18 13:03:33 -## 7 2070-01-11 19:53:12 -## 8 2018-05-03 05:03:33
One other piece of information required for making changes to tables is the etag, which is used by the Synapse server to prevent concurrent users from making conflicting changes through a technique called @@ -370,14 +364,14 @@
Dates may also be submitted in timestamp milliseconds:
results <- synTableQuery(sprintf("select * from %s where Name='zap'", tableId))
df <- as.data.frame(results)
df$Time <- timestamp
synStore(Table(tableId, moreGenes))
-## <synapseclient.table.CsvFileTable object at 0x15a3ec410>
Note that using POSIXlt
is strongly preferred over
POSIXct
, because POSIXct
does not store values
with enough precision to reliably recover milliseconds. For more
@@ -422,7 +416,7 @@
To view annotations on table, retrieve the schema:
schema <- synGet(tableId)
diff --git a/docs/articles/troubleshooting.html b/docs/articles/troubleshooting.html
index 9c255391..210c862c 100644
--- a/docs/articles/troubleshooting.html
+++ b/docs/articles/troubleshooting.html
@@ -33,7 +33,7 @@
vignettes/troubleshooting.Rmd
troubleshooting.Rmd
vignettes/upload.Rmd
upload.Rmd
vignettes/views.Rmd
views.Rmd
To see the content of your newly created View, use synTableQuery():
-queryResults <- synTableQuery(sprintf("select * from %s", view$properties$id))
-data <- as.data.frame(queryResults)
-data
-## ROW_ID ROW_VERSION ROW_ETAG id
-## 1 53468060 1 e322e8c5-fed8-4d0a-a886-70ed89bbdee0 syn53468060
-## 2 53468061 1 ff0c5d37-a5ef-4122-871f-fdc2bd1d7b7c syn53468061
+queryResults <- synTableQuery(sprintf("select * from %s", view$properties$id))
+data <- as.data.frame(queryResults)
+data
## ROW_ID ROW_VERSION ROW_ETAG id
+## 1 61936088 1 24b535f4-5dc4-452c-8f2f-273b0a1065ba syn61936088
+## 2 61936090 1 9f61a946-506d-4c38-80c1-ad416a66c662 syn61936090
## name description createdOn createdBy
-## 1 file8f65792ab9d0 NA 2024-02-04 11:33:37 3324230
-## 2 file8f65640d44d5 NA 2024-02-04 11:33:39 3324230
-## etag modifiedOn modifiedBy type
-## 1 e322e8c5-fed8-4d0a-a886-70ed89bbdee0 2024-02-04 11:33:37 3324230 file
-## 2 ff0c5d37-a5ef-4122-871f-fdc2bd1d7b7c 2024-02-04 11:33:39 3324230 file
+## 1 file5f68b331f1c <NA> 2024-08-01 16:25:59 3434599
+## 2 file5f68516c0850 <NA> 2024-08-01 16:25:59 3434599
+## etag modifiedOn modifiedBy
+## 1 24b535f4-5dc4-452c-8f2f-273b0a1065ba 2024-08-01 16:25:59 3434599
+## 2 9f61a946-506d-4c38-80c1-ad416a66c662 2024-08-01 16:26:00 3434599
+## path type
+## 1 My unique project 30ebf9058adab6f606eec173f5a6c485/file5f68b331f1c file
+## 2 My unique project 30ebf9058adab6f606eec173f5a6c485/file5f68516c0850 file
## currentVersion parentId benefactorId projectId dataFileHandleId
-## 1 1 syn53468059 syn53468059 syn53468059 132873036
-## 2 1 syn53468059 syn53468059 syn53468059 132873037
+## 1 1 syn61936087 syn61936087 syn61936087 145242556
+## 2 1 syn61936087 syn61936087 syn61936087 145242558
## dataFileName dataFileSizeBytes dataFileMD5Hex
-## 1 file8f65792ab9d0 37 47dfe7f5eaa49a5413c7b79b67ab9c43
-## 2 file8f65640d44d5 38 ba01e01b9e3ffea3ebef95efa62998b0
+## 1 file5f68b331f1c 37 47dfe7f5eaa49a5413c7b79b67ab9c43
+## 2 file5f68516c0850 38 ba01e01b9e3ffea3ebef95efa62998b0
## dataFileConcreteType dataFileBucket
## 1 org.sagebionetworks.repo.model.file.S3FileHandle proddata.sagebase.org
## 2 org.sagebionetworks.repo.model.file.S3FileHandle proddata.sagebase.org
## dataFileKey contributor
-## 1 3324230/ce0802d8-a5a5-4650-9f0a-6396351e5ad0/file8f65792ab9d0 UW
-## 2 3324230/bf547068-10d8-4ca7-9ae0-dcdf28b16643/file8f65640d44d5 UW
+## 1 3434599/79ca9df2-76d2-4e5a-b6fe-85300911ef39/file5f68b331f1c UW
+## 2 3434599/6d00c029-74de-45e5-95ae-ba19858ff3b9/file5f68516c0850 UW
## class rank
-## 1 NA X
-## 2 NA X
+## 1 <NA> X
+## 2 <NA> X
To update ‘class’ annotation for ‘file2’, simply update the view:
-+The change in annotations is reflected in synGetAnnotations():
-@@ -81,6 +81,36 @@+synGetAnnotations(file2$properties$id)
A unique etag is associated with every file that updates when changes are made to a file, including the contents, annotations, or metadata. Any updates pushed to Synapse will change an object’s etag.
-+data$etag
There may be cases where you want to update the annotations on a subset of files in a view. In order to preserve the etag, and thus the file history, you will need to store only the rows that have been modified.
-diff --git a/docs/news/index.html b/docs/news/index.html index 17557418..beb7aab0 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@Update View’s Content
A view can contain different types of entity. To change the types of entity that will show up in a view:
-@@ -105,13 +105,13 @@+A View is a Table. Please visit Tables vignettes to see how to change schema, update content, and other operations that can be done on View.
-diff --git a/docs/authors.html b/docs/authors.html index 7cb501bc..b1f7c07e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@+synDelete(project) ## NULL
Citation
Hoff B (2024). synapser: R Language Bindings for Synapse API. -R package version 2.0.0, https://www.synapse.org. +R package version 2.1.0, https://www.synapse.org.
@Manual{, title = {synapser: R Language Bindings for Synapse API}, author = {Bruce Hoff}, year = {2024}, - note = {R package version 2.0.0}, + note = {R package version 2.1.0}, url = {https://www.synapse.org}, }diff --git a/docs/index.html b/docs/index.html index 13817776..02528275 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,7 +33,7 @@Changelog
Source:NEWS.md
synCreateTeam
and synDeleteTeam
have been added to manage team.synRestGetAsync
, synRestDeleteAsync
, synRestPostAsync
and synRestPutAsync
have been added to allow interaction with Synapse server utilizing asynchronous models.~/.synapseConfig
file.rememberMe
has been deprecated in synLogin
.synGet
and synSetProvenance
.Project
.synStore
.synCreateExternalS3FileHandle
.Represents a project in Synapse.
-Projects in Synapse must be uniquely named. Trying to create a project with -a name that's already taken, say 'My project', will result in an error
+Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say +'My project', will result in an error
An R6 class object.
+name: The name of the project
alias: The project alias for use in friendly project urls
properties: A map of Synapse properties
annotations: A map of user defined annotations
local_state: Internal use only
Represents a project in Synapse.
-Projects in Synapse must be uniquely named. Trying to create a project with -a name that's already taken, say 'My project', will result in an error
+Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say +'My project', will result in an error
Project(name=NULL, properties=NULL, annotations=NULL)
Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL)
The name of the project
The name of the project
A named list/vector of Synapse properties. The only valid property name is 'alias'.
A map of Synapse properties
A named list/vector of user defined annotations.
A map of user defined annotations
Internal use only
The project alias for use in friendly project urls
if (FALSE) {
-project <- Project('Foobarbat project', properties=c(alias='foobarbat'), annotations=c(foo='bar', bat=101))
+project <- Project('Foobarbat ddd project', properties=list(alias='foobarbat'), annotations=list(foo='bar', bat=101))
project <- synStore(project)
project$properties
project$annotations$foo
diff --git a/docs/reference/Row-class.html b/docs/reference/Row-class.html
index a226d225..b30a6a9f 100644
--- a/docs/reference/Row-class.html
+++ b/docs/reference/Row-class.html
@@ -17,7 +17,7 @@
synCreateStorageLocationSetting()
synCreateStorageLocationSetting
synCreateTeam
synDeleteProvenance()
synDeleteProvenance
synDeleteTeam
synRestDELETE()
synRestDELETE
synRestDeleteAsync
synRestGET
synRestGetAsync
synRestPUT()
synRestPUT
synRestPostAsync
synRestPutAsync
synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL)
synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL, md5=NULL)
Name of the S3 bucket
Name of the S3 bucket
S3 key of the uploaded object
S3 key of the uploaded object
Local path of the uploaded file
Local path of the uploaded file
Parent entity to create the file handle in, the file handle will be created
- in the default storage location of the parent. Mutually exclusive with
- storage_location_id
Parent entity to create the file handle in, the file handle will be created + in the default storage location of the parent. Mutually exclusive with + storage_location_id
Explicit storage location id to create the file handle in, mutually exclusive
- with parent
Explicit storage location id to create the file handle in, mutually exclusive + with parent
Mimetype of the file, if known
MD5 of the file, if known
If neither parent nor storage_location_id is specified, or if both are specified.
+synCreateTeam.Rd
Creates a new team
+synCreateTeam(name, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE)
The name of the team to create.
A description of the team.
The FileHandleID of the icon to be used for the team.
Whether the team can be joined by anyone. Defaults to FALSE.
Whether the team can request membership. Defaults to TRUE.
An Team object
+if (FALSE) {
+synCreateTeam('your_team_name')
+}
+
synDeleteTeam.Rd
Deletes a team
+synDeleteTeam(id)
The ID of the team to delete.
NULL
+if (FALSE) {
+synDeleteTeam('your_team_id')
+}
+
synGet(entity, version=NULL, downloadFile=NULL, downloadLocation=NULL, followLink=NULL, ifcollision=NULL, limitSearch=NULL)
synGet(entity)
A Synapse ID, a Synapse Entity object,
- a named list in which 'id' maps to a Synapse ID or
- a local file that is stored in Synapse (found by hash of file)
A Synapse ID (e.g. syn123 or syn123.1, with .1 denoting version), a Synapse Entity object, + a plain dictionary in which 'id' maps to a Synapse ID or a local file that is stored in + Synapse (found by the file MD5)
optional named parameter: The specific version to get.
- Defaults to the most recent version.
Optional. The specific version to get. + Defaults to the most recent version. If not denoted in the entity input.
optional named parameter: Whether associated files(s) should be downloaded.
- Defaults to TRUE
Optional. Whether associated files(s) should be downloaded. + Defaults to TRUE.
optional named parameter: Directory where to download the Synapse File Entity.
- Defaults to the local cache.
Optional. Directory where to download the Synapse File Entity. + Defaults to the local cache.
optional named parameter: Whether the link returns the target Entity.
- Defaults to FALSE
Optional. Whether the link returns the target Entity. + Defaults to FALSE.
optional named parameter: Determines how to handle file collisions.
- May be "overwrite.local", "keep.local", or "keep.both".
- Defaults to "keep.both".
Optional. Determines how to handle file collisions. + May be "overwrite.local", "keep.local", or "keep.both". + Defaults to "keep.both".
optional named parameter: a Synanpse ID used to limit the search in Synapse if entity is
- specified as a local file. That is, if the file is stored in multiple
- locations in Synapse only the ones in the specified folder/project will be
- returned.
Optional. A Synanpse ID used to limit the search in Synapse if entity is specified as a local + file. That is, if the file is stored in multiple locations in Synapse only the ones + in the specified folder/project will be returned.
Optional. The MD5 checksum for the file, if known. Otherwise if the file is a + local file, it will be calculated automatically.
A new Synapse Entity object of the appropriate type
+A new Synapse Entity object of the appropriate type.
Retrieve the open requests submitted to a Team -https://docs.synapse.org/rest/GET/team/id/openInvitation.html
+Retrieve the open requests submitted to a Team
A Team object or a
- team's ID.
A Team object or a team's ID.
generator of MembershipRequest
+Generator of MembershipRequest dictionaries
Logs the user in.
-If no login arguments are provided or only username is provided, login() will attempt to log in using + information from these sources (in order of preference):
synapseConfig file (in user home folder unless configured otherwise)
User defined arguments during a CLI session
User's Personal Access Token (aka: Synapse Auth Token) from the environment variable: SYNAPSE_AUTH_TOKEN
Retrieves user's authentication token from AWS SSM Parameter store (if configured)
synLogin(email=NULL, password=NULL, apiKey=NULL, sessionToken=NULL, rememberMe=FALSE, silent=FALSE, forced=FALSE)
synLogin(email=NULL, silent=FALSE, authToken=NULL, cache_client=TRUE)
Synapse user name (or an email address associated with a Synapse account)
Synapse user name (or an email address associated with a Synapse account). Defaults to NULL.
**!!WILL BE DEPRECATED!!** password. Please use authToken (Synapse personal access token)
Suppresses the "Welcome ...!" message. Defaults to FALSE.
**!!WILL BE DEPRECATED!!** Base64 encoded Synapse API key
A bearer authorization token, e.g. a personal access token, can be used in lieu of a
+ password or apiKey
**!!DEPRECATED FIELD!!** User's current session token. Using this field will ignore the following fields: email, password, apiKey
Whether to cache the Synapse client object in the Synapse module. Defaults to TRUE. When set to TRUE anywhere a Synapse object is optional you do not need to pass an instance of Synapse to that function, method, or class.
Whether the authentication information should be cached in your operating system's credential storage.
+
DEPRECATED. Whether the authentication information should be cached in your operating system's credential storage.
**GNOME Keyring** (recommended) or **KWallet** is recommonded to be installed for credential storage on **Linux** systems.
If it is not installed/setup, credentials will be stored as PLAIN-TEXT file with read and write permissions for the current user only (chmod 600).
On Windows and Mac OS, a default credentials storage exists so it will be preferred over the plain-text file.
Defaults to FALSE. Suppresses the "Welcome ...!" message.
DEPRECATED. Please use authToken (Synapse personal access token)
DEPRECATED. Base64 encoded Synapse API key
DEPRECATED. User's current session token. Using this field will ignore the following fields: email, password, apiKey
Defaults to FALSE. Bypass the credential cache if set.
DEPRECATED. Defaults to FALSE. Bypass the credential cache if set.
A bearer authorization token, e.g. a personal access token, can be used in lieu of a
- password or apiKey
Valid combinations of login() arguments:
-- email/username and password (**WILL BE DEPRECATED**)
-- email/username and apiKey (Base64 encoded string) (**WILL BE DEPRECATED**)
-- authToken
-- sessionToken (**DEPRECATED**)
-If no login arguments are provided or only username is provided, login() will attempt to log in using information from these sources (in order of preference):
-- User's personal access token from environment the variable: SYNAPSE_AUTH_TOKEN
-- .synapseConfig file (in user home folder unless configured otherwise)
-- cached credentials from previous `login()` where `rememberMe=True` was passed as a parameter
if (FALSE) {
-# with username/pass
-synLogin('myUsername', 'secretPassword')
-
# with a token, e.g. an access obtained from your Synapse profile
synLogin(authToken=token)
diff --git a/docs/reference/synLogout.html b/docs/reference/synLogout.html
index b1ec1c1b..e2ffc3e8 100644
--- a/docs/reference/synLogout.html
+++ b/docs/reference/synLogout.html
@@ -17,7 +17,7 @@
synRestDeleteAsync.Rd
Sends an HTTP DELETE request to the Synapse server.
+synRestDeleteAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI of resource to be deleted
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call
Any other arguments taken by a request method
Null
+if (FALSE) {
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine
+result <- run_coroutine(synRestDeleteAsync(uri="/entity/<your_entity_id>"))
+}
+
synRestGetAsync.Rd
Sends an HTTP GET request to the Synapse server.
+synRestGetAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI on which get is performed
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call.
Any other arguments taken by a request method
JSON encoding of response
+if (FALSE) {
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine
+result <- run_coroutine(synRestGetAsync(uri="/entity/entity_id"))
+}
+
synRestPostAsync.Rd
Sends an HTTP POST request to the Synapse server.
+synRestPostAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI on which get is performed
The payload to be delivered
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call.
Any other arguments taken by a request method
JSON encoding of response
+if (FALSE) {
+library(jsonlite)
+# create payload
+request <- list(includeEntity = TRUE)
+body <- toJSON(request, auto_unbox = TRUE)
+
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine to get the bundle
+result <- run_coroutine(synRestPostAsync(uri="/entity/entity_id/bundle2",body=body))
+}
+
synRestPutAsync.Rd
Sends an HTTP PUT request to the Synapse server.
+synRestPutAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI on which get is performed
The payload to be delivered
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call.
Any other arguments taken by a request method
JSON encoding of response
+if (FALSE) {
+library(jsonlite)
+# create payload
+request <- list(includeEntity = TRUE)
+body <- toJSON(request, auto_unbox = TRUE)
+
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine to get the entity bundle
+entity_bundle <- run_coroutine(synRestPostAsync(uri="/entity/entity_id/bundle2",body=body))
+
+# update a field on the entity
+entity_bundle$entity$description <- "NEW_DESCRIPTION"
+
+# update the entity back to Synapse
+request <- list(entity = entity_bundle$entity)
+body <- toJSON(request, auto_unbox = TRUE)
+updated_entity_bundle = run_coroutine(synRestPutAsync(uri=paste0("/entity/",entity_bundle$entity$id,"/bundle2"), body=body))
+}
+
An Entity or Synapse ID to modify
Identifier of a user or group
Identifier of a user or group. '273948' is for all registered Synapse users
+ and '273949' is for public access. None implies public access.
Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE, DELETE, CHANGE_PERMISSIONS
Set as TRUE when modifying a benefactor's ACL
Set as FALSE, when creating a new ACL.
- Trying to modify the ACL of an Entity that
- inherits its ACL will result in a warning
Set as FALSE, when creating a new ACL. + Trying to modify the ACL of an Entity that inherits its ACL will result in a warning
By default this function overwrites existing
- permissions for the specified user. Set this
- flag to FALSE to add new permissions nondestructively.
By default this function overwrites existing permissions for the specified user. + Set this flag to FALSE to add new permissions non-destructively.
an Access Control List object
+An Access Control List object
synStore(obj, used=NULL, executed=NULL, activity=NULL, activityName=NULL, activityDescription=NULL, createOrUpdate=NULL, forceVersion=NULL, versionLabel=NULL, isRestricted=NULL)
synStore(obj, createOrUpdate=TRUE, forceVersion=TRUE, versionLabel=NULL, isRestricted=FALSE, activity=NULL, used=NULL, executed=NULL, activityName=NULL, activityDescription=NULL, set_annotations=TRUE)
A Synapse Entity, Evaluation, or Wiki
A Synapse Entity, Evaluation, or Wiki.
optional named parameter: The Entity, Synapse ID, or URL
- used to create the object (can also be a list of these)
Optional. The Entity, Synapse ID, or URL used to create the object (can also be a list of these.
optional named parameter: The Entity, Synapse ID, or URL representing code executed
- to create the object (can also be a list of these)
Optional. The Entity, Synapse ID, or URL representing code executed to create the object + (can also be a list of these).
optional named parameter: Activity object specifying the user's provenance
Optional. Activity object specifying the user's provenance.
optional named parameter: Activity name to be used in conjunction with *used* and *executed*.
Optional. Activity name to be used in conjunction with used and executed.
optional named parameter: Activity description to be used in conjunction with *used* and *executed*.
Optional. Activity description to be used in conjunction with used and executed.
optional named parameter: Indicates whether the method should automatically perform an update if the 'obj'
- conflicts with an existing Synapse object. Defaults to TRUE.
Optional. Indicates whether the method should automatically perform an update if the 'obj'
+ conflicts with an existing Synapse object. Defaults to TRUE.
optional named parameter: Indicates whether the method should increment the version of the object even if
- nothing has changed. Defaults to TRUE.
Optional. Indicates whether the method should increment the version of the object even if
+ nothing has changed. Defaults to TRUE.
optional named parameter: Arbitrary string used to label the version.
Optional. Arbitrary string used to label the version.
optional named parameter: If set to true, an email will be sent to the Synapse access control team
- to start the process of adding terms-of-use
- or review board approval for this entity.
- You will be contacted with regards to the specific data being restricted
- and the requirements of access.
Optional.If set to TRUE, an email will be sent to the Synapse access control team to start the + process of adding terms-of-use or review board approval for this entity. + You will be contacted with regards to the specific data being restricted and the + requirements of access. Defaults to FALSE.
If TRUE, set the annotations on the entity. If FALSE, do not set the annotations. Defaults to TRUE.
if (FALSE) {
# Create a new project
+
project <- Project('My uniquely named project')
project <- synStore(project)
@@ -152,21 +154,19 @@ Examples
# A synapse entity *syn1906480* contains data
# entity *syn1917825* contains code
#
-activity <- Activity(
- 'Fancy Processing',
- description='No seriously, really fancy processing',
- used=c('syn1906480', 'http://data_r_us.com/fancy/data.txt'),
- executed='syn1917825')
+activity <- Activity('Fancy Processing',
+ description='No seriously, really fancy processing',
+ used=c('syn1906480', 'http://data_r_us.com/fancy/data.txt'),
+ executed='syn1917825')
file <- File('/path/to/data/file.xyz', description='Fancy new data', parent=project)
file <- synStore(file, activity=activity)
# Evaluation
-eval <- Evaluation(
- name = sprintf("My unique evaluation created on %s", format(Sys.time(), "%a %b %d %H%M%OS4 %Y")),
- description = "testing",
- contentSource = project$properties$id,
- submissionReceiptMessage = "Thank you for your submission!",
- submissionInstructionsMessage = "This evaluation only accepts files.")
+eval <- Evaluation(name =sprintf("My unique evaluation created on %s", format(Sys.time(), "%a %b %d %H%M%OS4 %Y")),
+ description = "testing",
+ contentSource = project$properties$id,
+ submissionReceiptMessage = "Thank you for your submission!",
+ submissionInstructionsMessage = "This evaluation only accepts files.")
eval <- synStore(eval)
# Wiki
@@ -175,10 +175,10 @@ Examples
Here is a description of my **fantastic** project!
"
-
-wiki <- Wiki(owner = project,
- title = "My Wiki Page",
- markdown = content)
+wiki = Wiki(title='My Wiki Page',
+ owner=project,
+ markdown=content,
+ attachments=list('/path/to/logo.png'))
wiki <- synStore(wiki)
}