...
Push everything up to Synapse:
storeEntitysynPut(f, recurse='true')
Behind the scenes the client must do this
0. Start a transaction to upload a bundle of entities
1. Create someFileHandle as a child File of f of type .txt. Synapse generates preview of it
...
3. Always, (or only if vector / matrix are large), create them as additional child Files File handles (.csv?)
4. Create another File handle to store the plot
5. Update the annotations on f to include the 3 primitive types, and 5 additional annotations references child files.
6. End the transaction to upload a bundle of entities
bundleId <- startBundle()
tempFile1 <- File(parentId=f$id, bundle=bundleId)
tempFile1 <- storeEntity(tempFile1)
.... upload more pieces
...
all the file / folder entities in one call to reference all the new File Handles. This could be done via generalization of the "bundle" or "package" API currently in use to optimize data transfer between the service and web tiers. In the simplest case, users aren't exposed to a new object at all, but the use of options like recurse=true would use this object under the covers.
Another user must be able to do this to get back the same data:
...
Alice turns her set of scripts into a publicly-hosted R package. This includes the development of R objects specific to her analysis that encapsulate some of the key steps / data structures that are handed off between different steps. She also includes helper functions that store and retrieve the pieces of the object in Synapse as a set of folders, files, and annotations that follow a particular convention. She then develops This set of objects together would be a Package - a higher level API allowing interactions with a collection of files and folders in a single transaction. Objects in scientific analytical environments can be mapped to Packages to make the Synapse back end feel more like an object store. This approach allow allows Alice to develop a widget for the Synapse UI that presents a visualization of this data in a way understandable by her collaborators. This gives her and other analysts an object-centric view of the data structures relevant to this analysis in R, and the ability to easily load and save these objects to/from Synapse. Other analysts can do the same thing in other environments (e.g. Python) by defining similar objects and helper functions.
...