Newer
Older
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Working with pybis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## connect to openBIS\n",
"(using stored session token ~/.pybis/localhost.token)"
]
},
{
"cell_type": "code",
"source": [
"from pybis import Openbis\n",
"o = Openbis(url='https://localhost:8443', verify_certificates=False)\n",
"o.token"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"check if session is still active:"
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.is_session_active()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"login with a password if the token is no longer valid - and store the token"
]
},
{
"cell_type": "code",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"········\n"
]
},
{
"data": {
"text/plain": [
"'vermeul-180926010607740x90FB53D7BFEB6F8D6E3F634753E5E5E5'"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o = Openbis('https://localhost:8443', verify_certificates=False)\n",
"password = getpass.getpass()\n",
"o.login('vermeul',password, save_token=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"you can connect to another openBIS instance if you like to:"
]
},
{
"cell_type": "code",
"execution_count": 82,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"········\n"
]
},
{
"data": {
"text/plain": [
"'vermeul-170213105248365xBB06092567F9EE09864C78CDBDB14CA9'"
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from pybis import Openbis\n",
"import getpass\n",
"o2 = Openbis('https://sprint-openbis.ethz.ch:8443', verify_certificates=False)\n",
"password = getpass.getpass()\n",
"o2.login('vermeul',password)\n",
"o2.token"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"disconnnect (or rather: make the session key invalid):"
]
},
{
"cell_type": "code",
"outputs": [],
"source": [
"o2.logout()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## get general information about openBIS"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Data Store Servers (DSS)"
]
},
{
"cell_type": "code",
"execution_count": 9,
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>code</th>\n",
" <th>downloadUrl</th>\n",
" <th>hostUrl</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>DSS1</td>\n",
" <td>https://localhost:8444/datastore_server</td>\n",
" <td>https://localhost:8444</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" code downloadUrl hostUrl\n",
"0 DSS1 https://localhost:8444/datastore_server https://localhost:8444"
]
},
"execution_count": 9,
"output_type": "execute_result"
}
],
"source": [
"o.get_datastores()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"list all available spaces:"
]
},
{
"cell_type": "code",
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>code</th>\n",
" <th>description</th>\n",
" <th>registrationDate</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>ANOTHER_SPACE_NAME</td>\n",
" <td>another space description</td>\n",
" <td>2016-07-15 02:54:45</td>\n",
" <td>2016-07-15 02:54:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>MATERIALS</td>\n",
" <td>None</td>\n",
" <td>2016-06-24 11:47:52</td>\n",
" <td>2016-06-24 11:47:52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>METHODS</td>\n",
" <td>None</td>\n",
" <td>2016-06-24 11:47:53</td>\n",
" <td>2016-06-24 11:47:53</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>MY_NEW_SPACE</td>\n",
" <td>this is yet another space</td>\n",
" <td>2016-07-15 03:02:14</td>\n",
" <td>2016-07-15 03:02:14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>VERMEUL</td>\n",
" <td>Space for user vermeul</td>\n",
" <td>2016-06-24 11:50:48</td>\n",
" <td>2016-06-24 11:50:48</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<pybis.pybis.Things at 0x7f7ff39e4fd0>"
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_spaces()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>permId</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>description</td> <td>this is yet another space</td> </tr><tr> <td>registrator</td> <td>vermeul</td> </tr><tr> <td>registrationDate</td> <td>2016-07-15 03:02:14</td> </tr><tr> <td>modificationDate</td> <td>2016-07-15 03:02:14</td> </tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.pybis.Space at 0x7f7ff5194898>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sp = o.get_space('my_new_space')\n",
"# another way: get space number 3 from the list above.\n",
"# sp = o.get_spaces()[3]\n",
"# sp = o.get_spaces()['MY_NEW_SPACE']\n",
{
"cell_type": "markdown",
"metadata": {},
"source": [
"list all the projects within that space"
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>identifier</th>\n",
" <th>permId</th>\n",
" <th>leader</th>\n",
" <th>registrator</th>\n",
" <th>registrationDate</th>\n",
" <th>modifier</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT</td>\n",
" <td>20160926234755430-363</td>\n",
" <td>None</td>\n",
" <td>vermeul</td>\n",
" <td>2016-09-26 23:47:55</td>\n",
" <td>admin</td>\n",
" <td>2017-01-20 23:57:45</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<pybis.pybis.Things at 0x7f7ff39e8940>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"get details of the first project in this list"
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>VERMEUL_PROJECT</td> </tr><tr> <td>description</td> <td>my first project in my space...</td> </tr><tr> <td>permId</td> <td>20160926234755430-363</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT</td> </tr><tr> <td>space</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>leader</td> <td></td> </tr><tr> <td>registrator</td> <td>vermeul</td> </tr><tr> <td>registrationDate</td> <td>2016-09-26 23:47:55</td> </tr><tr> <td>modifier</td> <td>admin</td> </tr><tr> <td>modificationDate</td> <td>2017-01-20 23:57:45</td> </tr><tr><td>attachments</td><td>pybis.pdf</td></tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.pybis.Project at 0x7f6a2776dbe0>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pr = sp.get_projects()[0]\n",
"# this works too:\n",
"# pr = sp.get_projects()['/MY_NEW_SPACE/VERMEUL_PROJECT']\n",
"pr"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**TAB completion**: list all possible attributes and methods by hitting the TAB key"
]
},
{
"cell_type": "code",
},
"outputs": [],
"source": [
"# try it: put the cursor after the dot and press TAB\n",
"pr."
"cell_type": "markdown",
"metadata": {},
"Fetch the experiments that belong to a project"
]
},
{
"cell_type": "code",
"execution_count": 87,
"outputs": [],
"source": [
"pr = o.get_project('/MY_NEW_SPACE/VERMEUL_PROJECT')"
]
},
{
"cell_type": "code",
"execution_count": 88,
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>identifier</th>\n",
" <th>permId</th>\n",
" <th>project</th>\n",
" <th>type</th>\n",
" <th>registrator</th>\n",
" <th>registrationDate</th>\n",
" <th>modifier</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT/EXP_NEW</td>\n",
" <td>20170127005816666-430</td>\n",
" <td>VERMEUL_PROJECT</td>\n",
" <td>None</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-27 00:58:17</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-27 00:58:17</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
" <td>20160924020719018-358</td>\n",
" <td>VERMEUL_PROJECT</td>\n",
" <td>None</td>\n",
" <td>vermeul</td>\n",
" <td>2016-09-24 02:07:19</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-09 00:05:43</td>\n",
" </tr>\n",
" <tr>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPER...</td>\n",
" <td>20161121013609807-402</td>\n",
" <td>VERMEUL_PROJECT</td>\n",
" <td>None</td>\n",
" <td>vermeul</td>\n",
" <td>2016-11-21 01:36:10</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-20 23:41:42</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"0\t/MY_NEW_SPACE/VERMEUL_PROJECT/EXP_NEW\n",
"1\t/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4\n",
"2\t/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT"
"execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exs = pr.get_experiments()\n",
"exs"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"... using a different approach"
]
},
{
"cell_type": "code",
"execution_count": 90,
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>identifier</th>\n",
" <th>permId</th>\n",
" <th>project</th>\n",
" <th>type</th>\n",
" <th>registrator</th>\n",
" <th>registrationDate</th>\n",
" <th>modifier</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT/EXP_NEW</td>\n",
" <td>20170127005816666-430</td>\n",
" <td>VERMEUL_PROJECT</td>\n",
" <td>None</td>\n",
" <td>2017-01-27 00:58:17</td>\n",
" <td>2017-01-27 00:58:17</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
" <td>20160924020719018-358</td>\n",
" <td>VERMEUL_PROJECT</td>\n",
" <td>None</td>\n",
" <td>2016-09-24 02:07:19</td>\n",
" <td>2017-01-09 00:05:43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPER...</td>\n",
" <td>20161121013609807-402</td>\n",
" <td>VERMEUL_PROJECT</td>\n",
" <td>None</td>\n",
" <td>2016-11-21 01:36:10</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-20 23:41:42</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
"0\t/MY_NEW_SPACE/VERMEUL_PROJECT/EXP_NEW\n",
"1\t/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4\n",
"2\t/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT"
"execution_count": 90,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_experiments(project='/MY_NEW_SPACE/VERMEUL_PROJECT')"
"cell_type": "markdown",
"metadata": {},
"**get vocabulary terms**"
]
},
{
"cell_type": "code",
"execution_count": 24,
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>vocabulary term</th>\n",
" <th>label</th>\n",
" <th>description</th>\n",
" <th>vocabulary</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>PBLUESCRIPT_II_KS_PLUS</td> <td>pBluescript II KS +</td> <td>Commercial vector for cloning in bacteria (Stratagene)</td> <td>BACKBONE</td> </tr><tr> <td>PSPPOLY_A</td> <td>pSPpoly(A)</td> <td>Standard cloning vector. It can be used for in vitro trascription from SP6 promoter. It contains a poly(A) to generate poly(A)+ transcripts in vitro (Promega)</td> <td>BACKBONE</td> </tr><tr> <td>PRS30Y</td> <td>pRS30y</td> <td>Integrative yeast shuttle vector from Sikorski et al, 1989</td> <td>BACKBONE</td> </tr><tr> <td>PRS31Y</td> <td>pRS31y</td> <td>Centromeric yeast shuttle vector from Sikorski et al, 1989</td> <td>BACKBONE</td> </tr><tr> <td>PRS40Y</td> <td>pRS40y</td> <td>Integrative yeast shuttle vector from Sikorski et al, 1992</td> <td>BACKBONE</td> </tr><tr> <td>PRS41Y</td> <td>pRS41y</td> <td>Centromeric yeast shuttle vector from Sikorski et al, 1992</td> <td>BACKBONE</td> </tr><tr> <td>PRS42Y</td> <td>pRS42y</td> <td>2-micron-based yeast shuttle vector from Sikorski et al, 1992</td> <td>BACKBONE</td> </tr><tr> <td>UNKNOWN</td> <td>unknown</td> <td>unknown vector</td> <td>BACKBONE</td> </tr><tr> <td>PGEX4T1</td> <td>pGEX4T1</td> <td>Vector for bacterial expression</td> <td>BACKBONE</td> </tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.masterdata.Vocabulary at 0x7f3140fafeb8>"
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = o.get_terms('Backbone')\n",
"x"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## get information about general types"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"OpenBIS categorizes some of its entities in «types»:\n",
"\n",
"* sample type\n",
"* experiment type\n",
"* material type\n",
"* dataset type\n",
"\n",
"The types define the collection of **properties** that can be later assigned to a sample, experiment or dataset."
]
},
{
"cell_type": "code",
"execution_count": 12,
"outputs": [
{
"data": {
"text/html": [
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>code</th>\n",
" <th>description</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>DEFAULT_EXPERIMENT</td>\n",
" <td>Default Experiment</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>MATERIALS</td>\n",
" <td>Folder used to organize samples in the Invento...</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>METHODS</td>\n",
" <td>Folder used to organize samples in the Invento...</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>BOARDS</td>\n",
" <td>Folder used to organize boards</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>UNKNOWN</td>\n",
" <td>Unknown</td>\n",
" <td>2016-06-24 10:47:01</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
"<pybis.pybis.Things at 0x7f7ff3996a20>"
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_experiment_types()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>code</th>\n",
" <th>description</th>\n",
" <th>generatedCodePrefix</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>ANTIBODY</td>\n",
" <td>ANT</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>CHEMICAL</td>\n",
" <td>CHE</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>ENZYME</td>\n",
" <td>ENZ</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>MEDIA</td>\n",
" <td>MED</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>SOLUTION_BUFFER</td>\n",
" <td>SOL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>OLIGO</td>\n",
" <td>OLI</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>RNA</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>PLASMID</td>\n",
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
" <td>PLA</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>BACTERIA</td>\n",
" <td></td>\n",
" <td>BAC</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>YEAST</td>\n",
" <td></td>\n",
" <td>YEA</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>CELL_LINE</td>\n",
" <td></td>\n",
" <td>CEL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>FLY</td>\n",
" <td></td>\n",
" <td>FLY</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>EXPERIMENTAL_STEP</td>\n",
" <td></td>\n",
" <td>EXP</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>GENERAL_PROTOCOL</td>\n",
" <td></td>\n",
" <td>GEN</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>PCR_PROTOCOL</td>\n",
" <td></td>\n",
" <td>PCR</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>WESTERN_BLOTTING_PROTOCOL</td>\n",
" <td></td>\n",
" <td>WES</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>DRAWING_BOARD</td>\n",
" <td></td>\n",
" <td>DRA</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>UNKNOWN</td>\n",
" <td>Unknown</td>\n",
" <td>S</td>\n",
" <td>2016-06-24 10:47:01</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<pybis.pybis.Things at 0x7f7ff399dbe0>"
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_sample_types()"
"execution_count": 14,
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>code</th>\n",
" <th>description</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>MY_VERY_EXCITING_MATERIAL</td>\n",
" <td>looks like dirt and probably is dirt</td>\n",
" <td>2016-09-24 00:46:19</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
"<pybis.pybis.Things at 0x7f7ff399d518>"
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_material_types()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>code</th>\n",
" <th>kind</th>\n",
" <th>modificationDate</th>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>ELN_PREVIEW</td>\n",
" <td>ELN Preview image</td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>SEQ_FILE</td>\n",
" <td></td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>RAW_DATA</td>\n",
" <td></td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>ANALYZED_DATA</td>\n",
" <td></td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
" <td>ATTACHMENT</td>\n",
" <td></td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>DRAWING_BOARD</td>\n",
" <td></td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:48:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>JUPYTER_CONTAINER</td>\n",
" <td>Jupyter Analysis Results</td>\n",
" <td>CONTAINER</td>\n",
" <td>2016-06-29 15:29:06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>JUPYTER_NOTEBOOK</td>\n",
" <td>Analysis Notebook Files</td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-29 15:29:07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>UNKNOWN</td>\n",
" <td>Unknown</td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-24 10:47:01</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>JUPYTER_RESULT</td>\n",
" <td>Analysis Results Files</td>\n",
" <td>PHYSICAL</td>\n",
" <td>2016-06-29 15:29:06</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<pybis.pybis.Things at 0x7f7ff399d588>"
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_dataset_types()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"to get a more detailed view of an item from the list above, just provide the index number like so:"
]
},
{
"cell_type": "code",
"execution_count": 16,
"outputs": [
{
"data": {
"text/html": [
"\n",
"<p>DataSetType: <b>ELN_PREVIEW</b>\n",
"<p>description: ELN Preview image</p>\n",
" \n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>property</th>\n",
" <th>label</th>\n",
" <th>description</th>\n",
" <th>dataType</th>\n",
" <th>mandatory</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <th>name</th> <td>Name</td> <td>Name</td> <td>VARCHAR</td> <td>False</td> </tr><tr> <th>notes</th> <td>Notes</td> <td>Notes regarding the dataset</td> <td>MULTILINE_VARCHAR</td> <td>False</td> </tr><tr> <th>xmlcomments</th> <td>Comments List</td> <td>Several comments can be added by different users</td> <td>XML</td> <td>False</td> </tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.property.PropertyAssignments at 0x7f7ff39e41d0>"
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_dataset_types()[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"you can as well use an identifier to get the details:"
]
},
{
"cell_type": "code",
"execution_count": 17,
"outputs": [
{
"data": {
"text/html": [
"\n",
"<p>DataSetType: <b>ELN_PREVIEW</b>\n",
"<p>description: ELN Preview image</p>\n",
" \n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>property</th>\n",
" <th>label</th>\n",
" <th>description</th>\n",
" <th>dataType</th>\n",
" <th>mandatory</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <th>name</th> <td>Name</td> <td>Name</td> <td>VARCHAR</td> <td>False</td> </tr><tr> <th>notes</th> <td>Notes</td> <td>Notes regarding the dataset</td> <td>MULTILINE_VARCHAR</td> <td>False</td> </tr><tr> <th>xmlcomments</th> <td>Comments List</td> <td>Several comments can be added by different users</td> <td>XML</td> <td>False</td> </tr>\n",
" </tbody>\n",
" </table>\n",
" "
"<pybis.property.PropertyAssignments at 0x7f7ff39e4898>"
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_dataset_type('ELN_PREVIEW')"
"execution_count": 17,
"outputs": [
{
"data": {
"text/html": [
"\n",
"<p>SampleType: <b>YEAST</b>\n",
"<p>description: </p>\n",
" <p>Code autogenerated: True</p>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>property</th>\n",
" <th>label</th>\n",
" <th>description</th>\n",
" <th>dataType</th>\n",
" <th>mandatory</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <th>name</th> <td>Name</td> <td>Name</td> <td>VARCHAR</td> <td>False</td> </tr><tr> <th>show_in_project_overview</th> <td>Show in project overview</td> <td>Show in project overview</td> <td>BOOLEAN</td> <td>False</td> </tr><tr> <th>owner</th> <td>Owner</td> <td>Who produced/owned the sample</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>owner_number</th> <td>Owner number</td> <td>Owner number</td> <td>MULTILINE_VARCHAR</td> <td>False</td> </tr><tr> <th>genetic_modification</th> <td>Genetic modifications</td> <td>Genetic modifications composed by the Plasmid ancestors</td> <td>MULTILINE_VARCHAR</td> <td>False</td> </tr><tr> <th>genetic_background</th> <td>Genetic Background</td> <td>Genetic background of the yeast strain</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>mating_type</th> <td>Mating Type</td> <td>Mating type or ploidy of the yeast strain</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>background-specific_markers</th> <td>Background-specific markers</td> <td>Background-specific markers available in the strain for further genetic modifications</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>common_markers</th> <td>Common markers</td> <td>Common markers available in the strain for further genetic modifications</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>endogenous_plasmid</th> <td>Endogenous 2micron plasmid in yeast</td> <td>Presence of an endogenous cir 2micron plasmid</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>origin</th> <td>Origin</td> <td>How the strain/cell line was produced</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>strain_check</th> <td>Strain Check</td> <td>Check done to verify the modifications introduced in the strain</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>source</th> <td>Source</td> <td>Source from where the construct/strain/cell line obtained or purchased, if it was not produced in the lab</td> <td>VARCHAR</td> <td>False</td> </tr><tr> <th>publication</th> <td>Publication</td> <td>Publication from where the information was first found OR technical sheet given by the manufacturer</td> <td>MULTILINE_VARCHAR</td> <td>False</td> </tr><tr> <th>notes</th> <td>Notes</td> <td>Notes regarding the dataset</td> <td>MULTILINE_VARCHAR</td> <td>False</td> </tr><tr> <th>xmlcomments</th> <td>Comments List</td> <td>Several comments can be added by different users</td> <td>XML</td> <td>False</td> </tr><tr> <th>annotations_state</th> <td>Annotations State</td> <td>Annotations State</td> <td>XML</td> <td>False</td> </tr><tr> <th>storage_names</th> <td>Storage Name</td> <td>Storage Name</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>storage_row</th> <td>Storage Row</td> <td>Storage Row</td> <td>INTEGER</td> <td>False</td> </tr><tr> <th>storage_column</th> <td>Storage Column</td> <td>Storage Column</td> <td>INTEGER</td> <td>False</td> </tr><tr> <th>storage_box_name</th> <td>Storage Box Name</td> <td>Storage Box Name</td> <td>VARCHAR</td> <td>False</td> </tr><tr> <th>storage_box_size</th> <td>Storage Box Size</td> <td>Storage Box Size</td> <td>CONTROLLEDVOCABULARY</td> <td>False</td> </tr><tr> <th>storage_user</th> <td>Storage User Id</td> <td>Storage User Id</td> <td>VARCHAR</td> <td>False</td> </tr><tr> <th>storage_position</th> <td>Storage Position</td> <td>Storage Position</td> <td>VARCHAR</td> <td>False</td> </tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.property.PropertyAssignments at 0x7f72f022c9b0>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_sample_type('YEAST')"
"cell_type": "markdown",
"metadata": {},
"**tags**: almost all entities in openBIS can be tagged:"
]
},
{
"cell_type": "code",
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>A_tag</td>\n",
" <td>2016-07-05 23:45:04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>CREATE_JSON_TAG</td>\n",
" <td>2016-06-30 00:36:50</td>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>CREATE_JSON_TAG_2</td>\n",
" <td>2016-07-06 00:07:07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>CREATE_JSON_TAG_3</td>\n",
" <td>2016-07-06 00:07:07</td>\n",
" <th>4</th>\n",
" <td>CREATE_JSON_TAG_blalbal</td>\n",
" <td>2016-11-08 10:24:18</td>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>another_nice_tag</td>\n",
" <td>2016-10-06 14:43:21</td>\n",
" </tr>\n",
" <tr>\n",
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
" <th>6</th>\n",
" <td>another_tag</td>\n",
" <td>2016-10-04 11:29:02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>blblblblblb</td>\n",
" <td>2016-10-06 14:47:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>clue</td>\n",
" <td>2016-09-26 23:48:08</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>do</td>\n",
" <td>2016-09-12 23:57:14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>due</td>\n",
" <td>2016-06-30 17:18:11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>fa</td>\n",
" <td>2016-09-12 23:57:29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>gimme_a_tag</td>\n",
" <td>2016-11-18 15:20:10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>gimme_one_more</td>\n",
" <td>2016-10-27 02:03:25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>la</td>\n",
" <td>2016-09-12 23:57:29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>mi</td>\n",
" <td>2016-09-12 23:57:29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>new_tag</td>\n",
" <td>2016-10-06 10:49:15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>no</td>\n",
" <td>2016-09-26 23:48:08</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>one</td>\n",
" <td>2016-11-09 14:27:58</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>re</td>\n",
" <td>2016-09-12 23:57:29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>so</td>\n",
" <td>2016-09-12 23:57:29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>three</td>\n",
" <td>2016-11-09 14:27:58</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>ti</td>\n",
" <td>2016-09-12 23:57:29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>too_late</td>\n",
" <td>2016-10-06 10:56:07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>tre</td>\n",
" <td>2016-06-30 17:18:11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>two</td>\n",
" <td>2016-11-09 14:27:58</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>uno</td>\n",
" <td>2016-06-30 17:18:11</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
" code registrationDate\n",
"0 A_tag 2016-07-05 23:45:04\n",
"1 CREATE_JSON_TAG 2016-06-30 00:36:50\n",
"2 CREATE_JSON_TAG_2 2016-07-06 00:07:07\n",
"3 CREATE_JSON_TAG_3 2016-07-06 00:07:07\n",
"4 CREATE_JSON_TAG_blalbal 2016-11-08 10:24:18\n",
"5 another_nice_tag 2016-10-06 14:43:21\n",
"6 another_tag 2016-10-04 11:29:02\n",
"7 blblblblblb 2016-10-06 14:47:45\n",
"8 clue 2016-09-26 23:48:08\n",
"9 do 2016-09-12 23:57:14\n",
"10 due 2016-06-30 17:18:11\n",
"11 fa 2016-09-12 23:57:29\n",
"12 gimme_a_tag 2016-11-18 15:20:10\n",
"13 gimme_one_more 2016-10-27 02:03:25\n",
"14 la 2016-09-12 23:57:29\n",
"15 mi 2016-09-12 23:57:29\n",
"16 new_tag 2016-10-06 10:49:15\n",
"17 no 2016-09-26 23:48:08\n",
"18 one 2016-11-09 14:27:58\n",
"19 re 2016-09-12 23:57:29\n",
"20 so 2016-09-12 23:57:29\n",
"21 three 2016-11-09 14:27:58\n",
"22 ti 2016-09-12 23:57:29\n",
"23 too_late 2016-10-06 10:56:07\n",
"24 tre 2016-06-30 17:18:11\n",
"25 two 2016-11-09 14:27:58\n",
"26 uno 2016-06-30 17:18:11"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**get the terms of a (controlled) vocabulary.**\n",
"\n",
"Some assigned properties have a controlled vocabulary, which means you can not enter anything you want."
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>vocabulary term</th>\n",
" <th>label</th>\n",
" <th>description</th>\n",
" <th>vocabulary</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>A</td> <td>a</td> <td>None</td> <td>MATING_TYPE</td> </tr><tr> <td>ALPHA</td> <td>alpha</td> <td>None</td> <td>MATING_TYPE</td> </tr><tr> <td>DIPLOID</td> <td>diploid</td> <td>None</td> <td>MATING_TYPE</td> </tr><tr> <td>UNKNOWN</td> <td>unknown</td> <td>None</td> <td>MATING_TYPE</td> </tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.masterdata.Vocabulary at 0x7fca603910f0>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"o.get_terms('MATING_TYPE')"
"cell_type": "markdown",
"metadata": {},
"**list all the deleted items in openBIS.**\n",
"\n",
"*TODO*: fetch the deletion date"
"outputs": [
{
"data": {
"text/html": [
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>permId</th>\n",
" <th>reason</th>\n",
" <th>type</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>20160629183649792-77</td>\n",
" <td>no jolly good reason</td>\n",
" <td>as.dto.sample.id.SamplePermId</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>20160629185740101-79</td>\n",
" <td>no jolly good reason</td>\n",
" <td>as.dto.sample.id.SamplePermId</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>20160705234127476-205</td>\n",
" <td>jjj</td>\n",
" <td>as.dto.sample.id.SamplePermId</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>20160630111810821-87</td>\n",
" <td>no specific reason</td>\n",
" <td>as.dto.sample.id.SamplePermId</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>20160926234807546-364</td>\n",
" <td>no longer needed</td>\n",
" <td>as.dto.experiment.id.ExperimentPermId</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>20161004215320704-370</td>\n",
" <td>it was just an experiment</td>\n",
" <td>as.dto.experiment.id.ExperimentPermId</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
" permId reason \\\n",
"0 20160629183649792-77 no jolly good reason \n",
"1 20160629185740101-79 no jolly good reason \n",
"2 20160705234127476-205 jjj \n",
"3 20160630111810821-87 no specific reason \n",
"4 20160926234807546-364 no longer needed \n",
"5 20161004215320704-370 it was just an experiment \n",
"\n",
" type \n",
"0 as.dto.sample.id.SamplePermId \n",
"1 as.dto.sample.id.SamplePermId \n",
"2 as.dto.sample.id.SamplePermId \n",
"3 as.dto.sample.id.SamplePermId \n",
"4 as.dto.experiment.id.ExperimentPermId \n",
"5 as.dto.experiment.id.ExperimentPermId "
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cell_type": "markdown",
"metadata": {},
"## working with projects"
"outputs": [
{
"data": {
"text/plain": [
"'vermeul-170126143455586x8A10E9354784B7ED77C8901A15079664'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"from pybis import Openbis\n",
"o = Openbis(url='https://localhost:8443', verify_certificates=False)\n",
"o.token"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"list all projects in a given space."
]
},
{
"cell_type": "code",
"sp = o.get_space('VERMEUL')"
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>identifier</th>\n",
" <th>registrator</th>\n",
" <th>registrationDate</th>\n",
" <th>modifier</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>/VERMEUL/PROJECT_ONE</td>\n",
" <td>20170115220158336-410</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-15 22:01:58</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-26 23:36:43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>/VERMEUL/READY_TO_DELETE</td>\n",
" <td>20170122214024061-421</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-22 21:40:24</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-22 21:40:24</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<pybis.pybis.Things at 0x7f882ed7bcf8>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>PROJECT_ONE</td> </tr><tr> <td>description</td> <td></td> </tr><tr> <td>permId</td> <td>20170115220158336-410</td> </tr><tr> <td>identifier</td> <td>/VERMEUL/PROJECT_ONE</td> </tr><tr> <td>space</td> <td>VERMEUL</td> </tr><tr> <td>leader</td> <td></td> </tr><tr> <td>registrator</td> <td>vermeul</td> </tr><tr> <td>registrationDate</td> <td>2017-01-15 22:01:58</td> </tr><tr> <td>modifier</td> <td></td> </tr><tr> <td>modificationDate</td> <td>2017-01-26 23:36:43</td> </tr><tr><td>attachments</td><td>IMG_3587.JPG</td></tr>\n",
" "
],
"text/plain": [
"<pybis.pybis.Project at 0x7f882ed87080>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p = sp.get_projects()[0]\n",
"p"
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/plain": [
"[{'description': None, 'fileName': 'IMG_3587.JPG', 'title': 'just a big mess'}]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p.attachments"
]
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>fileName</th>\n",
" <th>title</th>\n",
" <th>description</th>\n",
" <th>version</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>IMG_3587.JPG</td>\n",
" <td>just a big mess</td>\n",
" <td>None</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
],
"text/plain": [
" fileName title description version\n",
"0 IMG_3587.JPG just a big mess None 1"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/plain": [
"['localhost/20170115220158336-410/IMG_3587.JPG']"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"p.download_attachments()"
]
},
{
"cell_type": "code",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"localhost/20170115220158336-410\r\n",
"localhost/20170115220158336-410/IMG_3587.JPG\r\n"
"!find localhost/20170115220158336-410"
]
},
{
"cell_type": "code",
"outputs": [],
"source": [
"p.add_attachment(fileName='testfile', description= 'another file', title= 'one more attachment')"
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/html": [
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>PROJECT_ONE</td> </tr><tr> <td>description</td> <td></td> </tr><tr> <td>permId</td> <td>20170115220158336-410</td> </tr><tr> <td>identifier</td> <td>/VERMEUL/PROJECT_ONE</td> </tr><tr> <td>space</td> <td>VERMEUL</td> </tr><tr> <td>leader</td> <td></td> </tr><tr> <td>registrator</td> <td>vermeul</td> </tr><tr> <td>registrationDate</td> <td>2017-01-15 22:01:58</td> </tr><tr> <td>modifier</td> <td></td> </tr><tr> <td>modificationDate</td> <td>2017-01-24 15:13:08</td> </tr><tr><td>attachments</td><td>IMG_3587.JPG<br/>testfile</td></tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.pybis.Project at 0x7fc53d9cd780>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"name": "stdout",
"output_type": "stream",
"text": [
"Project successfully updated.\n"
]
}
],
"source": [
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## working with experiments"
]
},
{
"cell_type": "code",
"from pybis import Openbis\n",
"o = Openbis(url='https://localhost:8443', verify_certificates=False)"
]
},
{
"cell_type": "markdown",
"**fetching experiments of a specific type containing tags**"
]
},
{
"cell_type": "code",
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>identifier</th>\n",
" <th>permId</th>\n",
" <th>project</th>\n",
" <th>type</th>\n",
" <th>registrator</th>\n",
" <th>registrationDate</th>\n",
" <th>modifier</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>/MATERIALS/YEASTS/MY_FIRST_EXPERIMENT_WITH_PRO...</td>\n",
" <td>20160924015154859-355</td>\n",
" <td>YEASTS</td>\n",
" <td>None</td>\n",
" <td>vermeul</td>\n",
" <td>2016-09-24 01:51:55</td>\n",
" <td>vermeul</td>\n",
" <td>2017-01-27 00:12:25</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"<pybis.pybis.Things at 0x7f21b2d65898>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exps = o.get_experiments(\n",
" project='YEASTS',\n",
" space='MATERIALS', \n",
" type='DEFAULT_EXPERIMENT',\n",
" tags='*', \n",
" is_finished=True\n",
")\n",
"exps"
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>MY_FIRST_EXPERIMENT_WITH_PROPERTY</td> </tr><tr> <td>permId</td> <td>20160924015154859-355</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/YEASTS/MY_FIRST_EXPERIMENT_WITH_PROPERTY</td> </tr><tr> <td>type</td> <td>DEFAULT_EXPERIMENT</td> </tr><tr> <td>project</td> <td>/MATERIALS/YEASTS</td> </tr><tr> <td>tags</td> <td>['too_late', 'uno']</td> </tr><tr><td>attachments</td><td>testfile</td></tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.pybis.Experiment at 0x7fbe86a64748>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"e0 = exps[0]\n",
"e0"
]
},
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 9,
]
},
{
"cell_type": "code",
"name": "stdout",
"output_type": "stream",
"text": [
"Experiment successfully updated.\n"
]
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>permId</th>\n",
" <th>properties</th>\n",
" <th>type</th>\n",
" <th>registrationDate</th>\n",
" <th>modificationDate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>20170106004736870-407</td>\n",
" <td>{'NAME': 'dunno'}</td>\n",
" <td>ANALYZED_DATA</td>\n",
" <td>/MATERIALS/YEASTS/MY_FIRST_EXPERIMENT_WITH_PRO...</td>\n",
" <td>None</td>\n",
" <td>2017-01-06 00:47:37</td>\n",
" <td>2017-01-06 00:47:37</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"<pybis.pybis.Things at 0x7fbb3966a4e0>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
]
},
{
"cell_type": "code",
},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>MY_FIRST_EXPERIMENT_WITH_PROPERTY</td> </tr><tr> <td>permId</td> <td>20160924015154859-355</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/YEASTS/MY_FIRST_EXPERIMENT_WITH_PROPERTY</td> </tr><tr> <td>type</td> <td>DEFAULT_EXPERIMENT</td> </tr><tr> <td>project</td> <td>/MATERIALS/YEASTS</td> </tr><tr> <td>tags</td> <td>['too_late', 'uno']</td> </tr><tr><td>attachments</td><td>testfile</td></tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.pybis.Experiment at 0x7fbb39647eb8>"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/plain": [
"{'End Date': 'TIMESTAMP', 'syntax': 'YYYY-MM-DD HH:MIN:SS'}"
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"e_new = o.new_experiment('DEFAULT_EXPERIMENT')"
]
},
{
"cell_type": "code",
"e_new.project ='VERMEUL_PROJECT'"
]
},
{
"cell_type": "code",
"e_new.tags = 'too_late'"
]
},
{
"cell_type": "code",
"outputs": [],
"source": [
"e_new.code = 'exp_new'"
]
},
{
"cell_type": "code",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Experiment successfully created.\n"
]
}
],
]
},
{
"cell_type": "code",
"outputs": [
{
"data": {
"text/html": [
"\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>attribute</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr> <td>code</td> <td>MY_EXPERIMENT007</td> </tr><tr> <td>permId</td> <td>20161004220718730-373</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td> </tr><tr> <td>type</td> <td>DEFAULT_EXPERIMENT</td> </tr><tr> <td>space</td> <td></td> </tr><tr> <td>project</td> <td>/MATERIALS/YEASTS</td> </tr><tr> <td>tags</td> <td>[]</td> </tr><tr><td>attachments</td><td>Bildschirmfoto 2016-12-20 um 10.47.26.png<br/>Ein Saurier.txt</td></tr>\n",
" </tbody>\n",
" </table>\n",
" "
],
"text/plain": [
"<pybis.pybis.Experiment at 0x7f3140f55400>"
Loading
Loading full blame...