Represents the provenance of a Synapse Entity.

Activity(name=NULL, description=NULL, used=NULL, executed=NULL, data=list())

Arguments

name

name of the Activity

description

a short text description of the Activity

used

Either a list of:
- reference objects (e.g. ``list('targetId'='syn123456', 'targetVersionNumber'=1)``)
- a list of Synapse Entities or Entity IDs
- a list of URL's

executed

A code resource that was executed to generate the Entity.

data

A list representation of an Activity,
with each element having named values 'name', 'description' and 'used'

Details

The Activity object represents the source of a data set or the data processing steps used to produce it. Using W3C provenance ontology terms, a result is **generated by** a combination of data and code which are either **used** or **executed**.

Value

An object of type Activity

References

Note

See also

Examples

# NOT RUN {
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Creating an activity object
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
act <- Activity(name='clustering',
                   description='whizzy clustering',
                   used=c('syn1234','syn1235'),
                   executed='syn4567')

# Here, syn1234 and syn1235 might be two types of measurements on a common set of
# samples. Some whizzy clustering code might be referred to by syn4567.  The used and
# executed can reference entities in Synapse or URLs.

# Alternatively, you can build an activity up piecemeal:

act <- Activity(name='clustering', description='whizzy clustering')
act$used(c('syn12345', 'syn12346'))
act$executed('https://raw.githubusercontent.com/Sage-Bionetworks/synapsePythonClient/develop/tests/unit/unit_test_client.py')

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Storing entities with provenance
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# The activity can be passed in when storing an Entity to set the Entity's provenance:

clustered_samples <-synStore(clustered_samples, activity=act)

# We've now recorded that `clustered_samples` is the output of our whizzy clustering algorithm
# applied to the data stored in syn1234 and syn1235.

# ~~~~~~~~~~~~~~~~~~~~~
# Recording data source
# ~~~~~~~~~~~~~~~~~~~~~

# synStore() has shortcuts for specifying the used and executed lists directly. For example, when
# storing a data entity, it's a good idea to record its source::

excellent_data <- synStore(excellent_data,
                               activityName='data-r-us',
                               activityDescription='downloaded from data-r-us',
                               used='http://data-r-us.com/excellent/data.xyz')

# }