Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Code Integration

...

R Convenience Functions

codeObj <- Code(name, parent, localRoot)

parameters

name

parent: a Project ID

localRoot: local 'root' directory for code files.  If omitted a default is used.

side effects
none

returns

new Code object

addFile(codeObj, localPath)

parameters

codeObj

localPath: path to file or directory on machine running the R session

side effects

 none

returns

 nothing

storeEntity(codeObj)

parameters

 codeObj

side effects

zips files and pushes them to S3.  The file path stored is relative to the 'localRoot' in the code object.

Creates or updates metadata in Synapse, including S3 location.

returns

 nothing

downloadEntity(codeId, localRoot)

parameters

codeId: id of metadata object in Synapse

localRoot: local 'root' directory for code files.  If omitted a default is used.

side effects

 Downloads code files to directory(ies) under the 'local root'

returns

Code object

loadEntity(codeObj)

parameters

codeObj

side effects

If (codeId!=null)

  • Get current Step. 
  • Adds reference to Synapse Code object into Step.

'sources' code into memory

(i.e. if 'codeObj' is just a local variable, this is a utility to source a collection of files.)

returns

codeObj

deleteEntity(codeId)

parameters

codeId: ID of the object in Synapse

side effects

Delete metadata from Synapse.

Deletes files from S3. 

returns

Nothing.

Scenarios

...

Scenarios

The development cycle for preexisting code:  The code is Downloaded from Synapse, and Loaded into the R session.  The user repeatedly Runs, Edits and reLoads the code.  When satisfied, she may Store the code back to Synapse.  To help capture provenance, the Load and Store functions put the Code's ID and version into the current Step.  For the provenance record to be accurate, the user must Store prior to running.

  Image Added

Discover, retrieve, load and run code

A user, browsing Synapse, sees a piece of code of interest (mentioned in a discussion or used in an analysis), and clicks on it.  She sees:

...

and begins by executing this in R.

Discover, retrieve and load code into R session

Image Removed

Retrieve existing code, modify and save.

Image Removed

Develop new code, then

...

(Per Matt F., this is an important use case for data curators.)
Image Removed

Run code and capture provenance info.

...

Store

Image Added