From d0936056c42c56800b7aae14d3fa87b280d5780a Mon Sep 17 00:00:00 2001
From: Dan Lu <90745557+danlu1@users.noreply.github.com>
Date: Wed, 14 Aug 2024 18:45:46 +0000
Subject: [PATCH] [SYNR-1527] synapser release for version 2.1.0 (#337)
* 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
* update package description and changelog
---
.github/workflows/build.yml | 36 ++-
DESCRIPTION | 12 +-
NEWS.md | 26 ++
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 +-
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 ++
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 | 68 +++--
tests/testthat/test_table.R | 249 ++++++++++--------
tools/installPythonClient.R | 8 +-
vignettes/tables.Rmd | 4 +-
vignettes/views.Rmd | 2 +
181 files changed, 2454 insertions(+), 722 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 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
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..0a834193 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}}
@@ -236,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
@@ -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 }}
@@ -290,7 +300,14 @@ jobs:
uses: r-lib/actions/setup-r@v2
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: |
@@ -299,8 +316,9 @@ 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 "reticulate::virtualenv_create('r-reticulate')" >> 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
+ 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
diff --git a/DESCRIPTION b/DESCRIPTION
index a9b1eea1..9b09cda9 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,26 +1,28 @@
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("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"))
)
-Maintainer: Bruce Hoff Docker
Bruce Hoff
- 2024-02-04
+ 2024-08-01
Source: vignettes/docker.Rmd
docker.Rmd
Installation
Tom Yu
- 2024-02-04
+ 2024-08-01
Source: vignettes/installation.Rmd
installation.Rmd
Manage Synapse Credentials
Tom Yu
- 2024-02-04
+ 2024-08-01
Source: vignettes/manageSynapseCredentials.Rmd
manageSynapseCredentials.Rmd
Synapse R Client Overview
Bruce Hoff
- 2024-02-04
+ 2024-08-01
Source: vignettes/synapser.Rmd
synapser.Rmd
Accessing DataView the entity’s metadata in the R console:
print(fileEntity)
-## File(id='syn53468047', etag='92ba143c-226b-421a-9ac3-3992742831b1', modifiedBy='3324230', versionLabel='1', isLatestVersion=True, name='file8d8159001777', versionComment='Some sort of comment about the new version of the file.', synapseStore=True, _file_handle={'id': '132873000', 'etag': '276042e9-0ec1-4bd7-8dfe-3edc5d00b7a9', 'createdBy': '3324230', 'createdOn': '2024-02-04T19:31:46.000Z', 'modifiedOn': '2024-02-04T19:31:46.000Z', 'concreteType': 'org.sagebionetworks.repo.model.file.S3FileHandle', 'contentType': 'application/octet-stream', 'contentMd5': '8465d33d9f407ef250ce519e92f300fb', 'fileName': 'file8d8159001777', 'storageLocationId': 1, 'contentSize': 23, 'status': 'AVAILABLE', 'bucketName': 'proddata.sagebase.org', 'key': '3324230/2e56b45e-7227-4624-ba7b-8c1f043b8bbd/file8d8159001777', 'isPreview': False, 'externalURL': None}, versionNumber=1, cacheDir='/var/folders/67/ghxb0p_j4r5gjj95l9z3502c0000gq/T/RtmpxF8ZnS', path='/var/folders/67/ghxb0p_j4r5gjj95l9z3502c0000gq/T/RtmpxF8ZnS/file8d8159001777', createdBy='3324230', createdOn='2024-02-04T19:31:46.346Z', parentId='syn53468046', dataFileHandleId='132873000', files=['file8d8159001777'], concreteType='org.sagebionetworks.repo.model.FileEntity', modifiedOn='2024-02-04T19:31:46.346Z')
This is one simple way to read in a small matrix (we load just the first few rows):
@@ -292,7 +292,7 @@Organizing Data in a Project## [1] "Data" ## ## [[1]]$id -## [1] "syn53468048" +## [1] "syn61936059" ## ## [[1]]$type ## [1] "org.sagebionetworks.repo.model.Folder" @@ -307,27 +307,27 @@
Organizing Data in a Project## [1] TRUE ## ## [[1]]$benefactorId -## [1] 53468046 +## [1] 61936057 ## ## [[1]]$createdOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## [[1]]$modifiedOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## [[1]]$createdBy -## [1] "3324230" +## [1] "3434599" ## ## [[1]]$modifiedBy -## [1] "3324230" +## [1] "3434599" ## ## ## [[2]] ## [[2]]$name -## [1] "file8d8159001777" +## [1] "file5d9a34d94eef" ## ## [[2]]$id -## [1] "syn53468047" +## [1] "syn61936058" ## ## [[2]]$type ## [1] "org.sagebionetworks.repo.model.FileEntity" @@ -342,19 +342,19 @@
Organizing Data in a Project## [1] TRUE ## ## [[2]]$benefactorId -## [1] 53468046 +## [1] 61936057 ## ## [[2]]$createdOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## [[2]]$modifiedOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## [[2]]$createdBy -## [1] "3324230" +## [1] "3434599" ## ## [[2]]$modifiedBy -## [1] "3324230"
You can also filter by type:
filesAndFolders <- synGetChildren(project$properties$id, includeTypes = c("file", "folder"))
@@ -364,7 +364,7 @@ Organizing Data in a Project## [1] "Data"
##
## [[1]]$id
-## [1] "syn53468048"
+## [1] "syn61936059"
##
## [[1]]$type
## [1] "org.sagebionetworks.repo.model.Folder"
@@ -379,27 +379,27 @@ Organizing Data in a Project## [1] TRUE
##
## [[1]]$benefactorId
-## [1] 53468046
+## [1] 61936057
##
## [[1]]$createdOn
-## [1] "2024-02-04T19:31:47.353Z"
+## [1] "2024-08-01T16:24:18.830Z"
##
## [[1]]$modifiedOn
-## [1] "2024-02-04T19:31:47.353Z"
+## [1] "2024-08-01T16:24:18.830Z"
##
## [[1]]$createdBy
-## [1] "3324230"
+## [1] "3434599"
##
## [[1]]$modifiedBy
-## [1] "3324230"
+## [1] "3434599"
##
##
## [[2]]
## [[2]]$name
-## [1] "file8d8159001777"
+## [1] "file5d9a34d94eef"
##
## [[2]]$id
-## [1] "syn53468047"
+## [1] "syn61936058"
##
## [[2]]$type
## [1] "org.sagebionetworks.repo.model.FileEntity"
@@ -414,19 +414,19 @@ Organizing Data in a Project## [1] TRUE
##
## [[2]]$benefactorId
-## [1] 53468046
+## [1] 61936057
##
## [[2]]$createdOn
-## [1] "2024-02-04T19:31:46.346Z"
+## [1] "2024-08-01T16:24:17.543Z"
##
## [[2]]$modifiedOn
-## [1] "2024-02-04T19:31:46.346Z"
+## [1] "2024-08-01T16:24:17.543Z"
##
## [[2]]$createdBy
-## [1] "3324230"
+## [1] "3434599"
##
## [[2]]$modifiedBy
-## [1] "3324230"
You can avoid reading all children into memory at once by iterating through one at a time:
@@ -443,7 +443,7 @@Organizing Data in a Project## [1] "Data" ## ## $id -## [1] "syn53468048" +## [1] "syn61936059" ## ## $type ## [1] "org.sagebionetworks.repo.model.Folder" @@ -458,25 +458,25 @@
Organizing Data in a Project## [1] TRUE ## ## $benefactorId -## [1] 53468046 +## [1] 61936057 ## ## $createdOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## $modifiedOn -## [1] "2024-02-04T19:31:47.353Z" +## [1] "2024-08-01T16:24:18.830Z" ## ## $createdBy -## [1] "3324230" +## [1] "3434599" ## ## $modifiedBy -## [1] "3324230" +## [1] "3434599" ## ## $name -## [1] "file8d8159001777" +## [1] "file5d9a34d94eef" ## ## $id -## [1] "syn53468047" +## [1] "syn61936058" ## ## $type ## [1] "org.sagebionetworks.repo.model.FileEntity" @@ -491,19 +491,19 @@
Organizing Data in a Project## [1] TRUE ## ## $benefactorId -## [1] 53468046 +## [1] 61936057 ## ## $createdOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## $modifiedOn -## [1] "2024-02-04T19:31:46.346Z" +## [1] "2024-08-01T16:24:17.543Z" ## ## $createdBy -## [1] "3324230" +## [1] "3434599" ## ## $modifiedBy -## [1] "3324230" +## [1] "3434599" ## ## [1] "Reached end of list."
You can move files to a different parent:
@@ -530,7 +530,7 @@In addition to simple data storage, Synapse entities can be annotated with key/value metadata, described in markdown documents (wikis), and linked together in provenance graphs to create a reproducible record of @@ -703,13 +703,13 @@
To learn more about writing an evaluation query, please see: http://docs.synapse.org/rest/GET/evaluation/submission/query.html
For more information, please see:
@@ -822,13 +873,13 @@Sharing Access to Contentacl <- synSetPermissions(project, principalId = 273949, accessType = list("READ")) acl ## $id -## [1] "syn53468051" +## [1] "syn61936062" ## ## $creationDate -## [1] "2024-02-04T19:31:53.162Z" +## [1] "2024-08-01T16:24:22.686Z" ## ## $etag -## [1] "fcd01110-b0b7-4f7b-9fa2-630b4fa3b072" +## [1] "2990bf07-085e-42d1-b985-13fcce8ac7c8" ## ## $resourceAccess ## $resourceAccess[[1]] @@ -841,12 +892,12 @@
Sharing Access to Content## ## $resourceAccess[[2]] ## $resourceAccess[[2]]$principalId -## [1] 3324230 +## [1] 3434599 ## ## $resourceAccess[[2]]$accessType -## [1] "CHANGE_SETTINGS" "CREATE" "MODERATE" -## [4] "DELETE" "UPDATE" "CHANGE_PERMISSIONS" -## [7] "READ" "DOWNLOAD"
Now public can read:
synGetAcl(project, principal_id = 273950)
diff --git a/docs/articles/systemDependencies.html b/docs/articles/systemDependencies.html
index dac3b180..367737a8 100644
--- a/docs/articles/systemDependencies.html
+++ b/docs/articles/systemDependencies.html
@@ -33,7 +33,7 @@
vignettes/systemDependencies.Rmd
systemDependencies.Rmd
vignettes/tables.Rmd
tables.Rmd
table <- synBuildTable("My Favorite Genes", project, genes)
table$schema
-## Schema(columns_to_store=[{'name': 'Name', 'columnType': 'STRING', 'maximumSize': 30, 'defaultValue': '', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Chromosome', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Start', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'End', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Strand', 'columnType': 'STRING', 'maximumSize': 30, 'defaultValue': '', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'TranscriptionFactor', 'columnType': 'BOOLEAN', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}, {'name': 'Time', 'columnType': 'INTEGER', 'concreteType': 'org.sagebionetworks.repo.model.table.ColumnModel'}], concreteType='org.sagebionetworks.repo.model.table.TableEntity', name='My Favorite Genes', parentId='syn53468053', columnIds=[])
synBuildTable
creates a Table Schema based on the data
and returns a Table object that can be stored in Synapse using
synStore()
. To create a custom Table Schema, defines the
@@ -189,20 +189,14 @@
We now have a table populated with data. Let’s try to query:
-results <- synTableQuery(sprintf('select * from %s where Chromosome=1 and Start < 41000 and "End" > 20000', tableId))
results <- synTableQuery(sprintf('select * from %s where Chromosome=1 and Start < 41000 and "End" > 20000', tableId), resultsAs = 'csv')
synTableQuery()
downloads the data and saves it to a csv
file at location:
results$filepath
To load the data into an R data.frame:
-as.data.frame(results)
-## ROW_ID ROW_VERSION Name Chromosome Start End Strand TranscriptionFactor
-## 1 1 1 foo 1 12345 126000 + FALSE
-## 2 4 1 bah 1 40444 41444 - FALSE
-## Time
-## 1 2017-02-14 03:23:11
-## 2 2020-11-02 20:59:59
df <- as.data.frame(results)
For example, let’s update the names of some of our favorite genes:
@@ -253,14 +247,14 @@Changing Data## 7 7 2 abc 2 12345 126000 + FALSE ## 8 8 2 def 2 20001 20200 + FALSE ## Time -## 1 2017-02-14 03:23:11 -## 2 1969-12-31 16:00:00 -## 3 2018-09-30 17:00:00 -## 4 2020-11-02 20:59:59 -## 5 2011-12-15 22:23:11 -## 6 1999-03-18 13:03:33 -## 7 2070-01-11 19:53:12 -## 8 2018-05-03 05:03:33
One other piece of information required for making changes to tables is the etag, which is used by the Synapse server to prevent concurrent users from making conflicting changes through a technique called @@ -370,14 +364,14 @@
Dates may also be submitted in timestamp milliseconds:
results <- synTableQuery(sprintf("select * from %s where Name='zap'", tableId))
df <- as.data.frame(results)
df$Time <- timestamp
synStore(Table(tableId, moreGenes))
-## <synapseclient.table.CsvFileTable object at 0x15a3ec410>
Note that using POSIXlt
is strongly preferred over
POSIXct
, because POSIXct
does not store values
with enough precision to reliably recover milliseconds. For more
@@ -422,7 +416,7 @@
To view annotations on table, retrieve the schema:
schema <- synGet(tableId)
diff --git a/docs/articles/troubleshooting.html b/docs/articles/troubleshooting.html
index 9c255391..210c862c 100644
--- a/docs/articles/troubleshooting.html
+++ b/docs/articles/troubleshooting.html
@@ -33,7 +33,7 @@
vignettes/troubleshooting.Rmd
troubleshooting.Rmd
vignettes/upload.Rmd
upload.Rmd
vignettes/views.Rmd
views.Rmd
To see the content of your newly created View, use synTableQuery():
-queryResults <- synTableQuery(sprintf("select * from %s", view$properties$id))
-data <- as.data.frame(queryResults)
-data
-## ROW_ID ROW_VERSION ROW_ETAG id
-## 1 53468060 1 e322e8c5-fed8-4d0a-a886-70ed89bbdee0 syn53468060
-## 2 53468061 1 ff0c5d37-a5ef-4122-871f-fdc2bd1d7b7c syn53468061
+queryResults <- synTableQuery(sprintf("select * from %s", view$properties$id))
+data <- as.data.frame(queryResults)
+data
## ROW_ID ROW_VERSION ROW_ETAG id
+## 1 61936088 1 24b535f4-5dc4-452c-8f2f-273b0a1065ba syn61936088
+## 2 61936090 1 9f61a946-506d-4c38-80c1-ad416a66c662 syn61936090
## name description createdOn createdBy
-## 1 file8f65792ab9d0 NA 2024-02-04 11:33:37 3324230
-## 2 file8f65640d44d5 NA 2024-02-04 11:33:39 3324230
-## etag modifiedOn modifiedBy type
-## 1 e322e8c5-fed8-4d0a-a886-70ed89bbdee0 2024-02-04 11:33:37 3324230 file
-## 2 ff0c5d37-a5ef-4122-871f-fdc2bd1d7b7c 2024-02-04 11:33:39 3324230 file
+## 1 file5f68b331f1c <NA> 2024-08-01 16:25:59 3434599
+## 2 file5f68516c0850 <NA> 2024-08-01 16:25:59 3434599
+## etag modifiedOn modifiedBy
+## 1 24b535f4-5dc4-452c-8f2f-273b0a1065ba 2024-08-01 16:25:59 3434599
+## 2 9f61a946-506d-4c38-80c1-ad416a66c662 2024-08-01 16:26:00 3434599
+## path type
+## 1 My unique project 30ebf9058adab6f606eec173f5a6c485/file5f68b331f1c file
+## 2 My unique project 30ebf9058adab6f606eec173f5a6c485/file5f68516c0850 file
## currentVersion parentId benefactorId projectId dataFileHandleId
-## 1 1 syn53468059 syn53468059 syn53468059 132873036
-## 2 1 syn53468059 syn53468059 syn53468059 132873037
+## 1 1 syn61936087 syn61936087 syn61936087 145242556
+## 2 1 syn61936087 syn61936087 syn61936087 145242558
## dataFileName dataFileSizeBytes dataFileMD5Hex
-## 1 file8f65792ab9d0 37 47dfe7f5eaa49a5413c7b79b67ab9c43
-## 2 file8f65640d44d5 38 ba01e01b9e3ffea3ebef95efa62998b0
+## 1 file5f68b331f1c 37 47dfe7f5eaa49a5413c7b79b67ab9c43
+## 2 file5f68516c0850 38 ba01e01b9e3ffea3ebef95efa62998b0
## dataFileConcreteType dataFileBucket
## 1 org.sagebionetworks.repo.model.file.S3FileHandle proddata.sagebase.org
## 2 org.sagebionetworks.repo.model.file.S3FileHandle proddata.sagebase.org
## dataFileKey contributor
-## 1 3324230/ce0802d8-a5a5-4650-9f0a-6396351e5ad0/file8f65792ab9d0 UW
-## 2 3324230/bf547068-10d8-4ca7-9ae0-dcdf28b16643/file8f65640d44d5 UW
+## 1 3434599/79ca9df2-76d2-4e5a-b6fe-85300911ef39/file5f68b331f1c UW
+## 2 3434599/6d00c029-74de-45e5-95ae-ba19858ff3b9/file5f68516c0850 UW
## class rank
-## 1 NA X
-## 2 NA X
+## 1 <NA> X
+## 2 <NA> X
To update ‘class’ annotation for ‘file2’, simply update the view:
-+The change in annotations is reflected in synGetAnnotations():
-@@ -81,6 +81,36 @@+synGetAnnotations(file2$properties$id)
A unique etag is associated with every file that updates when changes are made to a file, including the contents, annotations, or metadata. Any updates pushed to Synapse will change an object’s etag.
-+data$etag
There may be cases where you want to update the annotations on a subset of files in a view. In order to preserve the etag, and thus the file history, you will need to store only the rows that have been modified.
-diff --git a/docs/news/index.html b/docs/news/index.html index 17557418..beb7aab0 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@Update View’s Content
A view can contain different types of entity. To change the types of entity that will show up in a view:
-@@ -105,13 +105,13 @@+A View is a Table. Please visit Tables vignettes to see how to change schema, update content, and other operations that can be done on View.
-diff --git a/docs/authors.html b/docs/authors.html index 7cb501bc..b1f7c07e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@+synDelete(project) ## NULL
Citation
Hoff B (2024). synapser: R Language Bindings for Synapse API. -R package version 2.0.0, https://www.synapse.org. +R package version 2.1.0, https://www.synapse.org.
@Manual{, title = {synapser: R Language Bindings for Synapse API}, author = {Bruce Hoff}, year = {2024}, - note = {R package version 2.0.0}, + note = {R package version 2.1.0}, url = {https://www.synapse.org}, }diff --git a/docs/index.html b/docs/index.html index 13817776..02528275 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,7 +33,7 @@Changelog
Source:NEWS.md
synCreateTeam
and synDeleteTeam
have been added to manage team.synRestGetAsync
, synRestDeleteAsync
, synRestPostAsync
and synRestPutAsync
have been added to allow interaction with Synapse server utilizing asynchronous models.~/.synapseConfig
file.rememberMe
has been deprecated in synLogin
.synGet
and synSetProvenance
.Project
.synStore
.synCreateExternalS3FileHandle
.Represents a project in Synapse.
-Projects in Synapse must be uniquely named. Trying to create a project with -a name that's already taken, say 'My project', will result in an error
+Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say +'My project', will result in an error
An R6 class object.
+name: The name of the project
alias: The project alias for use in friendly project urls
properties: A map of Synapse properties
annotations: A map of user defined annotations
local_state: Internal use only
Represents a project in Synapse.
-Projects in Synapse must be uniquely named. Trying to create a project with -a name that's already taken, say 'My project', will result in an error
+Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say +'My project', will result in an error
Project(name=NULL, properties=NULL, annotations=NULL)
Project(name=NULL, properties=NULL, annotations=NULL, local_state=NULL, alias=NULL)
The name of the project
The name of the project
A named list/vector of Synapse properties. The only valid property name is 'alias'.
A map of Synapse properties
A named list/vector of user defined annotations.
A map of user defined annotations
Internal use only
The project alias for use in friendly project urls
if (FALSE) {
-project <- Project('Foobarbat project', properties=c(alias='foobarbat'), annotations=c(foo='bar', bat=101))
+project <- Project('Foobarbat ddd project', properties=list(alias='foobarbat'), annotations=list(foo='bar', bat=101))
project <- synStore(project)
project$properties
project$annotations$foo
diff --git a/docs/reference/Row-class.html b/docs/reference/Row-class.html
index a226d225..b30a6a9f 100644
--- a/docs/reference/Row-class.html
+++ b/docs/reference/Row-class.html
@@ -17,7 +17,7 @@
synCreateStorageLocationSetting()
synCreateStorageLocationSetting
synCreateTeam
synDeleteProvenance()
synDeleteProvenance
synDeleteTeam
synRestDELETE()
synRestDELETE
synRestDeleteAsync
synRestGET
synRestGetAsync
synRestPUT()
synRestPUT
synRestPostAsync
synRestPutAsync
synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL)
synCreateExternalS3FileHandle(bucket_name, s3_file_key, file_path, parent=NULL, storage_location_id=NULL, mimetype=NULL, md5=NULL)
Name of the S3 bucket
Name of the S3 bucket
S3 key of the uploaded object
S3 key of the uploaded object
Local path of the uploaded file
Local path of the uploaded file
Parent entity to create the file handle in, the file handle will be created
- in the default storage location of the parent. Mutually exclusive with
- storage_location_id
Parent entity to create the file handle in, the file handle will be created + in the default storage location of the parent. Mutually exclusive with + storage_location_id
Explicit storage location id to create the file handle in, mutually exclusive
- with parent
Explicit storage location id to create the file handle in, mutually exclusive + with parent
Mimetype of the file, if known
MD5 of the file, if known
If neither parent nor storage_location_id is specified, or if both are specified.
+synCreateTeam.Rd
Creates a new team
+synCreateTeam(name, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE)
The name of the team to create.
A description of the team.
The FileHandleID of the icon to be used for the team.
Whether the team can be joined by anyone. Defaults to FALSE.
Whether the team can request membership. Defaults to TRUE.
An Team object
+if (FALSE) {
+synCreateTeam('your_team_name')
+}
+
synDeleteTeam.Rd
Deletes a team
+synDeleteTeam(id)
The ID of the team to delete.
NULL
+if (FALSE) {
+synDeleteTeam('your_team_id')
+}
+
synGet(entity, version=NULL, downloadFile=NULL, downloadLocation=NULL, followLink=NULL, ifcollision=NULL, limitSearch=NULL)
synGet(entity)
A Synapse ID, a Synapse Entity object,
- a named list in which 'id' maps to a Synapse ID or
- a local file that is stored in Synapse (found by hash of file)
A Synapse ID (e.g. syn123 or syn123.1, with .1 denoting version), a Synapse Entity object, + a plain dictionary in which 'id' maps to a Synapse ID or a local file that is stored in + Synapse (found by the file MD5)
optional named parameter: The specific version to get.
- Defaults to the most recent version.
Optional. The specific version to get. + Defaults to the most recent version. If not denoted in the entity input.
optional named parameter: Whether associated files(s) should be downloaded.
- Defaults to TRUE
Optional. Whether associated files(s) should be downloaded. + Defaults to TRUE.
optional named parameter: Directory where to download the Synapse File Entity.
- Defaults to the local cache.
Optional. Directory where to download the Synapse File Entity. + Defaults to the local cache.
optional named parameter: Whether the link returns the target Entity.
- Defaults to FALSE
Optional. Whether the link returns the target Entity. + Defaults to FALSE.
optional named parameter: Determines how to handle file collisions.
- May be "overwrite.local", "keep.local", or "keep.both".
- Defaults to "keep.both".
Optional. Determines how to handle file collisions. + May be "overwrite.local", "keep.local", or "keep.both". + Defaults to "keep.both".
optional named parameter: a Synanpse ID used to limit the search in Synapse if entity is
- specified as a local file. That is, if the file is stored in multiple
- locations in Synapse only the ones in the specified folder/project will be
- returned.
Optional. A Synanpse ID used to limit the search in Synapse if entity is specified as a local + file. That is, if the file is stored in multiple locations in Synapse only the ones + in the specified folder/project will be returned.
Optional. The MD5 checksum for the file, if known. Otherwise if the file is a + local file, it will be calculated automatically.
A new Synapse Entity object of the appropriate type
+A new Synapse Entity object of the appropriate type.
Retrieve the open requests submitted to a Team -https://docs.synapse.org/rest/GET/team/id/openInvitation.html
+Retrieve the open requests submitted to a Team
A Team object or a
- team's ID.
A Team object or a team's ID.
generator of MembershipRequest
+Generator of MembershipRequest dictionaries
Logs the user in.
-If no login arguments are provided or only username is provided, login() will attempt to log in using + information from these sources (in order of preference):
synapseConfig file (in user home folder unless configured otherwise)
User defined arguments during a CLI session
User's Personal Access Token (aka: Synapse Auth Token) from the environment variable: SYNAPSE_AUTH_TOKEN
Retrieves user's authentication token from AWS SSM Parameter store (if configured)
synLogin(email=NULL, password=NULL, apiKey=NULL, sessionToken=NULL, rememberMe=FALSE, silent=FALSE, forced=FALSE)
synLogin(email=NULL, silent=FALSE, authToken=NULL, cache_client=TRUE)
Synapse user name (or an email address associated with a Synapse account)
Synapse user name (or an email address associated with a Synapse account). Defaults to NULL.
**!!WILL BE DEPRECATED!!** password. Please use authToken (Synapse personal access token)
Suppresses the "Welcome ...!" message. Defaults to FALSE.
**!!WILL BE DEPRECATED!!** Base64 encoded Synapse API key
A bearer authorization token, e.g. a personal access token, can be used in lieu of a
+ password or apiKey
**!!DEPRECATED FIELD!!** User's current session token. Using this field will ignore the following fields: email, password, apiKey
Whether to cache the Synapse client object in the Synapse module. Defaults to TRUE. When set to TRUE anywhere a Synapse object is optional you do not need to pass an instance of Synapse to that function, method, or class.
Whether the authentication information should be cached in your operating system's credential storage.
+
DEPRECATED. Whether the authentication information should be cached in your operating system's credential storage.
**GNOME Keyring** (recommended) or **KWallet** is recommonded to be installed for credential storage on **Linux** systems.
If it is not installed/setup, credentials will be stored as PLAIN-TEXT file with read and write permissions for the current user only (chmod 600).
On Windows and Mac OS, a default credentials storage exists so it will be preferred over the plain-text file.
Defaults to FALSE. Suppresses the "Welcome ...!" message.
DEPRECATED. Please use authToken (Synapse personal access token)
DEPRECATED. Base64 encoded Synapse API key
DEPRECATED. User's current session token. Using this field will ignore the following fields: email, password, apiKey
Defaults to FALSE. Bypass the credential cache if set.
DEPRECATED. Defaults to FALSE. Bypass the credential cache if set.
A bearer authorization token, e.g. a personal access token, can be used in lieu of a
- password or apiKey
Valid combinations of login() arguments:
-- email/username and password (**WILL BE DEPRECATED**)
-- email/username and apiKey (Base64 encoded string) (**WILL BE DEPRECATED**)
-- authToken
-- sessionToken (**DEPRECATED**)
-If no login arguments are provided or only username is provided, login() will attempt to log in using information from these sources (in order of preference):
-- User's personal access token from environment the variable: SYNAPSE_AUTH_TOKEN
-- .synapseConfig file (in user home folder unless configured otherwise)
-- cached credentials from previous `login()` where `rememberMe=True` was passed as a parameter
if (FALSE) {
-# with username/pass
-synLogin('myUsername', 'secretPassword')
-
# with a token, e.g. an access obtained from your Synapse profile
synLogin(authToken=token)
diff --git a/docs/reference/synLogout.html b/docs/reference/synLogout.html
index b1ec1c1b..e2ffc3e8 100644
--- a/docs/reference/synLogout.html
+++ b/docs/reference/synLogout.html
@@ -17,7 +17,7 @@
synRestDeleteAsync.Rd
Sends an HTTP DELETE request to the Synapse server.
+synRestDeleteAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI of resource to be deleted
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call
Any other arguments taken by a request method
Null
+if (FALSE) {
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine
+result <- run_coroutine(synRestDeleteAsync(uri="/entity/<your_entity_id>"))
+}
+
synRestGetAsync.Rd
Sends an HTTP GET request to the Synapse server.
+synRestGetAsync(uri, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI on which get is performed
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call.
Any other arguments taken by a request method
JSON encoding of response
+if (FALSE) {
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine
+result <- run_coroutine(synRestGetAsync(uri="/entity/entity_id"))
+}
+
synRestPostAsync.Rd
Sends an HTTP POST request to the Synapse server.
+synRestPostAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI on which get is performed
The payload to be delivered
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call.
Any other arguments taken by a request method
JSON encoding of response
+if (FALSE) {
+library(jsonlite)
+# create payload
+request <- list(includeEntity = TRUE)
+body <- toJSON(request, auto_unbox = TRUE)
+
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine to get the bundle
+result <- run_coroutine(synRestPostAsync(uri="/entity/entity_id/bundle2",body=body))
+}
+
synRestPutAsync.Rd
Sends an HTTP PUT request to the Synapse server.
+synRestPutAsync(uri, body=NULL, endpoint=NULL, headers=NULL, retry_policy=list(), requests_session_async_synapse=NULL)
URI on which get is performed
The payload to be delivered
Server endpoint. Defaults to repoEndpoint
Dictionary of headers to use
A retry policy that matches the arguments of synapseclient.core.retry.with_retry_time_based_async.
The async client to use when making this + specific call.
Any other arguments taken by a request method
JSON encoding of response
+if (FALSE) {
+library(jsonlite)
+# create payload
+request <- list(includeEntity = TRUE)
+body <- toJSON(request, auto_unbox = TRUE)
+
+# a helper function to run async function
+run_coroutine <- function(coroutine) {
+ asyncio <- import("asyncio")
+ result <- asyncio$run(coroutine)
+ return(result)
+ }
+# run the coroutine to get the entity bundle
+entity_bundle <- run_coroutine(synRestPostAsync(uri="/entity/entity_id/bundle2",body=body))
+
+# update a field on the entity
+entity_bundle$entity$description <- "NEW_DESCRIPTION"
+
+# update the entity back to Synapse
+request <- list(entity = entity_bundle$entity)
+body <- toJSON(request, auto_unbox = TRUE)
+updated_entity_bundle = run_coroutine(synRestPutAsync(uri=paste0("/entity/",entity_bundle$entity$id,"/bundle2"), body=body))
+}
+
An Entity or Synapse ID to modify
Identifier of a user or group
Identifier of a user or group. '273948' is for all registered Synapse users
+ and '273949' is for public access. None implies public access.
Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE, DELETE, CHANGE_PERMISSIONS
Set as TRUE when modifying a benefactor's ACL
Set as FALSE, when creating a new ACL.
- Trying to modify the ACL of an Entity that
- inherits its ACL will result in a warning
Set as FALSE, when creating a new ACL. + Trying to modify the ACL of an Entity that inherits its ACL will result in a warning
By default this function overwrites existing
- permissions for the specified user. Set this
- flag to FALSE to add new permissions nondestructively.
By default this function overwrites existing permissions for the specified user. + Set this flag to FALSE to add new permissions non-destructively.
an Access Control List object
+An Access Control List object
synStore(obj, used=NULL, executed=NULL, activity=NULL, activityName=NULL, activityDescription=NULL, createOrUpdate=NULL, forceVersion=NULL, versionLabel=NULL, isRestricted=NULL)
synStore(obj, createOrUpdate=TRUE, forceVersion=TRUE, versionLabel=NULL, isRestricted=FALSE, activity=NULL, used=NULL, executed=NULL, activityName=NULL, activityDescription=NULL, set_annotations=TRUE)
A Synapse Entity, Evaluation, or Wiki
A Synapse Entity, Evaluation, or Wiki.
optional named parameter: The Entity, Synapse ID, or URL
- used to create the object (can also be a list of these)
Optional. The Entity, Synapse ID, or URL used to create the object (can also be a list of these.
optional named parameter: The Entity, Synapse ID, or URL representing code executed
- to create the object (can also be a list of these)
Optional. The Entity, Synapse ID, or URL representing code executed to create the object + (can also be a list of these).
optional named parameter: Activity object specifying the user's provenance
Optional. Activity object specifying the user's provenance.
optional named parameter: Activity name to be used in conjunction with *used* and *executed*.
Optional. Activity name to be used in conjunction with used and executed.
optional named parameter: Activity description to be used in conjunction with *used* and *executed*.
Optional. Activity description to be used in conjunction with used and executed.
optional named parameter: Indicates whether the method should automatically perform an update if the 'obj'
- conflicts with an existing Synapse object. Defaults to TRUE.
Optional. Indicates whether the method should automatically perform an update if the 'obj'
+ conflicts with an existing Synapse object. Defaults to TRUE.
optional named parameter: Indicates whether the method should increment the version of the object even if
- nothing has changed. Defaults to TRUE.
Optional. Indicates whether the method should increment the version of the object even if
+ nothing has changed. Defaults to TRUE.
optional named parameter: Arbitrary string used to label the version.
Optional. Arbitrary string used to label the version.
optional named parameter: If set to true, an email will be sent to the Synapse access control team
- to start the process of adding terms-of-use
- or review board approval for this entity.
- You will be contacted with regards to the specific data being restricted
- and the requirements of access.
Optional.If set to TRUE, an email will be sent to the Synapse access control team to start the + process of adding terms-of-use or review board approval for this entity. + You will be contacted with regards to the specific data being restricted and the + requirements of access. Defaults to FALSE.
If TRUE, set the annotations on the entity. If FALSE, do not set the annotations. Defaults to TRUE.
if (FALSE) {
# Create a new project
+
project <- Project('My uniquely named project')
project <- synStore(project)
@@ -152,21 +154,19 @@ Examples
# A synapse entity *syn1906480* contains data
# entity *syn1917825* contains code
#
-activity <- Activity(
- 'Fancy Processing',
- description='No seriously, really fancy processing',
- used=c('syn1906480', 'http://data_r_us.com/fancy/data.txt'),
- executed='syn1917825')
+activity <- Activity('Fancy Processing',
+ description='No seriously, really fancy processing',
+ used=c('syn1906480', 'http://data_r_us.com/fancy/data.txt'),
+ executed='syn1917825')
file <- File('/path/to/data/file.xyz', description='Fancy new data', parent=project)
file <- synStore(file, activity=activity)
# Evaluation
-eval <- Evaluation(
- name = sprintf("My unique evaluation created on %s", format(Sys.time(), "%a %b %d %H%M%OS4 %Y")),
- description = "testing",
- contentSource = project$properties$id,
- submissionReceiptMessage = "Thank you for your submission!",
- submissionInstructionsMessage = "This evaluation only accepts files.")
+eval <- Evaluation(name =sprintf("My unique evaluation created on %s", format(Sys.time(), "%a %b %d %H%M%OS4 %Y")),
+ description = "testing",
+ contentSource = project$properties$id,
+ submissionReceiptMessage = "Thank you for your submission!",
+ submissionInstructionsMessage = "This evaluation only accepts files.")
eval <- synStore(eval)
# Wiki
@@ -175,10 +175,10 @@ Examples
Here is a description of my **fantastic** project!
"
-
-wiki <- Wiki(owner = project,
- title = "My Wiki Page",
- markdown = content)
+wiki = Wiki(title='My Wiki Page',
+ owner=project,
+ markdown=content,
+ attachments=list('/path/to/logo.png'))
wiki <- synStore(wiki)
}