Skip to content
Snippets Groups Projects
Commit 059006ab authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-5738 pyBIS : Support for semantic annotations - documentation

parent 6fee3f0f
No related branches found
No related tags found
No related merge requests found
...@@ -59,9 +59,9 @@ Samples ...@@ -59,9 +59,9 @@ Samples
:: ::
sample = o.new_sample( sample = o.new_sample(
type='YEAST', type='YEAST',
space='MY_SPACE', space='MY_SPACE',
parents=[parent_sample, '/MY_SPACE/YEA66'], parents=[parent_sample, '/MY_SPACE/YEA66'],
children=[child_sample] children=[child_sample]
) )
sample.space sample.space
...@@ -119,9 +119,9 @@ Experiments ...@@ -119,9 +119,9 @@ Experiments
) )
o.get_experiments( o.get_experiments(
project='YEASTS', project='YEASTS',
space='MY_SPACE', space='MY_SPACE',
type='DEFAULT_EXPERIMENT', type='DEFAULT_EXPERIMENT',
tags='*', tags='*',
finished_flag=False, finished_flag=False,
props=['name', 'finished_flag'] props=['name', 'finished_flag']
) )
...@@ -163,11 +163,11 @@ Datasets ...@@ -163,11 +163,11 @@ Datasets
ds.download(destination='/tmp', wait_until_finished=False) ds.download(destination='/tmp', wait_until_finished=False)
ds_new = o.new_dataset( ds_new = o.new_dataset(
type='ANALYZED_DATA', type='ANALYZED_DATA',
experiment=exp, experiment=exp,
sample= samp, sample= samp,
parents=[my_dataset, '20160713173002405-212'], parents=[my_dataset, '20160713173002405-212'],
files = ['my_analyzed_data.dat'], files = ['my_analyzed_data.dat'],
props={'name': 'we give this dataset a name', 'notes': 'and we might need some notes, too'}) props={'name': 'we give this dataset a name', 'notes': 'and we might need some notes, too'})
) )
ds_new.save() ds_new.save()
...@@ -191,6 +191,44 @@ Datasets ...@@ -191,6 +191,44 @@ Datasets
for dataset in datasets: for dataset in datasets:
print(ds.permID) print(ds.permID)
Semantic Annotations
--------------------
::
# create semantic annotation for sample type
o.new_semantic_annotation(entityType = 'UNKNOWN')
# create sementic annotation for property type
o.new_semantic_annotation(propertyType = 'DESCRIPTION')
# create semantic annotation for sample property assignment
o.new_semantic_annotation(entityType = 'UNKNOWN', propertyType = 'DESCRIPTION')
# create semantic annotation with additional fields
o.new_semantic_annotation(entityType = 'UNKNOWN',
predicateOntologyId = 'po_id',
predicateOntologyVersion = 'po_version',
predicateAccessionId = 'pa_id',
descriptorOntologyId = 'do_id',
descriptorOntologyVersion = 'do_version',
descriptorAccessionId = 'da_id')
# get all semantic annotations
o.get_semantic_annotations()
# get semantic annotation by perm id
sa = o.get_semantic_annotation("20171015135637955-30")
# update semantic annotation
sa.predicateOntologyId = 'new_po_id'
sa.descriptorOntologyId = 'new_do_id'
sa.save()
# delete semantic annotation
sa.delete('reason')
Requirements and organization Requirements and organization
============================= =============================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment