Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Code Integration: Operations and Scenariosand Scenarios

R Convenience Functions

saveCode(localFolder, codeRepo)

...

Note: Code version is not recorded in the code metadata.

loadCode(id, localFolder)

parameters

id: ID of the object in Synapse

localFolder: location for local copy of code. If omitted, then a default location is used.

side effects

Check out code from code repository, if not already checked out.  Otherwise, updates local copy from code repository.

"Source" code into R session.

returns

nothing

TODO: What if not all steps are successful?

...

saveAndRun(localFolder, codeRepo)

parameters

localFolder: folder or file on the local file system

codeRepo short, easily remembered 'nickname' of code repository system. If omitted, user's default is used.

side effects

Register folder with code repository, if not already registered.

...

"Source" code into R session.

TODO: Should the convenience function do something to run the code, or can we say it's the code's responsibility to run when it's sourced?Call "run()".

TODO: Check if code has changed before committing, to avoid making new version each time code is run.

returns

ID of the object created in Synapse

Note: Code version is not recorded in the code metadata.

loadCode(id, localFolder)

parameters

id: ID of the object in Synapse

localFolder: location for local copy of code. If omitted, then a default location is used.

side effects

Check out code from code repository, if not already checked out.  Otherwise, updates local copy from code repository.

"Source" code into R session.

returns

location of local copy of code

TODO: What if not all steps are successful?

delete(id)

parameters

ID of the object in Synapse

...

TODO: What if not all steps are successful?
TODO: Should we delete from the local disk? From the R session?

TODO: Can we defer the convenience function for loading a specific code version?

Web Services

These manipulation only the metadata, stored in Synapse.
Note: It is assumed that code versions are represented by refererences.

...