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/")) +} +} + + diff --git a/man/synRestGetAsync.Rd b/man/synRestGetAsync.Rd new file mode 100644 index 00000000..f0a14f2e --- /dev/null +++ b/man/synRestGetAsync.Rd @@ -0,0 +1,39 @@ +\name{synRestGetAsync} +\alias{synRestGetAsync} +\docType{methods} +\title{ +synRestGetAsync +} +\description{ +Sends an HTTP GET request to the Synapse server. +} +\usage{ +synRestGetAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL) +} +\arguments{ +\item{uri}{URI on which get is performed} +\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{ +JSON encoding of response +} +% +% 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(synRestGetAsync(uri="/entity/entity_id")) +} +} diff --git a/man/synRestPostAsync.Rd b/man/synRestPostAsync.Rd new file mode 100644 index 00000000..9dc51535 --- /dev/null +++ b/man/synRestPostAsync.Rd @@ -0,0 +1,45 @@ +\name{synRestPostAsync} +\alias{synRestPostAsync} +\docType{methods} +\title{ +synRestPostAsync +} +\description{ +Sends an HTTP POST request to the Synapse server. +} +\usage{ +synRestPostAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL) +} +\arguments{ +\item{uri}{URI on which get is performed} +\item{body}{The payload to be delivered} +\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{ +JSON encoding of response +} +% +% Verified that the following works on 2024July2. +% +\examples{ +\dontrun{ +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)) +} +} diff --git a/man/synRestPutAsync.Rd b/man/synRestPutAsync.Rd new file mode 100644 index 00000000..a39daf61 --- /dev/null +++ b/man/synRestPutAsync.Rd @@ -0,0 +1,53 @@ +\name{synRestPutAsync} +\alias{synRestPutAsync} +\docType{methods} +\title{ +synRestPutAsync +} +\description{ +Sends an HTTP PUT request to the Synapse server. +} +\usage{ +synRestPutAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL) +} +\arguments{ +\item{uri}{URI on which get is performed} +\item{body}{The payload to be delivered} +\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{ +JSON encoding of response +} +% +% Verified that the following works on 2024July3. +% +\examples{ +\dontrun{ +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)) +} +} diff --git a/man/synSetPermissions.Rd b/man/synSetPermissions.Rd index 3a7a71ce..30444f45 100644 --- a/man/synSetPermissions.Rd +++ b/man/synSetPermissions.Rd @@ -14,29 +14,29 @@ synSetPermissions(entity, principalId=NULL, accessType=list("READ", "DOWNLOAD"), \arguments{ \item{entity}{ An Entity or Synapse ID to modify\cr } -\item{principalId}{ Identifier of a user or group\cr +\item{principalId}{ Identifier of a user or group. '273948' is for all registered Synapse users + and '273949' is for public access. None implies public access.\cr } \item{accessType}{ Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE, DELETE, CHANGE_PERMISSIONS\cr } \item{modify_benefactor}{ Set as TRUE when modifying a benefactor's ACL\cr } -\item{warn_if_inherits}{ Set as FALSE, when creating a new ACL.\cr - Trying to modify the ACL of an Entity that\cr - inherits its ACL will result in a warning\cr +\item{warn_if_inherits}{ 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 } -\item{overwrite}{ By default this function overwrites existing\cr - permissions for the specified user. Set this\cr - flag to FALSE to add new permissions nondestructively.} +\item{overwrite}{ By default this function overwrites existing permissions for the specified user. + Set this flag to FALSE to add new permissions non-destructively.} } \value{ - an Access Control List object + An Access Control List object } % -% Verified that the following works on 2018Jan23. +% Verified that the following works on 2024July2. % \examples{ \dontrun{ -synSetPermissions("syn11705401", 273950, c("READ", "DOWNLOAD")) +# assign the Public group "can read"" permission to the entity +synSetPermissions("entity_id", 273949, list("READ")) } } diff --git a/man/synStore.Rd b/man/synStore.Rd index 37ed9c51..f95e6eab 100644 --- a/man/synStore.Rd +++ b/man/synStore.Rd @@ -9,42 +9,41 @@ Creates a new Entity or updates an existing Entity, uploading any files in the process. } \usage{ -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) } \arguments{ -\item{obj}{ A Synapse Entity, Evaluation, or Wiki\cr +\item{obj}{A Synapse Entity, Evaluation, or Wiki. } -\item{used}{optional named parameter: The Entity, Synapse ID, or URL\cr - used to create the object (can also be a list of these)\cr +\item{used}{Optional. The Entity, Synapse ID, or URL used to create the object (can also be a list of these. } -\item{executed}{optional named parameter: The Entity, Synapse ID, or URL representing code executed\cr - to create the object (can also be a list of these)\cr +\item{executed}{Optional. The Entity, Synapse ID, or URL representing code executed to create the object + (can also be a list of these). } -\item{activity}{optional named parameter: Activity object specifying the user's provenance\cr +\item{activity}{Optional. Activity object specifying the user's provenance. } -\item{activityName}{optional named parameter: Activity name to be used in conjunction with *used* and *executed*.\cr +\item{activityName}{Optional. Activity name to be used in conjunction with \emph{used} and \emph{executed}. } -\item{activityDescription}{optional named parameter: Activity description to be used in conjunction with *used* and *executed*.\cr +\item{activityDescription}{Optional. Activity description to be used in conjunction with \emph{used} and \emph{executed}. } -\item{createOrUpdate}{optional named parameter: Indicates whether the method should automatically perform an update if the 'obj'\cr - conflicts with an existing Synapse object. Defaults to TRUE.\cr +\item{createOrUpdate}{Optional. Indicates whether the method should automatically perform an update if the 'obj' + conflicts with an existing Synapse object. Defaults to TRUE.\cr } -\item{forceVersion}{optional named parameter: Indicates whether the method should increment the version of the object even if\cr - nothing has changed. Defaults to TRUE.\cr +\item{forceVersion}{Optional. Indicates whether the method should increment the version of the object even if\cr + nothing has changed. Defaults to TRUE.\cr } -\item{versionLabel}{optional named parameter: Arbitrary string used to label the version.\cr +\item{versionLabel}{Optional. Arbitrary string used to label the version. } -\item{isRestricted}{optional named parameter: If set to true, an email will be sent to the Synapse access control team\cr - to start the process of adding terms-of-use\cr - or review board approval for this entity.\cr - You will be contacted with regards to the specific data being restricted\cr - and the requirements of access.} +\item{isRestricted}{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.} +\item{set_annotations}{If TRUE, set the annotations on the entity. If FALSE, do not set the annotations. Defaults to TRUE.} } \value{ A Synapse Entity, Evaluation, or Wiki } % -% Verified that the following works on 2018Jan17. +% Verified that the following works on 2024June28. % \examples{ \dontrun{ @@ -57,21 +56,19 @@ project <- synStore(project) # 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 @@ -80,10 +77,10 @@ content <- " 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) } } diff --git a/tests/testthat/test_table.R b/tests/testthat/test_table.R index 1cddd58c..544ae513 100644 --- a/tests/testthat/test_table.R +++ b/tests/testthat/test_table.R @@ -14,13 +14,13 @@ test_that("data.frame can be written to and read from csv consistently (except d expect_equal("character", class(b)) expect_is(c, "POSIXt") df <- data.frame(a, b, c) - + file <- tempfile() .saveToCsv(df, file) df2 <- .readCsv(file) - + expectedC <- as.numeric(c) * 1000 # Dates are converted to timestamp and then formatted in standard notation - + expect_equal(a, df2$a) expect_equal(b, df2$b) expect_equal(expectedC, df2$c) @@ -29,12 +29,12 @@ test_that("data.frame can be written to and read from csv consistently (except d test_that("empty data.frame can be written to and read from csv consistently", { df <- data.frame() expect_equal("data.frame", class(df)) - + file <- tempfile() cat("some text", file) .saveToCsv(df, file) df2 <- .readCsv(file) - + expect_equal(df, df2) }) @@ -45,22 +45,33 @@ test_that("Table() takes r data.frame", { expect_equal("numeric", class(a)) expect_equal("character", class(b)) df <- data.frame(a , b) - + table <- Table(tableId, df) - df2 <- table$asDataFrame() - + df2 <- synapser::as.data.frame(table) + attr(df2, "pandas.index") <- NULL + df2 <- data.frame(df2) + df2$a <- as.numeric(df2$a) + df2$b <- as.character(df2$b) + expect_is(df2, "data.frame") - expect_equal(a, df2$a) - expect_equal(b, df2$b) + expect_equal(df, df2) }) test_that("Table() takes an empty r data.frame", { tableId <- "syn123" - df <- data.frame() + # create an empty dataframe + columns= c("test_col") + df = data.frame(matrix(nrow = 0, ncol = length(columns))) + # assign column names + colnames(df) = columns + # convert all columns to character columns + df <- data.frame(lapply(df, as.character), stringsAsFactors = FALSE) expect_equal("data.frame", class(df)) - + + # create a Table object and convert it to dataframe table <- Table(tableId, df) - df2 <- table$asDataFrame() + df2 <- synapser::as.data.frame(table) + df2 <- data.frame(lapply(df2, as.character), stringsAsFactors = FALSE) expect_is(df2, "data.frame") expect_true(all.equal(df, df2, check.attributes=F)) }) @@ -72,14 +83,20 @@ test_that("Table() takes a file path", { expect_equal("numeric", class(a)) expect_equal("character", class(b)) df <- data.frame(a , b) - + # convert all columns to character columns + df <- data.frame(lapply(df, as.character), stringsAsFactors = FALSE) + temp <- tempfile() .saveToCsv(df, temp) table <- Table(tableId, temp) - df2 <- table$asDataFrame() + df2 <- synapser::as.data.frame(table) + # convert all columns to character columns + df2 <- data.frame(lapply(df2, as.character), stringsAsFactors = FALSE) + expect_is(df2, "data.frame") - expect_equal(a, df2$a) - expect_equal(b, df2$b) + expect_equal(df$a, df2$a) + expect_equal(df$b, df2$b) + }) test_that("as.data.frame works for CsvFileTable", { @@ -89,7 +106,7 @@ test_that("as.data.frame works for CsvFileTable", { expect_equal("numeric", class(a)) expect_equal("character", class(b)) df <- data.frame(a , b) - + table <- Table(tableId, df) df2 <- as.data.frame(table) expect_is(df2, "data.frame") @@ -100,12 +117,12 @@ test_that("as.data.frame works for CsvFileTable", { test_that(".convertPOSIXToCharacterTimestamp converts POSIX to timestamp in ms", { origin <- "1970-01-01" list <- as.POSIXlt(c(1538005437.242, 123.042, NA), origin = origin, tz = "UTC") - + # The conversion will change POSIX into a character of the numeric value, times 1000 (milliseconds) expected <- as.character(c(1538005437242, 123042, NA)) - + actual <- .convertPOSIXToCharacterTimestamp(list) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -115,9 +132,9 @@ test_that(".convertToRType works for BOOLEAN", { list <- c("true", "false", NA) type <- "BOOLEAN" expected <- c(T, F, NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "logical") expect_equal(expected, actual) }) @@ -126,12 +143,12 @@ test_that(".convertToRType works for DATE", { list <- c("1538005437242", "123042", NA) type <- "DATE" origin <- "1970-01-01" - + # The conversion will change millis into seconds expected <- as.POSIXlt(c(1538005437.242, 123.042, NA), origin = origin, tz="UTC") - + actual <- .convertToRType(list, type) - + expect_is(actual, "POSIXlt") expect_equal(expected, actual) }) @@ -139,11 +156,11 @@ test_that(".convertToRType works for DATE", { test_that(".convertToRType works for INTEGER", { list <- c("1242", "-2482", NA) type <- "INTEGER" - + expected <- c(1242, -2482, NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "integer") expect_equal(expected, actual) }) @@ -151,11 +168,11 @@ test_that(".convertToRType works for INTEGER", { test_that(".convertToRType works for INTEGER outside of the bounds of max integer", { list <- c(as.character(.Machine$integer.max + 1), "4", NA) type <- "INTEGER" - + expected <- c(.Machine$integer.max + 1, 4, NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "numeric") expect_false(is(actual, "integer")) expect_equal(expected, actual) @@ -164,11 +181,11 @@ test_that(".convertToRType works for INTEGER outside of the bounds of max intege test_that(".convertToRType works for STRING", { list <- c("42", "24.24", NA, "NULL", "NA", "") type <- "STRING" - + expected <- c("42", "24.24", NA, "NULL", "NA", "") - + actual <- .convertToRType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -176,11 +193,11 @@ test_that(".convertToRType works for STRING", { test_that(".convertToRType works for FILEHANDLEID", { list <- c("30150852", NA) type <- "FILEHANDLEID" - + expected <- c("30150852", NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -188,11 +205,11 @@ test_that(".convertToRType works for FILEHANDLEID", { test_that(".convertToRType works for ENTITYID", { list <- c("syn30150852", NA) type <- "ENTITYID" - + expected <- c("syn30150852", NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -201,11 +218,11 @@ test_that(".convertToRType works for LINK", { # Links are not required to be semantically valid, and are essentially treated the same as STRING list <- c("google.com", "yahoo,net.", NA, "NULL", "NA") type <- "LINK" - + expected <- c("google.com", "yahoo,net.", NA, "NULL", "NA") - + actual <- .convertToRType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -214,11 +231,11 @@ test_that(".convertToRType works for LARGETEXT", { # LARGETEXT is essentially treated the same as STRING list <- c("Long text", "test", NA, "NULL", "NA") type <- "LARGETEXT" - + expected <- c("Long text", "test", NA, "NULL", "NA") - + actual <- .convertToRType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -226,11 +243,11 @@ test_that(".convertToRType works for LARGETEXT", { test_that(".convertToRType works for USERID", { list <- c("273954", "273950", NA) type <- "USERID" - + expected <- c("273954", "273950", NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -238,11 +255,11 @@ test_that(".convertToRType works for USERID", { test_that(".convertToRType works for DOUBLE", { list <- c("3", "900", "", NA) type <- "DOUBLE" - + expected <- c(3.0, 900.0, NA, NA) - + actual <- .convertToRType(list, type) - + expect_is(actual, "numeric") expect_equal(expected, actual) }) @@ -251,9 +268,9 @@ test_that(".convertToSynapseType works for BOOLEAN", { list <- c("true", "false", NA) type <- "BOOLEAN" expected <- c(T, F, NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "logical") expect_equal(expected, actual) }) @@ -262,12 +279,12 @@ test_that(".convertToSynapseType works for DATE for POSIX", { origin <- "1970-01-01" list <- as.POSIXlt(c(1538005437.242, 123.042, NA), origin = origin, tz="UTC") type <- "DATE" - + # The conversion will change POSIX into a character of the numeric value, times 1000 (milliseconds) expected <- trimws(as.numeric(c(1538005437242, 123042, NA))) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -276,10 +293,10 @@ test_that(".convertToSynapseType works for DATE for numeric", { list <- c(1538005437242, 123042, NA) type <- "DATE" origin <- "1970-01-01" - + # The conversion shouldn't change anything; numeric implies timestamp actual <- .convertToSynapseType(list, type) - + expect_is(actual, "numeric") expect_equal(list, actual) }) @@ -287,11 +304,11 @@ test_that(".convertToSynapseType works for DATE for numeric", { test_that(".convertToSynapseType works for INTEGER", { list <- c("1242", "-2482", NA) type <- "INTEGER" - + expected <- c(1242, -2482, NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "integer") expect_equal(expected, actual) }) @@ -299,11 +316,11 @@ test_that(".convertToSynapseType works for INTEGER", { test_that(".convertToSynapseType works for INTEGER outside of the bounds of max integer", { list <- c(as.character(.Machine$integer.max + 1), "4", NA) type <- "INTEGER" - + expected <- c(.Machine$integer.max + 1, 4, NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "numeric") expect_false(is(actual, "integer")) expect_equal(expected, actual) @@ -312,11 +329,11 @@ test_that(".convertToSynapseType works for INTEGER outside of the bounds of max test_that(".convertToSynapseType works for STRING", { list <- c("42", "24.24", NA, "NULL", "NA", "") type <- "STRING" - + expected <- c("42", "24.24", NA, "NULL", "NA", "") - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -324,11 +341,11 @@ test_that(".convertToSynapseType works for STRING", { test_that(".convertToSynapseType works for FILEHANDLEID", { list <- c("30150852", NA) type <- "FILEHANDLEID" - + expected <- c("30150852", NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -336,11 +353,11 @@ test_that(".convertToSynapseType works for FILEHANDLEID", { test_that(".convertToSynapseType works for ENTITYID", { list <- c("syn30150852", NA) type <- "ENTITYID" - + expected <- c("syn30150852", NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -349,11 +366,11 @@ test_that(".convertToSynapseType works for LINK", { # Links are not required to be semantically valid, and are essentially treated the same as STRING list <- c("google.com", "yahoo,net.", NA, "NULL", "NA") type <- "LINK" - + expected <- c("google.com", "yahoo,net.", NA, "NULL", "NA") - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -362,11 +379,11 @@ test_that(".convertToSynapseType works for LARGETEXT", { # LARGETEXT is essentially treated the same as STRING list <- c("Long text", "test", NA, "NULL", "NA") type <- "LARGETEXT" - + expected <- c("Long text", "test", NA, "NULL", "NA") - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -374,11 +391,11 @@ test_that(".convertToSynapseType works for LARGETEXT", { test_that(".convertToSynapseType works for USERID", { list <- c("273954", "273950", NA) type <- "USERID" - + expected <- c("273954", "273950", NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "character") expect_equal(expected, actual) }) @@ -386,11 +403,11 @@ test_that(".convertToSynapseType works for USERID", { test_that(".convertToSynapseType works for DOUBLE", { list <- c("3", "900", "", NA) type <- "DOUBLE" - + expected <- c(3.0, 900.0, NA, NA) - + actual <- .convertToSynapseType(list, type) - + expect_is(actual, "numeric") expect_equal(expected, actual) }) @@ -403,7 +420,7 @@ test_that(".convertToSynapseType and .convertToRType are compatible", { numericDateTest <- c(1538422512435, 4000, NA) stringTest <- c("", "A long string", "NA", NA) doubleTest <- c(1.53, 4.23, NA, .Machine$integer.max + 5) - + # .convertToRType -> .convertToSynapseType expect_equal(booleanTest, .convertToSynapseType(.convertToRType(booleanTest, "BOOLEAN"), "BOOLEAN")) expect_equal(integerTest, .convertToSynapseType(.convertToRType(integerTest, "INTEGER"), "INTEGER")) @@ -411,7 +428,7 @@ test_that(".convertToSynapseType and .convertToRType are compatible", { expect_equal(as.character(numericDateTest), .convertToSynapseType(.convertToRType(numericDateTest, "DATE"), "DATE")) expect_equal(stringTest, .convertToSynapseType(.convertToRType(stringTest, "STRING"), "STRING")) expect_equal(doubleTest, .convertToSynapseType(.convertToRType(doubleTest, "DOUBLE"), "DOUBLE")) - + # .convertToSynapseType -> .convertToRType expect_equal(booleanTest, .convertToRType(.convertToSynapseType(booleanTest, "BOOLEAN"), "BOOLEAN")) expect_equal(integerTest, .convertToRType(.convertToSynapseType(integerTest, "INTEGER"), "INTEGER")) @@ -432,16 +449,16 @@ test_that(".convertToRTypeFromSchema works for a dataframe", { expect_equal("numeric", class(c)) expect_equal("numeric", class(d)) df <- data.frame(a, b, c, d) - + cols <- list( Column(name = "a", columnType = "STRING", enumValues = list("T", "F"), maximumSize = 1), Column(name = "b", columnType = "BOOLEAN"), Column(name = "c", columnType = "DATE"), Column(name = "d", columnType = "INTEGER")) - + schema <- Schema(name = "A Test Table", columns = cols, parent = "syn234") df2 <- .convertToRTypeFromSchema(df, schema$columns_to_store) - + expect_is(df2, "data.frame") expect_equal(a, df2$a) expect_equal(b, df2$b) @@ -460,16 +477,16 @@ test_that(".convertToSynapseTypeFromSchema works for a dataframe", { expect_is(c, "POSIXt") expect_equal("numeric", class(d)) df <- data.frame(a, b, c, d) - + cols <- list( Column(name = "a", columnType = "STRING", enumValues = list("T", "F"), maximumSize = 1), Column(name = "b", columnType = "BOOLEAN"), Column(name = "c", columnType = "DATE"), Column(name = "d", columnType = "INTEGER")) - + schema <- Schema(name = "A Test Table", columns = cols, parent = "syn234") df2 <- .convertToSynapseTypeFromSchema(df, schema$columns_to_store) - + expect_is(df2, "data.frame") expect_equal(a, df2$a) expect_equal(b, df2$b) @@ -488,14 +505,14 @@ test_that(".saveToCsvWithSchema works for empty columns_to_store", { expect_true("POSIXlt" %in% class(c)) expect_equal("numeric", class(d)) df <- data.frame(a, b, c, d) - + schema <- Schema(name = "A Test Table", parent = "syn234") - + file <- tempfile() - + .saveToCsvWithSchema(schema, df, file) df2 <- .readCsv(file) - + expect_is(df2, "data.frame") expect_equal(a, df2$a) expect_equal(b, df2$b) @@ -514,19 +531,19 @@ test_that(".saveToCsvWithSchema converts tables with a schema to a format accept expect_true("POSIXlt" %in% class(c)) expect_equal("numeric", class(d)) df <- data.frame(a, b, c, d) - + cols <- list( Column(name = "a", columnType = "STRING", enumValues = list("T", "F"), maximumSize = 1), Column(name = "b", columnType = "BOOLEAN"), Column(name = "c", columnType = "DATE"), Column(name = "d", columnType = "DATE")) - + schema <- Schema(name = "A Test Table", columns = cols, parent = "syn234") file <- tempfile() - + .saveToCsvWithSchema(schema, df, file) df2 <- .readCsv(file) - + expect_is(df2, "data.frame") expect_equal(a, df2$a) expect_equal(b, df2$b) @@ -539,9 +556,9 @@ test_that(".saveToCsvWithSchema writes Integers over R max integer limit without a = c(0, -10, .Machine$integer.max + 1) expect_equal("numeric", class(a)) df <- data.frame(a) - + cols <- list(Column(name = "a", columnType = "INTEGER")) - + schema <- Schema(name = "A Test Table", columns = cols, parent = "syn234") file <- tempfile() .saveToCsvWithSchema(schema, df, file) @@ -564,9 +581,9 @@ test_that("CsvFileTable without a schema does not modify values that would be mo expect_is(c, "POSIXt") expect_equal("numeric", class(d)) df <- data.frame(a, b, c, d) - + table <- Table(tableId, df) - + df2 <- as.data.frame(table) expect_is(df2, "data.frame") # expect_equal(as.logical(a), df2$a) # R will assume these are logical and coerce @@ -587,16 +604,16 @@ test_that("CsvFileTable with a schema is properly converted to appropriate data expect_is(c, "POSIXt") expect_equal("numeric", class(d)) df <- data.frame(a, b, c, d) - + cols <- list( Column(name = "a", columnType = "STRING", enumValues = list("T", "F"), maximumSize = 1), Column(name = "b", columnType = "BOOLEAN"), Column(name = "c", columnType = "DATE"), Column(name = "d", columnType = "DATE")) - + schema <- Schema(name = "A Test Table", columns = cols, parent = "syn234") table <- Table(schema, df) - + df2 <- as.data.frame(table) expect_is(df2, "data.frame") # expect_equal(a, df2$a) @@ -615,9 +632,9 @@ test_that("as.data.frame coerces types appropriately when using synBuildTable", expect_is(b, "POSIXt") expect_equal("numeric", class(c)) df <- data.frame(a, b, c) - + table <- synBuildTable(tableId, "project", df) - + df2 <- as.data.frame(table) expect_is(df2, "data.frame") # expect_equal(a, df2$a) # R will assume these are logical and coerce @@ -631,9 +648,9 @@ test_that(".extractColumnTypes works on schema columns", { Column(name = "b", columnType = "BOOLEAN"), Column(name = "c", columnType = "DATE"), Column(name = "d", columnType = "DOUBLE")) - + schema <- Schema(name = "A Test Schema", columns = cols, parent = "syn234") - + types <- .extractColumnTypes(schema$columns_to_store) expect_equal(types, c("STRING", "BOOLEAN", "DATE", "DOUBLE")) }) @@ -644,9 +661,9 @@ test_that(".extractColumnNames works on schema columns", { Column(name = "b", columnType = "BOOLEAN", name = "Name 2"), Column(name = "c", columnType = "DATE", name = "A third name"), Column(name = "d", columnType = "DOUBLE", name = "4")) - + schema <- Schema(name = "A Test Schema", columns = cols, parent = "syn234") - + types <- .extractColumnNames(schema$columns_to_store) expect_equal(types, c("A name", "Name 2", "A third name", "4")) }) diff --git a/tools/installPythonClient.R b/tools/installPythonClient.R index 5b956247..1fa1bf46 100644 --- a/tools/installPythonClient.R +++ b/tools/installPythonClient.R @@ -5,19 +5,19 @@ # Author: bhoff ############################################################################### -PYTHON_CLIENT_VERSION <- '4.0.0' +PYTHON_CLIENT_VERSION <- '4.4.0' args <- commandArgs(trailingOnly = TRUE) baseDir<-args[1] if (is.null(baseDir) || is.na(baseDir) || !file.exists(baseDir)) { - stop(paste("baseDir", baseDir, "is invalid")) + stop(paste("baseDir", baseDir, "is invalid")) } print("*** Using Python Configuration:") # reticulate::virtualenv_create('r-reticulate') -# reticulate::use_virtualenv('r-reticulate') +#reticulate::use_virtualenv('r-reticulate') reticulate::py_config() reticulate::py_run_string("import sys") reticulate::py_run_string(sprintf("sys.path.append(\"%s\")", file.path(baseDir, "inst", "python"))) -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) diff --git a/vignettes/tables.Rmd b/vignettes/tables.Rmd index b8d69f60..a018b36d 100644 --- a/vignettes/tables.Rmd +++ b/vignettes/tables.Rmd @@ -76,7 +76,7 @@ The Table() function takes two arguments, a schema object, or a Table ID and dat We now have a table populated with data. Let’s try to query: ```{r collapse=TRUE} -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: @@ -86,7 +86,7 @@ results$filepath To load the data into an R data.frame: ```{r collapse=TRUE} -as.data.frame(results) +df <- as.data.frame(results) ``` ## Changing Data diff --git a/vignettes/views.Rmd b/vignettes/views.Rmd index a1105231..6717deb7 100644 --- a/vignettes/views.Rmd +++ b/vignettes/views.Rmd @@ -80,6 +80,8 @@ Sys.sleep(10) To see the content of your newly created View, use synTableQuery(): ```{r collapse=TRUE} queryResults <- synTableQuery(sprintf("select * from %s", view$properties$id)) +``` +```{r} data <- as.data.frame(queryResults) data ``` From 598bd5b5fd7688e500d5e450117e3e2fb4e25795 Mon Sep 17 00:00:00 2001 From: danlu1 Date: Thu, 1 Aug 2024 16:32:27 +0000 Subject: [PATCH 02/16] update package description and changelog --- DESCRIPTION | 6 +- NEWS.md | 25 +++ docs/404.html | 2 +- docs/ISSUE_TEMPLATE.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/docker.html | 4 +- docs/articles/index.html | 2 +- docs/articles/installation.html | 4 +- docs/articles/manageSynapseCredentials.html | 4 +- docs/articles/synapser.html | 203 +++++++++++------- docs/articles/systemDependencies.html | 4 +- docs/articles/tables.html | 42 ++-- docs/articles/troubleshooting.html | 4 +- docs/articles/upload.html | 4 +- docs/articles/views.html | 60 +++--- docs/authors.html | 6 +- docs/index.html | 2 +- docs/news/index.html | 32 ++- docs/pkgdown.yml | 4 +- docs/reference/Activity-class.html | 2 +- docs/reference/Activity.html | 2 +- docs/reference/Column-class.html | 2 +- docs/reference/Column.html | 2 +- docs/reference/Dataset-class.html | 2 +- docs/reference/Dataset.html | 2 +- docs/reference/DockerRepository-class.html | 2 +- docs/reference/DockerRepository.html | 2 +- docs/reference/EntityViewSchema-class.html | 2 +- docs/reference/EntityViewSchema.html | 2 +- docs/reference/Evaluation-class.html | 2 +- docs/reference/Evaluation.html | 2 +- docs/reference/File-class.html | 2 +- docs/reference/File.html | 2 +- docs/reference/Folder-class.html | 2 +- docs/reference/Folder.html | 2 +- docs/reference/Link-class.html | 2 +- docs/reference/Link.html | 2 +- .../MaterializedViewSchema-class.html | 2 +- docs/reference/MaterializedViewSchema.html | 2 +- docs/reference/PartialRowset-class.html | 2 +- docs/reference/PartialRowset.html | 2 +- docs/reference/Project-class.html | 30 ++- docs/reference/Project.html | 26 ++- docs/reference/Row-class.html | 2 +- docs/reference/Row.html | 2 +- docs/reference/RowSet-class.html | 2 +- docs/reference/RowSet.html | 2 +- docs/reference/Schema-class.html | 2 +- docs/reference/Schema.html | 2 +- docs/reference/Submission-class.html | 2 +- docs/reference/Submission.html | 2 +- docs/reference/SubmissionStatus-class.html | 2 +- docs/reference/SubmissionStatus.html | 2 +- .../reference/SubmissionViewSchema-class.html | 2 +- docs/reference/SubmissionViewSchema.html | 2 +- docs/reference/Table.html | 2 +- docs/reference/Team-class.html | 2 +- docs/reference/Team.html | 2 +- docs/reference/TeamMember-class.html | 2 +- docs/reference/TeamMember.html | 2 +- docs/reference/UserGroupHeader-class.html | 2 +- docs/reference/UserGroupHeader.html | 2 +- docs/reference/UserProfile-class.html | 2 +- docs/reference/UserProfile.html | 2 +- docs/reference/Wiki-class.html | 2 +- docs/reference/Wiki.html | 2 +- docs/reference/as.list.html | 2 +- docs/reference/index.html | 26 ++- docs/reference/nextElem.html | 2 +- docs/reference/synBuildTable.html | 2 +- docs/reference/synClearDownloadList.html | 2 +- docs/reference/synCreateColumn.html | 2 +- docs/reference/synCreateColumns.html | 2 +- .../synCreateExternalS3FileHandle.html | 30 +-- .../reference/synCreateS3StorageLocation.html | 2 +- docs/reference/synCreateSnapshotVersion.html | 2 +- .../synCreateStorageLocationSetting.html | 2 +- docs/reference/synCreateTeam.html | 148 +++++++++++++ docs/reference/synDelete.html | 2 +- docs/reference/synDeleteProvenance.html | 2 +- docs/reference/synDeleteTeam.html | 136 ++++++++++++ docs/reference/synDownloadTableColumns.html | 2 +- docs/reference/synFindEntityId.html | 2 +- docs/reference/synGet.html | 49 +++-- docs/reference/synGetAnnotations.html | 2 +- docs/reference/synGetChildren.html | 2 +- docs/reference/synGetColumn.html | 2 +- docs/reference/synGetColumns.html | 2 +- docs/reference/synGetConfigFile.html | 2 +- docs/reference/synGetDownloadList.html | 2 +- .../reference/synGetDownloadListManifest.html | 2 +- docs/reference/synGetEvaluation.html | 2 +- .../synGetEvaluationByContentSource.html | 2 +- docs/reference/synGetEvaluationByName.html | 2 +- docs/reference/synGetMembershipStatus.html | 2 +- .../synGetMyStorageLocationSetting.html | 2 +- docs/reference/synGetPermissions.html | 2 +- docs/reference/synGetProjectSetting.html | 2 +- docs/reference/synGetProvenance.html | 2 +- docs/reference/synGetStsStorageToken.html | 2 +- docs/reference/synGetSubmission.html | 2 +- docs/reference/synGetSubmissionBundles.html | 2 +- docs/reference/synGetSubmissionStatus.html | 2 +- docs/reference/synGetSubmissions.html | 2 +- docs/reference/synGetTableColumns.html | 2 +- docs/reference/synGetTeam.html | 2 +- docs/reference/synGetTeamMembers.html | 2 +- docs/reference/synGetTeamOpenInvitations.html | 13 +- docs/reference/synGetUserProfile.html | 2 +- docs/reference/synGetWiki.html | 2 +- docs/reference/synGetWikiAttachments.html | 2 +- docs/reference/synGetWikiHeaders.html | 2 +- docs/reference/synInvalidateAPIKey.html | 2 +- docs/reference/synInviteToTeam.html | 2 +- docs/reference/synIsCertified.html | 2 +- docs/reference/synLogin.html | 68 +++--- docs/reference/synLogout.html | 2 +- docs/reference/synMd5Query.html | 2 +- docs/reference/synMove.html | 2 +- docs/reference/synOnweb.html | 2 +- docs/reference/synPrintEntity.html | 2 +- docs/reference/synRemoveFromDownloadList.html | 2 +- docs/reference/synRestDELETE.html | 2 +- docs/reference/synRestDeleteAsync.html | 159 ++++++++++++++ docs/reference/synRestGET.html | 2 +- docs/reference/synRestGetAsync.html | 159 ++++++++++++++ docs/reference/synRestPOST.html | 2 +- docs/reference/synRestPUT.html | 2 +- docs/reference/synRestPostAsync.html | 167 ++++++++++++++ docs/reference/synRestPutAsync.html | 175 +++++++++++++++ .../synSendMembershipInvitation.html | 2 +- docs/reference/synSendMessage.html | 2 +- docs/reference/synSetAnnotations.html | 2 +- docs/reference/synSetEndpoints.html | 2 +- docs/reference/synSetPermissions.html | 20 +- docs/reference/synSetProvenance.html | 2 +- docs/reference/synSetStorageLocation.html | 2 +- docs/reference/synStore.html | 70 +++--- docs/reference/synSubmit.html | 2 +- docs/reference/synTableQuery.html | 2 +- docs/reference/synUpdateActivity.html | 2 +- docs/reference/synUploadFileHandle.html | 2 +- docs/reference/synapser-package.html | 2 +- docs/sitemap.xml | 18 ++ 144 files changed, 1525 insertions(+), 399 deletions(-) create mode 100644 docs/reference/synCreateTeam.html create mode 100644 docs/reference/synDeleteTeam.html create mode 100644 docs/reference/synRestDeleteAsync.html create mode 100644 docs/reference/synRestGetAsync.html create mode 100644 docs/reference/synRestPostAsync.html create mode 100644 docs/reference/synRestPutAsync.html diff --git a/DESCRIPTION b/DESCRIPTION index 15cd4e78..674b5ed6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ Package: synapser Type: Package Title: R Language Bindings for Synapse API -Version: 2.0.0 -Date: 2022-01-18 +Version: 2.1.0 +Date: 2024-07-31 Authors@R: c( person("Tom", "Yu", role = c("cre"), email = "thomas.yu@sagebase.org"), person("Bruce", "Hoff", role = c("aut"), email = "bruce.hoff@sagebase.org"), person("Sage Bionetworks", role = c("cph")) ) -Maintainer: Bruce Hoff +Maintainer: Dan Lu BugReports: https://github.com/Sage-Bionetworks/synapser/issues Description: Provides R language bindings for Synapse RESTful web services. Encoding: UTF-8 diff --git a/NEWS.md b/NEWS.md index e296af27..be9458b7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,28 @@ +## synapser 2.1.0 + +### Improvements + +* Upgraded to the synapsePythonClient v4.4.0. +* The data upload and download algorithm in synapsePythonClient have been revamped for enhanced stability, reliability, and performance. +* Updated reference documents and code examples for both new and modified functions. + +#### New Functions +* `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](https://python-docs.synapse.org/reference/oop/models_async/) models. + +#### Minor behavior changes: +* Credentials passed by command line argument will now be evaluated before credentials stored in the `~/.synapseConfig` file. +* `rememberMe` has been deprecated in `synLogin`. +* Using syn123.version notation is now supported with `synGet` and `synSetProvenance`. +* File entities will no longer have their version incremented during no-op changes. Only when file content, or fields on the file has been updated will a version number be incremented. +* New parameters have been added to allow more features: + + Defining the project alias used in project url is now supported in `Project`. + + Setting the annotations on the entity is now supported in `synStore`. + + The MD5 of the file can now be used when creating S3 file handle in `synCreateExternalS3FileHandle`. + + +For more changes, please view the [Release Notes](https://python-docs.synapse.org/news/) on the Python client documentation. + ## synapser 2.0.0 ### Improvements diff --git a/docs/404.html b/docs/404.html index 755784f7..c766b764 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index e22ea78e..b94dd22f 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 2f106fb6..7cf6c58e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/articles/docker.html b/docs/articles/docker.html index bef2005c..f40e4385 100644 --- a/docs/articles/docker.html +++ b/docs/articles/docker.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

Docker

Bruce Hoff

-

2024-02-04

+

2024-08-01

Source: vignettes/docker.Rmd diff --git a/docs/articles/index.html b/docs/articles/index.html index 121dca34..1b85dad2 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/articles/installation.html b/docs/articles/installation.html index 1ed65b3d..784998e4 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

Installation

Tom Yu

-

2024-02-04

+

2024-08-01

Source: vignettes/installation.Rmd diff --git a/docs/articles/manageSynapseCredentials.html b/docs/articles/manageSynapseCredentials.html index 8534ee84..3c34f4c9 100644 --- a/docs/articles/manageSynapseCredentials.html +++ b/docs/articles/manageSynapseCredentials.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

Manage Synapse Credentials

Tom Yu

-

2024-02-04

+

2024-08-01

Source: vignettes/manageSynapseCredentials.Rmd diff --git a/docs/articles/synapser.html b/docs/articles/synapser.html index c4c58f86..7a2b0dc6 100644 --- a/docs/articles/synapser.html +++ b/docs/articles/synapser.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

Synapse R Client Overview

Bruce Hoff

-

2024-02-04

+

2024-08-01

Source: vignettes/synapser.Rmd @@ -224,7 +224,7 @@

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')
+## File(etag='2b7ad4bd-0d68-492d-b498-0b6ef755ac3f', path='/tmp/Rtmp4S7mb6/file5d9a34d94eef', isLatestVersion=True, modifiedOn='2024-08-01T16:24:17.543Z', parentId='syn61936057', files=['file5d9a34d94eef'], modifiedBy='3434599', createdBy='3434599', concreteType='org.sagebionetworks.repo.model.FileEntity', _file_handle={'id': '145242493', 'etag': 'ef274d17-e94a-416f-9765-7604cda628a8', 'createdBy': '3434599', 'createdOn': '2024-08-01T16:24:17.000Z', 'modifiedOn': '2024-08-01T16:24:17.000Z', 'concreteType': 'org.sagebionetworks.repo.model.file.S3FileHandle', 'contentType': 'application/octet-stream', 'contentMd5': '8465d33d9f407ef250ce519e92f300fb', 'fileName': 'file5d9a34d94eef', 'storageLocationId': 1, 'contentSize': 23, 'status': 'AVAILABLE', 'bucketName': 'proddata.sagebase.org', 'key': '3434599/c5a43b08-60b0-4c68-83e2-022bc7b31cf8/file5d9a34d94eef', 'isPreview': False, 'externalURL': None}, name='file5d9a34d94eef', dataFileHandleId='145242493', versionLabel='1', id='syn61936058', createdOn='2024-08-01T16:24:17.543Z', versionNumber=1, cacheDir='/tmp/Rtmp4S7mb6', versionComment='Some sort of comment about the new version of the file.', synapseStore=True)

This is one simple way to read in a small matrix (we load just the first few rows):

+## [1] "3434599"

You can also filter by type:

+## [1] "3434599"

You can avoid reading all children into memory at once by iterating through one at a time:

You can move files to a different parent:

@@ -530,7 +530,7 @@

Organizing Data in a Project= TRUE ) ## Retrieving a deleted folder causes: Error in value[[3L]](cond): 404 Client Error: -## Entity syn53468048 is in trash can. +## Entity syn61936059 is in trash can.

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 @@

Evaluationseval <- synGetEvaluation(eval$id) eval ## { -## "contentSource": "syn53468051", -## "createdOn": "2024-02-04T19:32:00.421Z", +## "contentSource": "syn61936062", +## "createdOn": "2024-08-01T16:24:26.769Z", ## "description": "testing", -## "etag": "771e6dce-6c45-43c0-b3eb-4adc29621a54", -## "id": "9615529", -## "name": "My unique evaluation created on Sun Feb 04 113200.2679 2024", -## "ownerId": "3324230", +## "etag": "544b9d28-a799-4b5c-a4c7-ce7c59bcc293", +## "id": "9615680", +## "name": "My unique evaluation created on Thu Aug 01 162426.7262 2024", +## "ownerId": "3434599", ## "submissionInstructionsMessage": "This evaluation only accepts files.", ## "submissionReceiptMessage": "Thank you for your submission!" ## } @@ -733,26 +733,26 @@

Evaluations## { ## "contributors": [ ## { -## "createdOn": "2024-02-04T19:32:02.879Z", -## "principalId": "3324230" +## "createdOn": "2024-08-01T16:24:28.114Z", +## "principalId": "3434599" ## } ## ], -## "createdOn": "2024-02-04T19:32:02.879Z", -## "entityBundleJSON": "{\"entity\":{\"name\":\"file8d815491b24e\",\"id\":\"syn53468052\",\"etag\":\"05ef3cbb-ca67-424b-b3b4-0499c4f02ec1\",\"createdOn\":\"2024-02-04T19:32:02.287Z\",\"modifiedOn\":\"2024-02-04T19:32:02.287Z\",\"createdBy\":\"3324230\",\"modifiedBy\":\"3324230\",\"parentId\":\"syn53468051\",\"concreteType\":\"org.sagebionetworks.repo.model.FileEntity\",\"versionNumber\":1,\"versionLabel\":\"1\",\"isLatestVersion\":true,\"dataFileHandleId\":\"132873005\"},\"entityType\":\"file\",\"annotations\":{\"id\":\"syn53468052\",\"etag\":\"00000000-0000-0000-0000-000000000000\",\"annotations\":{}},\"fileHandles\":[{\"id\":\"132873005\",\"etag\":\"0b2f433b-cee8-4f56-8715-9b58f0cd90ec\",\"createdBy\":\"3324230\",\"createdOn\":\"2024-02-04T19:32:02.000Z\",\"modifiedOn\":\"2024-02-04T19:32:02.000Z\",\"concreteType\":\"org.sagebionetworks.repo.model.file.S3FileHandle\",\"contentType\":\"application/octet-stream\",\"contentMd5\":\"3f466b7f85d184292a68cea1c4f7cfc2\",\"fileName\":\"file8d815491b24e\",\"storageLocationId\":1,\"contentSize\":27,\"status\":\"AVAILABLE\",\"bucketName\":\"proddata.sagebase.org\",\"key\":\"3324230/a5ce1154-9c2a-4302-a8d3-a54da0f28cb3/file8d815491b24e\",\"isPreview\":false}]}", -## "entityId": "syn53468052", -## "evaluationId": "9615529", -## "id": "9742381", -## "name": "file8d815491b24e", -## "userId": "3324230", +## "createdOn": "2024-08-01T16:24:28.114Z", +## "entityBundleJSON": "{\"entity\":{\"name\":\"file5d9a22bf6388\",\"id\":\"syn61936063\",\"etag\":\"ab358984-30d8-4dd2-a96b-4d0ed54c08a6\",\"createdOn\":\"2024-08-01T16:24:27.838Z\",\"modifiedOn\":\"2024-08-01T16:24:27.838Z\",\"createdBy\":\"3434599\",\"modifiedBy\":\"3434599\",\"parentId\":\"syn61936062\",\"concreteType\":\"org.sagebionetworks.repo.model.FileEntity\",\"versionNumber\":1,\"versionLabel\":\"1\",\"isLatestVersion\":true,\"dataFileHandleId\":\"145242499\"},\"entityType\":\"file\",\"annotations\":{\"id\":\"syn61936063\",\"etag\":\"00000000-0000-0000-0000-000000000000\",\"annotations\":{}},\"fileHandles\":[{\"id\":\"145242499\",\"etag\":\"b30fa083-de3d-4270-804f-a731cfd93fc1\",\"createdBy\":\"3434599\",\"createdOn\":\"2024-08-01T16:24:28.000Z\",\"modifiedOn\":\"2024-08-01T16:24:28.000Z\",\"concreteType\":\"org.sagebionetworks.repo.model.file.S3FileHandle\",\"contentType\":\"application/octet-stream\",\"contentMd5\":\"3f466b7f85d184292a68cea1c4f7cfc2\",\"fileName\":\"file5d9a22bf6388\",\"storageLocationId\":1,\"contentSize\":27,\"status\":\"AVAILABLE\",\"bucketName\":\"proddata.sagebase.org\",\"key\":\"3434599/b8fba471-4b05-4218-afb9-8dd9880e6508/file5d9a22bf6388\",\"isPreview\":false}]}", +## "entityId": "syn61936063", +## "evaluationId": "9615680", +## "id": "9747721", +## "name": "file5d9a22bf6388", +## "userId": "3434599", ## "versionNumber": 1 ## } ## ## [[1]][[2]] ## { -## "entityId": "syn53468052", -## "etag": "cebe7e14-1704-4230-89c2-1b2fea5815d2", -## "id": "9742381", -## "modifiedOn": "2024-02-04T19:32:02.879Z", +## "entityId": "syn61936063", +## "etag": "5e3cd706-dc34-4f2b-b274-bfaa7ac7460c", +## "id": "9747721", +## "modifiedOn": "2024-08-01T16:24:28.114Z", ## "status": "RECEIVED", ## "statusVersion": 0, ## "submissionAnnotations": {}, @@ -768,10 +768,10 @@

EvaluationssubmissionStatus <- synGetSubmissionStatus(submission) submissionStatus ## { -## "entityId": "syn53468052", -## "etag": "cebe7e14-1704-4230-89c2-1b2fea5815d2", -## "id": "9742381", -## "modifiedOn": "2024-02-04T19:32:02.879Z", +## "entityId": "syn61936063", +## "etag": "5e3cd706-dc34-4f2b-b274-bfaa7ac7460c", +## "id": "9747721", +## "modifiedOn": "2024-08-01T16:24:28.114Z", ## "status": "RECEIVED", ## "statusVersion": 0, ## "submissionAnnotations": {}, @@ -790,13 +790,64 @@

EvaluationsqueryString <- sprintf("query=select * from evaluation_%s LIMIT %s OFFSET %s'", eval$id, 10, 0) synRestGET(paste("/evaluation/submission/query?", URLencode(queryString), sep = "")) ## $headers -## list() +## [1] "scopeId" "entityId" "userId" "createdOn" +## [5] "versionNumber" "modifiedOn" "submitterAlias" "cancelControl" +## [9] "submitterId" "teamId" "name" "cancelRequested" +## [13] "objectId" "status" "canCancel" ## ## $rows -## list() +## $rows[[1]] +## $rows[[1]]$values +## $rows[[1]]$values[[1]] +## [1] "9615680" +## +## $rows[[1]]$values[[2]] +## [1] "syn61936063" +## +## $rows[[1]]$values[[3]] +## [1] "3434599" +## +## $rows[[1]]$values[[4]] +## [1] "1722529468114" +## +## $rows[[1]]$values[[5]] +## [1] "1" +## +## $rows[[1]]$values[[6]] +## [1] "1722529468114" +## +## $rows[[1]]$values[[7]] +## NULL +## +## $rows[[1]]$values[[8]] +## [1] "{\"submissionId\":\"9747721\",\"userId\":\"3434599\",\"canCancel\":false,\"cancelRequested\":false}" +## +## $rows[[1]]$values[[9]] +## [1] "3434599" +## +## $rows[[1]]$values[[10]] +## NULL +## +## $rows[[1]]$values[[11]] +## [1] "file5d9a22bf6388" +## +## $rows[[1]]$values[[12]] +## [1] "false" +## +## $rows[[1]]$values[[13]] +## [1] "9747721" +## +## $rows[[1]]$values[[14]] +## [1] "RECEIVED" +## +## $rows[[1]]$values[[15]] +## [1] "false" +## +## +## ## ## $totalNumberOfResults -## [1] 0 +## [1] 1

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"

+## [1] "READ" "CHANGE_PERMISSIONS" "DOWNLOAD" +## [4] "MODERATE" "CREATE" "DELETE" +## [7] "UPDATE" "CHANGE_SETTINGS"

Now public can read:

@@ -105,7 +105,7 @@

System Dependencies

Tom Yu

-

2024-02-04

+

2024-08-01

Source: vignettes/systemDependencies.Rmd diff --git a/docs/articles/tables.html b/docs/articles/tables.html index 22bbf7f5..a10a6882 100644 --- a/docs/articles/tables.html +++ b/docs/articles/tables.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

Tables

Bruce Hoff

-

2024-02-04

+

2024-08-01

Source: vignettes/tables.Rmd @@ -157,7 +157,7 @@

Tables
 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=[])
+## Schema(columnIds=[], name='My Favorite Genes', concreteType='org.sagebionetworks.repo.model.table.TableEntity', parentId='syn61936067', 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'}])

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 @@

Tables

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)

Changing Data @@ -228,7 +222,7 @@

Changing Data= c(F, F), Time = as.POSIXlt(c("2070-01-12 03:53:12.169", "2018-05-03 12:03:33.464"), tz = "UTC", format = "%Y-%m-%d %H:%M:%OS")) synStore(Table(tableId, moreGenes)) -## <synapseclient.table.CsvFileTable object at 0x15a3e17d0>

+## <synapseclient.table.CsvFileTable object at 0x74741aac9e70>

For example, let’s update the names of some of our favorite genes:

+## 1 2017-02-14 11:23:11 +## 2 1970-01-01 00:00:00 +## 3 2018-10-01 00:00:00 +## 4 2020-11-03 04:59:59 +## 5 2011-12-16 06:23:11 +## 6 1999-03-18 21:03:33 +## 7 2070-01-12 03:53:12 +## 8 2018-05-03 12: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 @@

Notes on Dates and Timesdf <- as.data.frame(results) df$Time <- as.POSIXlt("2015-07-04 05:22", tz = "UTC", format = "%Y-%m-%d %H:%M") synStore(Table(tableId, moreGenes)) -## <synapseclient.table.CsvFileTable object at 0x12760f290> +## <synapseclient.table.CsvFileTable object at 0x74741ab61fc0>

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>
+## <synapseclient.table.CsvFileTable object at 0x74741ab25ed0>

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 @@

Table Attached Files# get the filehandle ids fileHandleIds <- lapply(files, function(f) f$id) newData["covers"] <- fileHandleIds -## Warning in `[<-.data.frame`(`*tmp*`, "covers", value = list("132857711", : +## Warning in `[<-.data.frame`(`*tmp*`, "covers", value = list("144644443", : ## provided 4 variables to replace 1 variables newTable <- synStore(Table(newSchema$properties$id, newData)) @@ -443,7 +437,7 @@

Set Annotationsschema <- synGet(tableId) schema$annotations = list(temp = "test") synStore(schema, forceVersion = FALSE) -## Schema(modifiedBy='3324230', versionLabel='in progress', modifiedOn='2024-02-04T19:33:05.724Z', temp=['test'], versionNumber=1, id='syn53468054', isLatestVersion=True, etag='60e243e3-d8c3-4610-90bf-7781137ab513', columns_to_store=[], concreteType='org.sagebionetworks.repo.model.table.TableEntity', columnIds=['120266', '85771', '120129', '120130', '120267', '120132', '120268', '120269'], versionComment='in progress', name='My Favorite Genes', parentId='syn53468053', createdOn='2024-02-04T19:32:13.263Z', createdBy='3324230') +## Schema(createdBy='3434599', createdOn='2024-08-01T16:24:42.768Z', name='My Favorite Genes', modifiedBy='3434599', versionNumber=1, etag='1e97e544-99c3-41ec-9dd4-2d88c019a6f3', id='syn61936068', columnIds=['120266', '85771', '120129', '120130', '120267', '120132', '120268', '120269'], temp=['test'], concreteType='org.sagebionetworks.repo.model.table.TableEntity', parentId='syn61936067', isLatestVersion=True, versionLabel='in progress', modifiedOn='2024-08-01T16:25:24.479Z', columns_to_store=[], versionComment='in progress')

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 @@
       
       
         synapser
-        2.0.0
+        2.1.0
       
     
@@ -105,7 +105,7 @@

Troubleshooting

Tom Yu

-

2024-02-04

+

2024-08-01

Source: vignettes/troubleshooting.Rmd diff --git a/docs/articles/upload.html b/docs/articles/upload.html index f86aa78c..d2617101 100644 --- a/docs/articles/upload.html +++ b/docs/articles/upload.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

File Upload

Tom Yu

-

2024-02-04

+

2024-08-01

Source: vignettes/upload.Rmd diff --git a/docs/articles/views.html b/docs/articles/views.html index 9d269c3c..4afab14b 100644 --- a/docs/articles/views.html +++ b/docs/articles/views.html @@ -33,7 +33,7 @@ synapser - 2.0.0 + 2.1.0 @@ -105,7 +105,7 @@

Views

Tom Yu

-

2024-02-04

+

2024-08-01

Source: vignettes/views.Rmd @@ -187,70 +187,74 @@

Views

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

Updating Annotations using View

To update ‘class’ annotation for ‘file2’, simply update the view:

-
+
 data["class"] <- c("V", "VI")
 synStore(Table(view$properties$id, data))

The change in annotations is reflected in synGetAnnotations():

-
+
 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.

-
+
 data$contributor[1] <- c("Sage Bionetworks")
 synStore(Table(view$properties$id, data[1,]))
-## <synapseclient.table.CsvFileTable object at 0x14fe4f550>
+## <synapseclient.table.CsvFileTable object at 0x7614993efdc0>

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:

-
+
 view <- synGet(view$properties$id)
 view$set_entity_types(list(EntityViewType$FILE))

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.

-
+
 synDelete(project)
 ## NULL
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 @@ synapser - 2.0.0 + 2.1.0
@@ -105,13 +105,13 @@

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 @@ synapser - 2.0.0 + 2.1.0
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 @@ synapser - 2.0.0 + 2.1.0
@@ -81,6 +81,36 @@

Changelog

Source: NEWS.md
+
+ +
+

Improvements

+
  • Upgraded to the synapsePythonClient v4.4.0.
  • +
  • The data upload and download algorithm in synapsePythonClient have been revamped for enhanced stability, reliability, and performance.
  • +
  • Updated reference documents and code examples for both new and modified functions.
  • +
+

New Functions

+
  • +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.
  • +
+
+

Minor behavior changes:

+
  • Credentials passed by command line argument will now be evaluated before credentials stored in the ~/.synapseConfig file.
  • +
  • +rememberMe has been deprecated in synLogin.
  • +
  • Using syn123.version notation is now supported with synGet and synSetProvenance.
  • +
  • File entities will no longer have their version incremented during no-op changes. Only when file content, or fields on the file has been updated will a version number be incremented.
  • +
  • New parameters have been added to allow more features: +
    • Defining the project alias used in project url is now supported in Project.
    • +
    • Setting the annotations on the entity is now supported in synStore.
    • +
    • The MD5 of the file can now be used when creating S3 file handle in synCreateExternalS3FileHandle.
    • +
  • +
  • For more changes, please view the Release Notes on the Python client documentation.
  • +
+
+
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index f69b09e2..36c78319 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 3.1.11.1 +pandoc: 3.1.1 pkgdown: 2.0.7 pkgdown_sha: ~ articles: @@ -11,5 +11,5 @@ articles: troubleshooting: troubleshooting.html upload: upload.html views: views.html -last_built: 2024-02-04T19:31Z +last_built: 2024-08-01T16:23Z diff --git a/docs/reference/Activity-class.html b/docs/reference/Activity-class.html index 11aa1a58..5c0a831f 100644 --- a/docs/reference/Activity-class.html +++ b/docs/reference/Activity-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/Activity.html b/docs/reference/Activity.html index 0312845e..d23df229 100644 --- a/docs/reference/Activity.html +++ b/docs/reference/Activity.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/Column-class.html b/docs/reference/Column-class.html index 167c3753..65c88b84 100644 --- a/docs/reference/Column-class.html +++ b/docs/reference/Column-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/Column.html b/docs/reference/Column.html index c247818b..29024870 100644 --- a/docs/reference/Column.html +++ b/docs/reference/Column.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Dataset-class.html b/docs/reference/Dataset-class.html index cd74eb66..e6dee494 100644 --- a/docs/reference/Dataset-class.html +++ b/docs/reference/Dataset-class.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Dataset.html b/docs/reference/Dataset.html index b9af8ad8..3a7c8cff 100644 --- a/docs/reference/Dataset.html +++ b/docs/reference/Dataset.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/DockerRepository-class.html b/docs/reference/DockerRepository-class.html index 9266513c..c875bb66 100644 --- a/docs/reference/DockerRepository-class.html +++ b/docs/reference/DockerRepository-class.html @@ -20,7 +20,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/DockerRepository.html b/docs/reference/DockerRepository.html index 899ebb9a..917be922 100644 --- a/docs/reference/DockerRepository.html +++ b/docs/reference/DockerRepository.html @@ -20,7 +20,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/EntityViewSchema-class.html b/docs/reference/EntityViewSchema-class.html index 85ab80ba..48b0b538 100644 --- a/docs/reference/EntityViewSchema-class.html +++ b/docs/reference/EntityViewSchema-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/EntityViewSchema.html b/docs/reference/EntityViewSchema.html index 1db93759..39511499 100644 --- a/docs/reference/EntityViewSchema.html +++ b/docs/reference/EntityViewSchema.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Evaluation-class.html b/docs/reference/Evaluation-class.html index edb12d8c..4cd31bc4 100644 --- a/docs/reference/Evaluation-class.html +++ b/docs/reference/Evaluation-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Evaluation.html b/docs/reference/Evaluation.html index 3628a153..5c8dd04b 100644 --- a/docs/reference/Evaluation.html +++ b/docs/reference/Evaluation.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/File-class.html b/docs/reference/File-class.html index 91826fb4..869d74e1 100644 --- a/docs/reference/File-class.html +++ b/docs/reference/File-class.html @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/File.html b/docs/reference/File.html index 6d77bab4..2faca3b2 100644 --- a/docs/reference/File.html +++ b/docs/reference/File.html @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Folder-class.html b/docs/reference/Folder-class.html index 79dd8668..93ddb4bf 100644 --- a/docs/reference/Folder-class.html +++ b/docs/reference/Folder-class.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Folder.html b/docs/reference/Folder.html index 527d754b..943c246c 100644 --- a/docs/reference/Folder.html +++ b/docs/reference/Folder.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Link-class.html b/docs/reference/Link-class.html index cbf336f5..5099ded5 100644 --- a/docs/reference/Link-class.html +++ b/docs/reference/Link-class.html @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Link.html b/docs/reference/Link.html index e0b0d38c..40618221 100644 --- a/docs/reference/Link.html +++ b/docs/reference/Link.html @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/MaterializedViewSchema-class.html b/docs/reference/MaterializedViewSchema-class.html index 3fa9b7d0..f65470b5 100644 --- a/docs/reference/MaterializedViewSchema-class.html +++ b/docs/reference/MaterializedViewSchema-class.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/MaterializedViewSchema.html b/docs/reference/MaterializedViewSchema.html index 3db16692..a9c14c19 100644 --- a/docs/reference/MaterializedViewSchema.html +++ b/docs/reference/MaterializedViewSchema.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/PartialRowset-class.html b/docs/reference/PartialRowset-class.html index 75a735bc..41175c29 100644 --- a/docs/reference/PartialRowset-class.html +++ b/docs/reference/PartialRowset-class.html @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/PartialRowset.html b/docs/reference/PartialRowset.html index 55a636ad..2767fcc5 100644 --- a/docs/reference/PartialRowset.html +++ b/docs/reference/PartialRowset.html @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Project-class.html b/docs/reference/Project-class.html index 791d5ed7..06b98a53 100644 --- a/docs/reference/Project-class.html +++ b/docs/reference/Project-class.html @@ -1,7 +1,7 @@ Project — Project-class • synapser @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 @@ -86,8 +86,8 @@

Project

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

@@ -95,10 +95,28 @@

Project

Format

An R6 class object.

+
+

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

  • +

Methods

-
  • Project(name=NULL, properties=NULL, annotations=NULL): Constructor for Project

  • +
    • Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL): Constructor for Project

    • +
    • local_state(state=NULL): Set or get the object's internal state, excluding properties, or annotations.

      +
      +

      Arguments

      +

      state: A dictionary containing the object's internal state

      +
      +
      +

      Returns

      +

      The object's internal state, excluding properties, or annotations

      +
diff --git a/docs/reference/Project.html b/docs/reference/Project.html index 17246e12..b8b5a245 100644 --- a/docs/reference/Project.html +++ b/docs/reference/Project.html @@ -1,7 +1,7 @@ Constructor for objects of type Project — Project • synapser @@ -19,7 +19,7 @@ synapser - 2.0.0 + 2.1.0 @@ -86,24 +86,30 @@

Constructor for objects of type Project

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)

Arguments

name
-

The name of the project

+

The name of the project

properties
-

A named list/vector of Synapse properties. The only valid property name is 'alias'.

+

A map of Synapse properties

annotations
-

A named list/vector of user defined annotations.

+

A map of user defined annotations

+ +
local_state
+

Internal use only

+ +
alias
+

The project alias for use in friendly project urls

@@ -116,7 +122,7 @@

Value

Examples

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 @@
       
       
         synapser
-        2.0.0
+        2.1.0
       
     
diff --git a/docs/reference/Row.html b/docs/reference/Row.html index 770cd910..0f67cedc 100644 --- a/docs/reference/Row.html +++ b/docs/reference/Row.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/RowSet-class.html b/docs/reference/RowSet-class.html index 479e2910..3e8bc285 100644 --- a/docs/reference/RowSet-class.html +++ b/docs/reference/RowSet-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/RowSet.html b/docs/reference/RowSet.html index 42676149..426a9fb4 100644 --- a/docs/reference/RowSet.html +++ b/docs/reference/RowSet.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Schema-class.html b/docs/reference/Schema-class.html index a19e5966..6b2bacac 100644 --- a/docs/reference/Schema-class.html +++ b/docs/reference/Schema-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Schema.html b/docs/reference/Schema.html index cb273124..4937bc72 100644 --- a/docs/reference/Schema.html +++ b/docs/reference/Schema.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Submission-class.html b/docs/reference/Submission-class.html index 3900c2f5..05aa1bf3 100644 --- a/docs/reference/Submission-class.html +++ b/docs/reference/Submission-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Submission.html b/docs/reference/Submission.html index 860df13a..82f0ce98 100644 --- a/docs/reference/Submission.html +++ b/docs/reference/Submission.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/SubmissionStatus-class.html b/docs/reference/SubmissionStatus-class.html index 8dffd6aa..a2eb4faf 100644 --- a/docs/reference/SubmissionStatus-class.html +++ b/docs/reference/SubmissionStatus-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/SubmissionStatus.html b/docs/reference/SubmissionStatus.html index e42c8ed9..d6a70faf 100644 --- a/docs/reference/SubmissionStatus.html +++ b/docs/reference/SubmissionStatus.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/SubmissionViewSchema-class.html b/docs/reference/SubmissionViewSchema-class.html index 1b12bf6b..414382bd 100644 --- a/docs/reference/SubmissionViewSchema-class.html +++ b/docs/reference/SubmissionViewSchema-class.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/SubmissionViewSchema.html b/docs/reference/SubmissionViewSchema.html index ad6eaa7c..58742304 100644 --- a/docs/reference/SubmissionViewSchema.html +++ b/docs/reference/SubmissionViewSchema.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Table.html b/docs/reference/Table.html index 94838353..a71bb26e 100644 --- a/docs/reference/Table.html +++ b/docs/reference/Table.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Team-class.html b/docs/reference/Team-class.html index 9f8b5551..4934ad5f 100644 --- a/docs/reference/Team-class.html +++ b/docs/reference/Team-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Team.html b/docs/reference/Team.html index b373dd19..78ff592f 100644 --- a/docs/reference/Team.html +++ b/docs/reference/Team.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/TeamMember-class.html b/docs/reference/TeamMember-class.html index 82694f7b..74e23062 100644 --- a/docs/reference/TeamMember-class.html +++ b/docs/reference/TeamMember-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/TeamMember.html b/docs/reference/TeamMember.html index ded36193..5808423c 100644 --- a/docs/reference/TeamMember.html +++ b/docs/reference/TeamMember.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/UserGroupHeader-class.html b/docs/reference/UserGroupHeader-class.html index 9ad9ab3b..9620c6cc 100644 --- a/docs/reference/UserGroupHeader-class.html +++ b/docs/reference/UserGroupHeader-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/UserGroupHeader.html b/docs/reference/UserGroupHeader.html index 7de4bbcf..20a78efd 100644 --- a/docs/reference/UserGroupHeader.html +++ b/docs/reference/UserGroupHeader.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/UserProfile-class.html b/docs/reference/UserProfile-class.html index 61d709cb..5326996e 100644 --- a/docs/reference/UserProfile-class.html +++ b/docs/reference/UserProfile-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/UserProfile.html b/docs/reference/UserProfile.html index 8a7803e2..8e294817 100644 --- a/docs/reference/UserProfile.html +++ b/docs/reference/UserProfile.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Wiki-class.html b/docs/reference/Wiki-class.html index c80c017a..2728dc76 100644 --- a/docs/reference/Wiki-class.html +++ b/docs/reference/Wiki-class.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/Wiki.html b/docs/reference/Wiki.html index 152f2c24..93aaa17c 100644 --- a/docs/reference/Wiki.html +++ b/docs/reference/Wiki.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/as.list.html b/docs/reference/as.list.html index 18b3ff60..18d24ab4 100644 --- a/docs/reference/as.list.html +++ b/docs/reference/as.list.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/index.html b/docs/reference/index.html index 6f046e4d..5720bbe6 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 @@ -312,6 +312,10 @@

All functions synCreateStorageLocationSetting()

synCreateStorageLocationSetting

+ +

synCreateTeam()

+ +

synCreateTeam

synDelete()

@@ -320,6 +324,10 @@

All functions synDeleteProvenance()

synDeleteProvenance

+ +

synDeleteTeam()

+ +

synDeleteTeam

synDownloadTableColumns()

@@ -488,10 +496,18 @@

All functions synRestDELETE()

synRestDELETE

+ +

synRestDeleteAsync()

+ +

synRestDeleteAsync

synRestGET()

synRestGET

+ +

synRestGetAsync()

+ +

synRestGetAsync

synRestPOST()

@@ -500,6 +516,14 @@

All functions synRestPUT()

synRestPUT

+ +

synRestPostAsync()

+ +

synRestPostAsync

+ +

synRestPutAsync()

+ +

synRestPutAsync

synSendMembershipInvitation()

diff --git a/docs/reference/nextElem.html b/docs/reference/nextElem.html index 15321a96..8db1aa27 100644 --- a/docs/reference/nextElem.html +++ b/docs/reference/nextElem.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synBuildTable.html b/docs/reference/synBuildTable.html index 419aaa9d..46bb52b1 100644 --- a/docs/reference/synBuildTable.html +++ b/docs/reference/synBuildTable.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synClearDownloadList.html b/docs/reference/synClearDownloadList.html index 8784aa35..a19b6e60 100644 --- a/docs/reference/synClearDownloadList.html +++ b/docs/reference/synClearDownloadList.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synCreateColumn.html b/docs/reference/synCreateColumn.html index ce9df53a..79eace92 100644 --- a/docs/reference/synCreateColumn.html +++ b/docs/reference/synCreateColumn.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synCreateColumns.html b/docs/reference/synCreateColumns.html index 0a3fea71..828a6e79 100644 --- a/docs/reference/synCreateColumns.html +++ b/docs/reference/synCreateColumns.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synCreateExternalS3FileHandle.html b/docs/reference/synCreateExternalS3FileHandle.html index 4ac6d6f2..fe2a9eeb 100644 --- a/docs/reference/synCreateExternalS3FileHandle.html +++ b/docs/reference/synCreateExternalS3FileHandle.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 @@ -89,33 +89,40 @@

synCreateExternalS3FileHandle

-
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

bucket_name
-

Name of the S3 bucket

+

Name of the S3 bucket

s3_file_key
-

S3 key of the uploaded object

+

S3 key of the uploaded object

file_path
-

Local path of the uploaded file

+

Local path of the uploaded file

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

+

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

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

Mimetype of the file, if known

+
md5
+

MD5 of the file, if known

+
+
+

Error

+

If neither parent nor storage_location_id is specified, or if both are specified.

+

Examples

@@ -136,11 +143,10 @@

Examples

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/docs/reference/synCreateS3StorageLocation.html b/docs/reference/synCreateS3StorageLocation.html index 641e4c57..0cce2612 100644 --- a/docs/reference/synCreateS3StorageLocation.html +++ b/docs/reference/synCreateS3StorageLocation.html @@ -21,7 +21,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synCreateSnapshotVersion.html b/docs/reference/synCreateSnapshotVersion.html index bfd973b0..27ede117 100644 --- a/docs/reference/synCreateSnapshotVersion.html +++ b/docs/reference/synCreateSnapshotVersion.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synCreateStorageLocationSetting.html b/docs/reference/synCreateStorageLocationSetting.html index 5fc58643..a06b5449 100644 --- a/docs/reference/synCreateStorageLocationSetting.html +++ b/docs/reference/synCreateStorageLocationSetting.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synCreateTeam.html b/docs/reference/synCreateTeam.html new file mode 100644 index 00000000..d1d0492b --- /dev/null +++ b/docs/reference/synCreateTeam.html @@ -0,0 +1,148 @@ + +synCreateTeam — synCreateTeam • synapser + + +
+
+ + + +
+
+ + +
+

Creates a new team

+
+ +
+
synCreateTeam(name, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE)
+
+ +
+

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.

+ +
can_public_join
+

Whether the team can be joined by anyone. Defaults to FALSE.

+ +
can_request_membership
+

Whether the team can request membership. Defaults to TRUE.

+ +
+
+

Value

+ + +

An Team object

+
+ +
+

Examples

+
if (FALSE) {
+synCreateTeam('your_team_name')
+}
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/synDelete.html b/docs/reference/synDelete.html index 2a153976..1d7fe9d1 100644 --- a/docs/reference/synDelete.html +++ b/docs/reference/synDelete.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synDeleteProvenance.html b/docs/reference/synDeleteProvenance.html index 73b6fbea..3ba265b5 100644 --- a/docs/reference/synDeleteProvenance.html +++ b/docs/reference/synDeleteProvenance.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synDeleteTeam.html b/docs/reference/synDeleteTeam.html new file mode 100644 index 00000000..09188c54 --- /dev/null +++ b/docs/reference/synDeleteTeam.html @@ -0,0 +1,136 @@ + +synDeleteTeam — synDeleteTeam • synapser + + +
+
+ + + +
+
+ + +
+

Deletes a team

+
+ +
+
synDeleteTeam(id)
+
+ +
+

Arguments

+
id
+

The ID of the team to delete.

+ +
+
+

Value

+ + +

NULL

+
+ +
+

Examples

+
if (FALSE) {
+synDeleteTeam('your_team_id')
+}
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/synDownloadTableColumns.html b/docs/reference/synDownloadTableColumns.html index 55afb14e..7a1aaa39 100644 --- a/docs/reference/synDownloadTableColumns.html +++ b/docs/reference/synDownloadTableColumns.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synFindEntityId.html b/docs/reference/synFindEntityId.html index eb0fdb2a..e2eb6c24 100644 --- a/docs/reference/synFindEntityId.html +++ b/docs/reference/synFindEntityId.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGet.html b/docs/reference/synGet.html index a050d239..8f167417 100644 --- a/docs/reference/synGet.html +++ b/docs/reference/synGet.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 @@ -87,49 +87,52 @@

synGet

-
synGet(entity, version=NULL, downloadFile=NULL, downloadLocation=NULL, followLink=NULL, ifcollision=NULL, limitSearch=NULL)
+
synGet(entity)

Arguments

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)

version
-

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.

downloadFile
-

optional named parameter: Whether associated files(s) should be downloaded.
- Defaults to TRUE

+

Optional. Whether associated files(s) should be downloaded. + Defaults to TRUE.

downloadLocation
-

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.

followLink
-

optional named parameter: Whether the link returns the target Entity.
- Defaults to FALSE

+

Optional. Whether the link returns the target Entity. + Defaults to FALSE.

ifcollision
-

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".

limitSearch
-

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.

+ +
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.

@@ -140,6 +143,10 @@

Examples

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/docs/reference/synGetAnnotations.html b/docs/reference/synGetAnnotations.html index 4816322c..abba89e3 100644 --- a/docs/reference/synGetAnnotations.html +++ b/docs/reference/synGetAnnotations.html @@ -20,7 +20,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/synGetChildren.html b/docs/reference/synGetChildren.html index 8673d0f3..89f6a3f0 100644 --- a/docs/reference/synGetChildren.html +++ b/docs/reference/synGetChildren.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetColumn.html b/docs/reference/synGetColumn.html index fbf44500..1ec50a3b 100644 --- a/docs/reference/synGetColumn.html +++ b/docs/reference/synGetColumn.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetColumns.html b/docs/reference/synGetColumns.html index 668007d4..461a0339 100644 --- a/docs/reference/synGetColumns.html +++ b/docs/reference/synGetColumns.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetConfigFile.html b/docs/reference/synGetConfigFile.html index 61466f47..3a7854aa 100644 --- a/docs/reference/synGetConfigFile.html +++ b/docs/reference/synGetConfigFile.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetDownloadList.html b/docs/reference/synGetDownloadList.html index 067e976e..71451a36 100644 --- a/docs/reference/synGetDownloadList.html +++ b/docs/reference/synGetDownloadList.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetDownloadListManifest.html b/docs/reference/synGetDownloadListManifest.html index 4fd4941e..f9117b50 100644 --- a/docs/reference/synGetDownloadListManifest.html +++ b/docs/reference/synGetDownloadListManifest.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetEvaluation.html b/docs/reference/synGetEvaluation.html index fae407dc..8b590cd4 100644 --- a/docs/reference/synGetEvaluation.html +++ b/docs/reference/synGetEvaluation.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetEvaluationByContentSource.html b/docs/reference/synGetEvaluationByContentSource.html index 869906a9..ace246da 100644 --- a/docs/reference/synGetEvaluationByContentSource.html +++ b/docs/reference/synGetEvaluationByContentSource.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetEvaluationByName.html b/docs/reference/synGetEvaluationByName.html index c8561f9d..a0176f2b 100644 --- a/docs/reference/synGetEvaluationByName.html +++ b/docs/reference/synGetEvaluationByName.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetMembershipStatus.html b/docs/reference/synGetMembershipStatus.html index 823b2268..fdd654e2 100644 --- a/docs/reference/synGetMembershipStatus.html +++ b/docs/reference/synGetMembershipStatus.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetMyStorageLocationSetting.html b/docs/reference/synGetMyStorageLocationSetting.html index 90542df7..914c9a0d 100644 --- a/docs/reference/synGetMyStorageLocationSetting.html +++ b/docs/reference/synGetMyStorageLocationSetting.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetPermissions.html b/docs/reference/synGetPermissions.html index a1c35b23..be35afa2 100644 --- a/docs/reference/synGetPermissions.html +++ b/docs/reference/synGetPermissions.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetProjectSetting.html b/docs/reference/synGetProjectSetting.html index f57a83d4..059b767d 100644 --- a/docs/reference/synGetProjectSetting.html +++ b/docs/reference/synGetProjectSetting.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetProvenance.html b/docs/reference/synGetProvenance.html index 34962e09..82d54005 100644 --- a/docs/reference/synGetProvenance.html +++ b/docs/reference/synGetProvenance.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetStsStorageToken.html b/docs/reference/synGetStsStorageToken.html index 9f374b0d..87b8e0cb 100644 --- a/docs/reference/synGetStsStorageToken.html +++ b/docs/reference/synGetStsStorageToken.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetSubmission.html b/docs/reference/synGetSubmission.html index 1e47cdc0..cbac0253 100644 --- a/docs/reference/synGetSubmission.html +++ b/docs/reference/synGetSubmission.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetSubmissionBundles.html b/docs/reference/synGetSubmissionBundles.html index 7a86ba76..33955856 100644 --- a/docs/reference/synGetSubmissionBundles.html +++ b/docs/reference/synGetSubmissionBundles.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetSubmissionStatus.html b/docs/reference/synGetSubmissionStatus.html index 51634309..615685eb 100644 --- a/docs/reference/synGetSubmissionStatus.html +++ b/docs/reference/synGetSubmissionStatus.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetSubmissions.html b/docs/reference/synGetSubmissions.html index b5de005d..23dac07d 100644 --- a/docs/reference/synGetSubmissions.html +++ b/docs/reference/synGetSubmissions.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetTableColumns.html b/docs/reference/synGetTableColumns.html index d6eb9e84..8878d3b1 100644 --- a/docs/reference/synGetTableColumns.html +++ b/docs/reference/synGetTableColumns.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetTeam.html b/docs/reference/synGetTeam.html index 6f6cd9e7..9786f4ec 100644 --- a/docs/reference/synGetTeam.html +++ b/docs/reference/synGetTeam.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetTeamMembers.html b/docs/reference/synGetTeamMembers.html index c5cc366c..ab0e2a42 100644 --- a/docs/reference/synGetTeamMembers.html +++ b/docs/reference/synGetTeamMembers.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetTeamOpenInvitations.html b/docs/reference/synGetTeamOpenInvitations.html index 8d023dc1..571d0c14 100644 --- a/docs/reference/synGetTeamOpenInvitations.html +++ b/docs/reference/synGetTeamOpenInvitations.html @@ -1,6 +1,5 @@ -synGetTeamOpenInvitations — synGetTeamOpenInvitations • synapsersynGetTeamOpenInvitations — synGetTeamOpenInvitations • synapser @@ -18,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 @@ -84,8 +83,7 @@

synGetTeamOpenInvitations

-

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

@@ -95,15 +93,14 @@

synGetTeamOpenInvitations

Arguments

team
-

A Team object or a
- team's ID.

+

A Team object or a team's ID.

Value

-

generator of MembershipRequest

+

Generator of MembershipRequest dictionaries

diff --git a/docs/reference/synGetUserProfile.html b/docs/reference/synGetUserProfile.html index 23f2fe97..81a0814f 100644 --- a/docs/reference/synGetUserProfile.html +++ b/docs/reference/synGetUserProfile.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetWiki.html b/docs/reference/synGetWiki.html index d325b7f9..497a234c 100644 --- a/docs/reference/synGetWiki.html +++ b/docs/reference/synGetWiki.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetWikiAttachments.html b/docs/reference/synGetWikiAttachments.html index b8352884..c35797e7 100644 --- a/docs/reference/synGetWikiAttachments.html +++ b/docs/reference/synGetWikiAttachments.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synGetWikiHeaders.html b/docs/reference/synGetWikiHeaders.html index 9eb5bda6..c1fe5fc5 100644 --- a/docs/reference/synGetWikiHeaders.html +++ b/docs/reference/synGetWikiHeaders.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synInvalidateAPIKey.html b/docs/reference/synInvalidateAPIKey.html index c700ead3..ba528610 100644 --- a/docs/reference/synInvalidateAPIKey.html +++ b/docs/reference/synInvalidateAPIKey.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synInviteToTeam.html b/docs/reference/synInviteToTeam.html index c3570205..846bdc8c 100644 --- a/docs/reference/synInviteToTeam.html +++ b/docs/reference/synInviteToTeam.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synIsCertified.html b/docs/reference/synIsCertified.html index 676fc67e..f80929e2 100644 --- a/docs/reference/synIsCertified.html +++ b/docs/reference/synIsCertified.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synLogin.html b/docs/reference/synLogin.html index d45ec193..8d2219cd 100644 --- a/docs/reference/synLogin.html +++ b/docs/reference/synLogin.html @@ -1,5 +1,13 @@ -synLogin — synLogin • synapsersynLogin — synLogin • synapser @@ -17,7 +25,7 @@ synapser - 2.0.0 + 2.1.0 @@ -84,64 +92,58 @@

synLogin

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):

  1. synapseConfig file (in user home folder unless configured otherwise)

  2. +
  3. User defined arguments during a CLI session

  4. +
  5. User's Personal Access Token (aka: Synapse Auth Token) from the environment variable: SYNAPSE_AUTH_TOKEN

  6. +
  7. Retrieves user's authentication token from AWS SSM Parameter store (if configured)

  8. +
-
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

email
-

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.

-
password
-

**!!WILL BE DEPRECATED!!** password. Please use authToken (Synapse personal access token)

+
silent
+

Suppresses the "Welcome ...!" message. Defaults to FALSE.

-
apiKey
-

**!!WILL BE DEPRECATED!!** Base64 encoded Synapse API key

+
authToken
+

A bearer authorization token, e.g. a personal access token, can be used in lieu of a
+ password or apiKey

-
sessionToken
-

**!!DEPRECATED FIELD!!** User's current session token. Using this field will ignore the following fields: email, password, apiKey

+
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.

rememberMe
-

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.

-
silent
-

Defaults to FALSE. Suppresses the "Welcome ...!" message.

+
password
+

DEPRECATED. Please use authToken (Synapse personal access token)

+ +
apiKey
+

DEPRECATED. Base64 encoded Synapse API key

+ +
sessionToken
+

DEPRECATED. User's current session token. Using this field will ignore the following fields: email, password, apiKey

forced
-

Defaults to FALSE. Bypass the credential cache if set.

+

DEPRECATED. Defaults to FALSE. Bypass the credential cache if set.

-
authToken
-

A bearer authorization token, e.g. a personal access token, can be used in lieu of a
- password or apiKey

-
-

Details

-

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

-

Examples

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 @@
       
       
         synapser
-        2.0.0
+        2.1.0
       
     
diff --git a/docs/reference/synMd5Query.html b/docs/reference/synMd5Query.html index 052132cd..4e7454ca 100644 --- a/docs/reference/synMd5Query.html +++ b/docs/reference/synMd5Query.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/synMove.html b/docs/reference/synMove.html index 7a3b35bb..fd2d1864 100644 --- a/docs/reference/synMove.html +++ b/docs/reference/synMove.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synOnweb.html b/docs/reference/synOnweb.html index 1f12c205..b76a9d31 100644 --- a/docs/reference/synOnweb.html +++ b/docs/reference/synOnweb.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synPrintEntity.html b/docs/reference/synPrintEntity.html index 553a7720..b7dd8acd 100644 --- a/docs/reference/synPrintEntity.html +++ b/docs/reference/synPrintEntity.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synRemoveFromDownloadList.html b/docs/reference/synRemoveFromDownloadList.html index a6865aba..166e717a 100644 --- a/docs/reference/synRemoveFromDownloadList.html +++ b/docs/reference/synRemoveFromDownloadList.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synRestDELETE.html b/docs/reference/synRestDELETE.html index f823a0b5..823355cb 100644 --- a/docs/reference/synRestDELETE.html +++ b/docs/reference/synRestDELETE.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synRestDeleteAsync.html b/docs/reference/synRestDeleteAsync.html new file mode 100644 index 00000000..a2863e51 --- /dev/null +++ b/docs/reference/synRestDeleteAsync.html @@ -0,0 +1,159 @@ + +synRestDeleteAsync — synRestDeleteAsync • synapser + + +
+
+ + + +
+
+ + +
+

Sends an HTTP DELETE request to the Synapse server.

+
+ +
+
synRestDeleteAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+
+ +
+

Arguments

+
uri
+

URI of resource to be deleted

+ +
endpoint
+

Server endpoint. Defaults to 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

+ +
...
+

Any other arguments taken by a request method

+ +
+
+

Value

+ + +

Null

+
+ +
+

Examples

+
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>"))
+}
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/synRestGET.html b/docs/reference/synRestGET.html index 7eeb3c1c..36454942 100644 --- a/docs/reference/synRestGET.html +++ b/docs/reference/synRestGET.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synRestGetAsync.html b/docs/reference/synRestGetAsync.html new file mode 100644 index 00000000..194ab063 --- /dev/null +++ b/docs/reference/synRestGetAsync.html @@ -0,0 +1,159 @@ + +synRestGetAsync — synRestGetAsync • synapser + + +
+
+ + + +
+
+ + +
+

Sends an HTTP GET request to the Synapse server.

+
+ +
+
synRestGetAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
+
+ +
+

Arguments

+
uri
+

URI on which get is performed

+ +
endpoint
+

Server endpoint. Defaults to 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.

+ +
...
+

Any other arguments taken by a request method

+ +
+
+

Value

+ + +

JSON encoding of response

+
+ +
+

Examples

+
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"))
+}
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/synRestPOST.html b/docs/reference/synRestPOST.html index 169d4c94..8243b61c 100644 --- a/docs/reference/synRestPOST.html +++ b/docs/reference/synRestPOST.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synRestPUT.html b/docs/reference/synRestPUT.html index 61e889ae..737ff1d8 100644 --- a/docs/reference/synRestPUT.html +++ b/docs/reference/synRestPUT.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synRestPostAsync.html b/docs/reference/synRestPostAsync.html new file mode 100644 index 00000000..cd9ef5dd --- /dev/null +++ b/docs/reference/synRestPostAsync.html @@ -0,0 +1,167 @@ + +synRestPostAsync — synRestPostAsync • synapser + + +
+
+ + + +
+
+ + +
+

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)
+
+ +
+

Arguments

+
uri
+

URI on which get is performed

+ +
body
+

The payload to be delivered

+ +
endpoint
+

Server endpoint. Defaults to 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.

+ +
...
+

Any other arguments taken by a request method

+ +
+
+

Value

+ + +

JSON encoding of response

+
+ +
+

Examples

+
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))
+}
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/synRestPutAsync.html b/docs/reference/synRestPutAsync.html new file mode 100644 index 00000000..afd56206 --- /dev/null +++ b/docs/reference/synRestPutAsync.html @@ -0,0 +1,175 @@ + +synRestPutAsync — synRestPutAsync • synapser + + +
+
+ + + +
+
+ + +
+

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)
+
+ +
+

Arguments

+
uri
+

URI on which get is performed

+ +
body
+

The payload to be delivered

+ +
endpoint
+

Server endpoint. Defaults to 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.

+ +
...
+

Any other arguments taken by a request method

+ +
+
+

Value

+ + +

JSON encoding of response

+
+ +
+

Examples

+
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))
+}
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/synSendMembershipInvitation.html b/docs/reference/synSendMembershipInvitation.html index b144ebf6..ac1123a2 100644 --- a/docs/reference/synSendMembershipInvitation.html +++ b/docs/reference/synSendMembershipInvitation.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synSendMessage.html b/docs/reference/synSendMessage.html index 480e0278..b7653de2 100644 --- a/docs/reference/synSendMessage.html +++ b/docs/reference/synSendMessage.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synSetAnnotations.html b/docs/reference/synSetAnnotations.html index 0a0d1cd5..282dca2a 100644 --- a/docs/reference/synSetAnnotations.html +++ b/docs/reference/synSetAnnotations.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synSetEndpoints.html b/docs/reference/synSetEndpoints.html index 8f8462c1..4461bf2c 100644 --- a/docs/reference/synSetEndpoints.html +++ b/docs/reference/synSetEndpoints.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synSetPermissions.html b/docs/reference/synSetPermissions.html index b8ca5193..db6e9444 100644 --- a/docs/reference/synSetPermissions.html +++ b/docs/reference/synSetPermissions.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 @@ -98,7 +98,8 @@

Arguments

An Entity or Synapse ID to modify

principalId
-

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.

accessType

Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE, DELETE, CHANGE_PERMISSIONS

@@ -107,27 +108,26 @@

Arguments

Set as TRUE when modifying a benefactor's ACL

warn_if_inherits
-

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

overwrite
-

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.

Value

-

an Access Control List object

+

An Access Control List object

Examples

if (FALSE) {
-synSetPermissions("syn11705401", 273950, c("READ", "DOWNLOAD"))
+# assign the Public group "can read"" permission to the entity
+synSetPermissions("entity_id", 273949, list("READ"))
 }
 
diff --git a/docs/reference/synSetProvenance.html b/docs/reference/synSetProvenance.html index 3bc54963..557d513e 100644 --- a/docs/reference/synSetProvenance.html +++ b/docs/reference/synSetProvenance.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synSetStorageLocation.html b/docs/reference/synSetStorageLocation.html index c7a2d877..12f609b2 100644 --- a/docs/reference/synSetStorageLocation.html +++ b/docs/reference/synSetStorageLocation.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synStore.html b/docs/reference/synStore.html index 8a839a43..f7dd8d2f 100644 --- a/docs/reference/synStore.html +++ b/docs/reference/synStore.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 @@ -89,48 +89,49 @@

synStore

-
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)

Arguments

obj
-

A Synapse Entity, Evaluation, or Wiki

+

A Synapse Entity, Evaluation, or Wiki.

used
-

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.

executed
-

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).

activity
-

optional named parameter: Activity object specifying the user's provenance

+

Optional. Activity object specifying the user's provenance.

activityName
-

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.

activityDescription
-

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.

createOrUpdate
-

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.

forceVersion
-

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.

versionLabel
-

optional named parameter: Arbitrary string used to label the version.

+

Optional. Arbitrary string used to label the version.

isRestricted
-

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.

+ +
set_annotations
+

If TRUE, set the annotations on the entity. If FALSE, do not set the annotations. Defaults to TRUE.

@@ -144,6 +145,7 @@

Value

Examples

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) }
diff --git a/docs/reference/synSubmit.html b/docs/reference/synSubmit.html index 6aa01f50..21130017 100644 --- a/docs/reference/synSubmit.html +++ b/docs/reference/synSubmit.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0
diff --git a/docs/reference/synTableQuery.html b/docs/reference/synTableQuery.html index da57d776..e16d36ff 100644 --- a/docs/reference/synTableQuery.html +++ b/docs/reference/synTableQuery.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synUpdateActivity.html b/docs/reference/synUpdateActivity.html index 5a878ec9..3721e92b 100644 --- a/docs/reference/synUpdateActivity.html +++ b/docs/reference/synUpdateActivity.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synUploadFileHandle.html b/docs/reference/synUploadFileHandle.html index 229228ec..c1c1e2d6 100644 --- a/docs/reference/synUploadFileHandle.html +++ b/docs/reference/synUploadFileHandle.html @@ -18,7 +18,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/reference/synapser-package.html b/docs/reference/synapser-package.html index 61c3834c..78594c05 100644 --- a/docs/reference/synapser-package.html +++ b/docs/reference/synapser-package.html @@ -17,7 +17,7 @@ synapser - 2.0.0 + 2.1.0 diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 97eef408..807d090c 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -222,12 +222,18 @@ /reference/synCreateStorageLocationSetting.html + + /reference/synCreateTeam.html + /reference/synDelete.html /reference/synDeleteProvenance.html + + /reference/synDeleteTeam.html + /reference/synDownloadTableColumns.html @@ -354,15 +360,27 @@ /reference/synRestDELETE.html + + /reference/synRestDeleteAsync.html + /reference/synRestGET.html + + /reference/synRestGetAsync.html + /reference/synRestPOST.html /reference/synRestPUT.html + + /reference/synRestPostAsync.html + + + /reference/synRestPutAsync.html + /reference/synSendMembershipInvitation.html From ae842258acd3aa461df0261230d7314c5c52b9b7 Mon Sep 17 00:00:00 2001 From: danlu1 Date: Thu, 1 Aug 2024 16:33:02 +0000 Subject: [PATCH 03/16] fix unrecognized escape in character string issue --- man/synStore.Rd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/synStore.Rd b/man/synStore.Rd index f95e6eab..49a5baa8 100644 --- a/man/synStore.Rd +++ b/man/synStore.Rd @@ -48,6 +48,7 @@ synStore(obj, createOrUpdate=TRUE, forceVersion=TRUE, versionLabel=NULL, isRestr \examples{ \dontrun{ # Create a new project + project <- Project('My uniquely named project') project <- synStore(project) @@ -64,7 +65,7 @@ file <- File('/path/to/data/file.xyz', description='Fancy new data', parent=proj 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")), +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!", From 4a0964b85ab4684c89d483ac5cb5cb04824634be Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:50:02 -0700 Subject: [PATCH 04/16] Update DESCRIPTION Update Authors section --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 674b5ed6..a5eb2712 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,6 +5,7 @@ Version: 2.1.0 Date: 2024-07-31 Authors@R: c( person("Tom", "Yu", role = c("cre"), email = "thomas.yu@sagebase.org"), + person("Dan", "Lu", role = c("aut", "cre"), email = "dan.lu@sagebase.org"), person("Bruce", "Hoff", role = c("aut"), email = "bruce.hoff@sagebase.org"), person("Sage Bionetworks", role = c("cph")) ) From 5ff9accd0f069d3701ee32310b5aab9bf8fa8144 Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:05:24 -0700 Subject: [PATCH 05/16] Update DESCRIPTION Remove Maintainer field in DESCRIPTION since this info is alreay in Author field. --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a5eb2712..27307a81 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,6 @@ Authors@R: c( person("Bruce", "Hoff", role = c("aut"), email = "bruce.hoff@sagebase.org"), person("Sage Bionetworks", role = c("cph")) ) -Maintainer: Dan Lu BugReports: https://github.com/Sage-Bionetworks/synapser/issues Description: Provides R language bindings for Synapse RESTful web services. Encoding: UTF-8 From 987b497a1b317a91837b2edfe2bda3bc3ba9ea8c Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:47:16 -0700 Subject: [PATCH 06/16] Update DESCRIPTION --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 27307a81..9b09cda9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,8 +4,8 @@ Title: R Language Bindings for Synapse API Version: 2.1.0 Date: 2024-07-31 Authors@R: c( - person("Tom", "Yu", role = c("cre"), email = "thomas.yu@sagebase.org"), person("Dan", "Lu", role = c("aut", "cre"), email = "dan.lu@sagebase.org"), + person("Tom", "Yu", role = c("aut"), email = "thomas.yu@sagebase.org"), person("Bruce", "Hoff", role = c("aut"), email = "bruce.hoff@sagebase.org"), person("Sage Bionetworks", role = c("cph")) ) From 79bc48e646a0081da6a1da287db6dfee8b802f59 Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:06:37 -0700 Subject: [PATCH 07/16] Update NEWS.md Update change log for v2.0.0 --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index be9458b7..a7383bc0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,7 +12,6 @@ #### Minor behavior changes: * Credentials passed by command line argument will now be evaluated before credentials stored in the `~/.synapseConfig` file. -* `rememberMe` has been deprecated in `synLogin`. * Using syn123.version notation is now supported with `synGet` and `synSetProvenance`. * File entities will no longer have their version incremented during no-op changes. Only when file content, or fields on the file has been updated will a version number be incremented. * New parameters have been added to allow more features: @@ -29,6 +28,7 @@ For more changes, please view the [Release Notes](https://python-docs.synapse.or * Python synapsePythonClient dependency updated to 4.0.0 * You can only login via a Synapse Personal Access token now. All other forms of authentication have been disabled for security purposes. +* `rememberMe` has been deprecated in `synLogin`. * `synSetAnnotations` removed as it is not working as expected due to implementation in the Python API. * For more changes, please view the 3.2.0 and 4.0.0 changes on the [Python client documentation](https://python-docs.synapse.org/news/). From 1194b34caf07d8282936702976269a98b1f6ebea Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:31:09 -0700 Subject: [PATCH 08/16] Update build.yml bump download-artifact action version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d847535f..97faad07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -246,7 +246,7 @@ jobs: echo "deploy_target=$DEPLOY_TARGET" >> $GITHUB_OUTPUT - name: download-artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 if: ${{steps.check-deployment-target.outputs.deploy_target != ''}} with: path: deploy_artifacts From 2a5714f4e214bc4d713cb486188abd1454b1946c Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:04:24 -0700 Subject: [PATCH 09/16] Update build.yml pin reticulate version to 1.28 in check-install step --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97faad07..5378d271 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,7 +309,7 @@ jobs: PACKAGE="synapser" echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" > test.R echo "try(remove.packages('$PACKAGE'), silent=T)" >> test.R - echo "install.packages('reticulate', repos=c('https://cloud.r-project.org/'))" >> test.R + echo "install.packages('remotes'); remotes::install_version('reticulate', version = '1.28')" >> test.R echo "reticulate::virtualenv_create('r-reticulate')" >> test.R echo "reticulate::use_virtualenv('r-reticulate')" >> test.R echo "install.packages('$PACKAGE', repos=c('$RAN', 'https://cloud.r-project.org/'))" >> test.R From 19d87da3c72748653d914d26e14c032b7b344591 Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:25:48 -0700 Subject: [PATCH 10/16] Update build.yml add CRAN mirror to check-install --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5378d271..78b98831 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,6 +309,7 @@ jobs: PACKAGE="synapser" echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" > test.R echo "try(remove.packages('$PACKAGE'), silent=T)" >> test.R + echo "options(repos = c(CRAN = 'https://cloud.r-project.org'))" >> .Rprofile echo "install.packages('remotes'); remotes::install_version('reticulate', version = '1.28')" >> test.R echo "reticulate::virtualenv_create('r-reticulate')" >> test.R echo "reticulate::use_virtualenv('r-reticulate')" >> test.R From c124d128054bd18eafdb553d3945423ba92b437f Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:08:36 -0700 Subject: [PATCH 11/16] Update build.yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78b98831..37a06f9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,8 +309,7 @@ jobs: PACKAGE="synapser" echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" > test.R echo "try(remove.packages('$PACKAGE'), silent=T)" >> test.R - echo "options(repos = c(CRAN = 'https://cloud.r-project.org'))" >> .Rprofile - echo "install.packages('remotes'); remotes::install_version('reticulate', version = '1.28')" >> test.R + echo "install.packages('remotes', repos = 'https://cloud.r-project.org'); remotes::install_version('reticulate', version = '1.28')" >> test.R echo "reticulate::virtualenv_create('r-reticulate')" >> test.R echo "reticulate::use_virtualenv('r-reticulate')" >> test.R echo "install.packages('$PACKAGE', repos=c('$RAN', 'https://cloud.r-project.org/'))" >> test.R From 63ba7f7aa05e09ff3699e5b2abee97d50b99422e Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 16:10:58 -0700 Subject: [PATCH 12/16] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37a06f9c..473b7e54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,7 +309,7 @@ jobs: PACKAGE="synapser" echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" > test.R echo "try(remove.packages('$PACKAGE'), silent=T)" >> test.R - echo "install.packages('remotes', repos = 'https://cloud.r-project.org'); remotes::install_version('reticulate', version = '1.28')" >> test.R + echo "install.packages('remotes', repos = 'https://cloud.r-project.org'); remotes::install_version('reticulate', version = '1.28', repos = 'https://cloud.r-project.org')" >> test.R echo "reticulate::virtualenv_create('r-reticulate')" >> test.R echo "reticulate::use_virtualenv('r-reticulate')" >> test.R echo "install.packages('$PACKAGE', repos=c('$RAN', 'https://cloud.r-project.org/'))" >> test.R From 8fc7759e554ac42486d1e4efcdcaaf6c65e1cf9a Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:12:17 -0700 Subject: [PATCH 13/16] Update build.yml pin python version in check-install --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 473b7e54..6358e186 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -300,17 +300,18 @@ jobs: uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.r }} - + - name: check-install shell: bash run: | RAN="http://${{ needs.deploy.outputs.s3_ran }}" VERSION_TO_CHECK="${{ needs.build.outputs.package_version }}" PACKAGE="synapser" - echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" > test.R + echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" >> test.R echo "try(remove.packages('$PACKAGE'), silent=T)" >> test.R echo "install.packages('remotes', repos = 'https://cloud.r-project.org'); remotes::install_version('reticulate', version = '1.28', repos = 'https://cloud.r-project.org')" >> test.R - echo "reticulate::virtualenv_create('r-reticulate')" >> test.R + echo "reticulate::install_python(version = '3.10.11')" >> test.R + echo "reticulate::virtualenv_create(envname='r-reticulate',version = '3.10.11')" >> test.R echo "reticulate::use_virtualenv('r-reticulate')" >> test.R echo "install.packages('$PACKAGE', repos=c('$RAN', 'https://cloud.r-project.org/'))" >> test.R echo "library('$PACKAGE')" >> test.R From 35e73070544ce190b38d26328176867337bd1589 Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:16:58 -0700 Subject: [PATCH 14/16] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6358e186..1d040fe4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -307,7 +307,7 @@ jobs: RAN="http://${{ needs.deploy.outputs.s3_ran }}" VERSION_TO_CHECK="${{ needs.build.outputs.package_version }}" PACKAGE="synapser" - echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" >> test.R + echo "if (available.packages(repos='$RAN')['$PACKAGE','Version'] != '$VERSION_TO_CHECK') { quit(save = 'no', status = 1) }" > test.R echo "try(remove.packages('$PACKAGE'), silent=T)" >> test.R echo "install.packages('remotes', repos = 'https://cloud.r-project.org'); remotes::install_version('reticulate', version = '1.28', repos = 'https://cloud.r-project.org')" >> test.R echo "reticulate::install_python(version = '3.10.11')" >> test.R From 5afdbfd78d44c114a3a8e16d5c7873875d5a1e53 Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 21:26:57 -0700 Subject: [PATCH 15/16] Update build.yml --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d040fe4..0a834193 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -301,6 +301,13 @@ jobs: with: r-version: ${{ matrix.r }} + - name: setup-r-dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + cache: true + cache-version: 2 + architecture: 'x64' + - name: check-install shell: bash run: | From fcf54a3353644af484ec3c948dd2ba1047a8f8db Mon Sep 17 00:00:00 2001 From: Dan Lu <90745557+danlu1@users.noreply.github.com> Date: Fri, 2 Aug 2024 22:18:34 -0700 Subject: [PATCH 16/16] Update NEWS.md --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index a7383bc0..9cf8b38c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ ### Improvements * Upgraded to the synapsePythonClient v4.4.0. +* Now support R 4.4.1. * The data upload and download algorithm in synapsePythonClient have been revamped for enhanced stability, reliability, and performance. * Updated reference documents and code examples for both new and modified functions.