Versions Compared

Key

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

...

The model Synapse uses for provenance is based on the W3C provenance spec where items are derived from an activity which has components that were used and components that were executed. Think of the used items as input files and executed items as software or code. Both used and executed items can reside in Synapse or in URLs such as a link to a GitHub commit or a link to a specific version of a software tool.

...

There are a couple ways to set provenance information for a Synapse entity. The used and executed arguments specify resources used and code executed in the process of creating the entity. Code can be stored in Synapse (as we did in the previous step) or, better yet, linked by URL to a source code versioning system like GitHub or SVN. As an example, we’ll specify two somewhat contrived sources of provenance:

  1. Synapse entity by synID: syn7205215 (the code file)

  2. URL to a page describing normal distributions

Web

The web client does not support setting provenance when uploading a file. Instead, upload the file first, then navigate to the file in your project. Click on the File Tools dropdown in the upper right hand corner and select Edit File Provenance. In the resulting pop-up, enter the relevant information. If you are entering an external URL as a reference, include the full URL path. In this example, you would enter http://mathworld.wolfram.com/NormalDistribution.html.

...

To update the provenance on a file, navigate to the File that you would like to update. Click on the File Tools dropdown in the upper right hand corner and select Edit File Provenance. In the resulting pop-up, enter the relevant information.

...

Command Line

Code Block
# Add the data file to Synapse
synapse add squares.txt -parentId syn1901847 
# Set the provenance for newly created entity syn7209166 using synId
synapse set-provenance -id syn7209166 -executed syn7209078 -used syn7208917
# Set the provenance for newly created entity syn7209166 using local path
synapse set-provenance -id syn7209166 -executed ./square.R -used ./random_numbers.txt

...

Code Block
languager
# Code used to generate the file will be syn123456
# Files used to generate the information
expr_file <- synGet("syn246810", download=F)
filter_file <- synGet("syn135791", download=F)

# Activity to assign to multiple files
act <- Activity(name="filtering",
                used=list(expr_file, filter_file),
                executed="syn123456")
finalFile <- synStore(finalFile, activity=act)

# Get the activity now associated with an entity
act <- synGetProvenance(finalFile)

# Now you can set this activity to as many files as you want (file1, file2, etc are Synapse Files)
finalList <- c(file1, file2, file3)
finalList <- lapply(finalList, function(x) synStore(x, activity=act))

...