Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
d47c5030
Commit
d47c5030
authored
7 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
40caa09b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+51
-2
51 additions, 2 deletions
README.md
with
51 additions
and
2 deletions
README.md
+
51
−
2
View file @
d47c5030
...
...
@@ -4,10 +4,13 @@
from pybis import Openbis
o = Openbis('https://example.com:8443', verify_certificates=False)
o.login('username', 'password', save_token=True) # saves the session token in ~/.pybis/example.com.token
o.
get_datastores()
o.
token
o.is_session_active()
o.get_datastores()
o.logout()
# Masterdata
o.get_experiment_types()
o.get_sample_types()
...
...
@@ -20,6 +23,8 @@ o.get_terms()
o.get_terms('MATING_TYPE')
o.get_tags()
# Spaces and Projects
o.get_spaces()
o.get_space('MY_SPACE')
...
...
@@ -31,8 +36,50 @@ project.download_attachments()
p.add_attachment(fileName='testfile', description= 'another file', title= 'one more attachment')
p.save()
# Samples
sample = o.new_sample(
type='YEAST',
space='MY_SPACE',
parents=[parent_sample, '/MY_SPACE/YEA66'],
children=[child_sample]
)
sample.space
sample.code
sample.permId
sample.identifier
sample.type # once the sample type is defined, you cannot modify it
sample.space
sample.space = 'MY_OTHER_SPACE'
sample.experiment # a sample can belong to one experiment only
sample.experiment = 'MY_SPACE/MY_PROJECT/MY_EXPERIMENT'
sample.tags
sample.tags = ['guten_tag', 'zahl_tag' ]
sample.get_parents()
sample.get_childeren()
sample.props, sample.p
sample.get_attachments()
sample.download_attachments()
sample.add_attachment('testfile.xls')
samples = o.get_samples(
space='MY_SPACE',
type='YEAST'
tags=['*'] # tags must be present
NAME = 'some name' # properties are all uppercase
props=['name', 'mating_type','show_in_project_overview'] # properties to be displayed in the dataFrame
)
samples.df # returns a pandas dataframe object
samples.get_datasets(type='ANALYZED_DATA') # for all found samples get all datasets
# Note: Project samples are not implemented yet.
# Experiments
o.new_experiment(type='DEFAULT_EXPERIMENT', space='MY_SPACE', project='YEASTS')
o.new_experiment
type='DEFAULT_EXPERIMENT',
space='MY_SPACE',
project='YEASTS'
)
o.get_experiments(
project='YEASTS',
space='MY_SPACE',
...
...
@@ -51,6 +98,8 @@ exp.attrs.tags = ['some', 'extra', 'tags']
exp.tags = ['some', 'extra', 'tags'] # same thing
exp.save()
# Datasets
sample.get_datasets()
ds = o.get_dataset('20160719143426517-259')
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment