synapseExecute(executable, args, resultParentId, codeParentId, resultEntityProperties, resultEntityName, replChar=".")
Function for executing code, uploading results, and creating a provenance record in Synapse
Executable may be one of the following:
list(repoName=. The repo name is of the form
/owner/reponame. The source file is the full path to the R source file.
A Code entity is created for the given Code. If there is an existing Code entity in the target Synapse location (described below), and if the code file differs from the existing, then a new revision of the existing Code entity is created.
If the Code entity is a file or an in-memory function, then then the Code entity created is placed in the folder or project
codeParentId parameter. If the Code entity is a file, then then the Code entity created is named using
the file path of the code file.
If the Code entity is a github reference then an entity hierarchy is created under the folder/project given by
The if the code is in a (local or github) file, the file is loaded. Since a Code file can contain multiple functions, synapseExecute disambiguates the function to call as follows: If there's just one function, that is the one called. If there are multiple functions and one is named according to the containing file, that is the one called. Otherwise, synapseExecute stops.
An Activity (provenance record) is created which 'generates' the output entity and whose 'used' entities are (1) the aforementioned Code
object, (2) any Synapse entities included in
resultEntityProperties lists are added as annotations of the result entity.
The result entity is created in the given parent project/folder and having the given name. If such an
entity already exists then a new revision of the entity is created.