Activity: Constructor for objects of type Activity

Description Usage Arguments Details Value Examples

Description

Represents the provenance of a Synapse Entity.

Usage

1
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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## 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')


## End(Not run)

Sage-Bionetworks/synapser documentation built on July 12, 2019, 11:46 a.m.