Skip to content
Snippets Groups Projects
pybis demo.ipynb 187 KiB
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",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'vermeul-170213105629815x0CF2F2467FF08E65E79A1E25E0334BC3'"
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "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",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 2,
     "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"
   "execution_count": 85,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "········\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'vermeul-170213105629815x0CF2F2467FF08E65E79A1E25E0334BC3'"
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pybis import Openbis\n",
    "o = Openbis('https://localhost:8443', verify_certificates=False)\n",
    "\n",
    "import getpass\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:"
   "execution_count": 82,
   "metadata": {
    "collapsed": false
   },
   "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):"
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "o2.logout()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## get general information about openBIS"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Data Store Servers (DSS)"
   ]
  },
   "metadata": {
    "collapsed": false
   },
   "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,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_datastores()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
    "list all available spaces:"
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "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,
   "metadata": {
    "collapsed": false
   },
   "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",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "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>"
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sp.get_projects()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "get details of the first project in this list"
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "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>"
     "execution_count": 4,
     "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"
   "execution_count": 5,
   },
   "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"
   "execution_count": 87,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "pr = o.get_project('/MY_NEW_SPACE/VERMEUL_PROJECT')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
    "collapsed": false,
    "scrolled": true
   "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",
       "      <th>modificationDate</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"
   "execution_count": 90,
   "metadata": {
    "collapsed": false
   },
   "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",
       "      <th>modificationDate</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",
       "      <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>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>"
       "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**"
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "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."
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "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>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()"
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "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",
       "      <th>modificationDate</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>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>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",
       "      <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()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "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>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7f7ff399d518>"
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_material_types()"
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "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",
       "  </thead>\n",
       "  <tbody>\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",
       "      <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>"
       "<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:"
   "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",
       "        "
       "<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:"
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "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 0x7f7ff39e4898>"
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_dataset_type('ELN_PREVIEW')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "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>"
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_sample_type('YEAST')"
   "cell_type": "markdown",
   "metadata": {},
    "**tags**: almost all entities in openBIS can be tagged:"
   "execution_count": 2,
    "collapsed": false,
    "scrolled": false
   },
   "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>registrationDate</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",
       "      <th>3</th>\n",
       "      <td>CREATE_JSON_TAG_3</td>\n",
       "      <td>2016-07-06 00:07:07</td>\n",
       "    </tr>\n",
       "    <tr>\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",
       "      <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": [
       "                       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"
     "execution_count": 2,
     "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."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
   },
   "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>"
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_terms('MATING_TYPE')"
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**list all the deleted items in openBIS.**\n",
    "\n",
    "*TODO*: fetch the deletion date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "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>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>"
      ],
      "text/plain": [
       "                  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  "
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_deletions()"
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## working with projects"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'vermeul-170126143455586x8A10E9354784B7ED77C8901A15079664'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "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."
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "sp = o.get_space('VERMEUL')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "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>/VERMEUL/PROJECT_ONE</td>\n",
       "      <td>20170115220158336-410</td>\n",
       "      <td>None</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>None</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>"
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sp.get_projects()"
   "execution_count": 7,
    "collapsed": false
   },
   "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",
       "            </tbody>\n",
       "            </table>\n",
       "<pybis.pybis.Project at 0x7f882ed87080>"
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = sp.get_projects()[0]\n",
    "p"
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "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,
   "metadata": {
    "collapsed": false
   },
   "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",
       "       fileName            title description  version\n",
       "0  IMG_3587.JPG  just a big mess        None        1"
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p.get_attachments()"
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['localhost/20170115220158336-410/IMG_3587.JPG']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
    "p.download_attachments()"
   "execution_count": 8,
    "collapsed": false
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "localhost/20170115220158336-410\r\n",
      "localhost/20170115220158336-410/IMG_3587.JPG\r\n"
    "!find localhost/20170115220158336-410"
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "p.add_attachment(fileName='testfile', description= 'another file', title= 'one more attachment')"
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "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-24 15:13:08</td> </tr><tr><td>attachments</td><td>IMG_3587.JPG<br/>testfile</td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
       "<pybis.pybis.Project at 0x7fc53d9cd780>"
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Project successfully updated.\n"
     ]
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## working with experiments"
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
    "from pybis import Openbis\n",
    "o = Openbis(url='https://localhost:8443', verify_certificates=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "source": [
    "**fetching experiments of a specific type containing tags**"
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "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",
       "      <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>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7f21b2d65898>"
     "execution_count": 2,
     "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"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "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>"
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "e0.add_tags('uno')"
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Experiment successfully updated.\n"
     ]
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "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>experiment</th>\n",
       "      <th>sample</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>"
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e0.get_datasets()"
   "execution_count": 19,
    "collapsed": false,
    "scrolled": true
   },
   "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>"
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
       "{'End Date': 'TIMESTAMP', 'syntax': 'YYYY-MM-DD HH:MIN:SS'}"
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   "cell_type": "code",
   "execution_count": 3,
    "e_new = o.new_experiment('DEFAULT_EXPERIMENT')"
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
    "e_new.project ='VERMEUL_PROJECT'"
   "execution_count": 5,
   "outputs": [],
    "e_new.tags = 'too_late'"
   "execution_count": 6,
   },
   "outputs": [],
   "source": [
    "e_new.code = 'exp_new'"
   "execution_count": 8,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Experiment successfully created.\n"
     ]
    }
   ],
   "execution_count": 45,
   "metadata": {
    "collapsed": false
   },
   "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>"
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e = o.get_experiment('/MATERIALS/YEASTS/MY_EXPERIMENT007')\n",
    "e"
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "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 0x7fd2241efc18>"
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_experiment('20161004220718730-373')"
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "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>experiment</th>\n",
       "      <th>sample_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/FLY43</td>\n",
       "      <td>20170104000802333-404</td>\n",
       "      <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td>\n",
       "      <td>FLY</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:02</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>/MATERIALS/FLY45</td>\n",
       "      <td>20170104000847172-405</td>\n",
       "      <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td>\n",
       "      <td>FLY</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:47</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:36:09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7fd223f3f208>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "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>experiment</th>\n",
       "      <th>sample_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/FLY43</td>\n",
       "      <td>20170104000802333-404</td>\n",
       "      <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td>\n",
       "      <td>FLY</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:02</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>/MATERIALS/FLY45</td>\n",
       "      <td>20170104000847172-405</td>\n",
       "      <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td>\n",
       "      <td>FLY</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:47</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:36:09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7fd223f3f8d0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_samples(experiment='20161004220718730-373')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "get all experiment with a given property"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "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>identifier</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>MY_EXPERIMENT013</td>\n",
       "      <td>/MATERIALS/YEASTS/MY_EXPERIMENT013</td>\n",
       "      <td>YEASTS</td>\n",
       "      <td>DEFAULT_EXPERIMENT</td>\n",
       "      <td></td>\n",
       "      <td>2016-10-04 22:09:15</td>\n",
       "      <td></td>\n",
       "      <td>2016-12-23 16:58:43</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7fd223f4c860>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_experiments(is_finished=False, name='blast')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### updating an experiment."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "            <table border=\"1\" class=\"dataframe\">\n",
       "            <thead>\n",
       "                <tr style=\"text-align: right;\">\n",
       "                <th>property</th>\n",
       "                <th>value</th>\n",
       "                </tr>\n",
       "            </thead>\n",
       "            <tbody>\n",
       "        <tr> <td>name</td> <td>blast</td> </tr><tr> <td>show_in_project_overview</td> <td></td> </tr><tr> <td>finished_flag</td> <td>False</td> </tr><tr> <td>experimental_goals</td> <td></td> </tr><tr> <td>grant</td> <td></td> </tr><tr> <td>start_date</td> <td></td> </tr><tr> <td>end_date</td> <td></td> </tr><tr> <td>experimental_results</td> <td></td> </tr><tr> <td>xmlcomments</td> <td></td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.property.PropertyHolder at 0x7f768c61a748>"
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex = o.get_experiments(type='DEFAULT_EXPERIMENT')[0]\n",
    "ex.p"
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ex.set_properties({'FINISHED_FLAG': False})"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "e = o.new_experiment('/MATERIALS/YEASTS', 'my_experiment0815', 'DEFAULT_EXPERIMENT', properties={\"Name\":\"blast\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "e3.delete(reason='it was just an experiment')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## working with samples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from pybis import Openbis\n",
    "o = Openbis(url='https://localhost:8443', verify_certificates=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
   },
   "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>YEA34</td> </tr><tr> <td>permId</td> <td>20161108230958839-384</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/YEA34</td> </tr><tr> <td>type</td> <td>YEAST</td> </tr><tr> <td>space</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>project</td> <td></td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT</td> </tr><tr> <td>tags</td> <td>['uno']</td> </tr><tr><td>attachments</td><td>Bildschirmfoto 2016-12-20 um 10.47.26.png<br/>testfile</td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7f9c08388358>"
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sa = o.get_sample('/MY_NEW_SPACE/YEA34')\n",
    "sa"
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "            <table border=\"1\" class=\"dataframe\">\n",
       "            <thead>\n",
       "                <tr style=\"text-align: right;\">\n",
       "                <th>property</th>\n",
       "                <th>value</th>\n",
       "                </tr>\n",
       "            </thead>\n",
       "            <tbody>\n",
       "        <tr> <td>name</td> <td></td> </tr><tr> <td>show_in_project_overview</td> <td>False</td> </tr><tr> <td>owner</td> <td></td> </tr><tr> <td>owner_number</td> <td></td> </tr><tr> <td>genetic_modification</td> <td></td> </tr><tr> <td>genetic_background</td> <td></td> </tr><tr> <td>mating_type</td> <td>DIPLOID</td> </tr><tr> <td>background-specific_markers</td> <td></td> </tr><tr> <td>common_markers</td> <td></td> </tr><tr> <td>endogenous_plasmid</td> <td></td> </tr><tr> <td>origin</td> <td></td> </tr><tr> <td>strain_check</td> <td></td> </tr><tr> <td>source</td> <td></td> </tr><tr> <td>publication</td> <td></td> </tr><tr> <td>notes</td> <td></td> </tr><tr> <td>xmlcomments</td> <td></td> </tr><tr> <td>annotations_state</td> <td></td> </tr><tr> <td>storage_names</td> <td></td> </tr><tr> <td>storage_row</td> <td></td> </tr><tr> <td>storage_column</td> <td></td> </tr><tr> <td>storage_box_name</td> <td></td> </tr><tr> <td>storage_box_size</td> <td></td> </tr><tr> <td>storage_user</td> <td></td> </tr><tr> <td>storage_position</td> <td></td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.property.PropertyHolder at 0x7f9c083883c8>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sa.props"
   ]
  },
   "execution_count": 5,
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<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>Bildschirmfoto 2016-12-20 um 10.47.26.png</td>\n",
       "      <td>nocheinfoto</td>\n",
       "      <td>None</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>testfile</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                    fileName        title description  version\n",
       "0  Bildschirmfoto 2016-12-20 um 10.47.26.png  nocheinfoto        None        1\n",
       "1                                   testfile         None        None        1"
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sa.get_attachments()"
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "sa.add_attachment('testfile')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sample successfully updated\n"
     ]
    }
   ],
   "source": [
    "sa.save()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "localhost/20161108230958839-384/Bildschirmfoto 2016-12-20 um 10.47.26.png\n",
      "localhost/20161108230958839-384/testfile\n"
     ]
    }
   ],
   "source": [
    "sa.download_attachments()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "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>experiment</th>\n",
       "      <th>sample_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>/VERMEUL/ANOTHER_SAMPLE1</td>\n",
       "      <td>20160706001644827-208</td>\n",
       "      <td>None</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-07-06 00:16:45</td>\n",
       "      <td></td>\n",
       "      <td>2016-11-09 10:18:18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>/VERMEUL/BLAJLSD</td>\n",
       "      <td>20160630111949369-89</td>\n",
       "      <td>None</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-30 17:19:49</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-30 17:19:49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>/MY_NEW_SPACE/CHILD_OF_SAMPLE1</td>\n",
       "      <td>20160705234504004-206</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-07-05 23:45:04</td>\n",
       "      <td></td>\n",
       "      <td>2016-10-07 01:05:46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>20160630105304285-81</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-30 16:53:04</td>\n",
       "      <td></td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>/VERMEUL/OH_WIE_SCHOEN_IST_PANAMA</td>\n",
       "      <td>20160630110733527-86</td>\n",
       "      <td>None</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-30 17:07:34</td>\n",
       "      <td></td>\n",
       "      <td>2016-07-06 00:11:45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>/VERMEUL/OH_WIE_SCHOEN_IST_PANAMA3</td>\n",
       "      <td>20160630112720553-90</td>\n",
       "      <td>None</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-30 17:27:21</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-30 17:27:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>/VERMEUL/OH_WIE_SCHOEN_IST_PANAMA5</td>\n",
       "      <td>20160706231053756-211</td>\n",
       "      <td>None</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-07-06 23:10:54</td>\n",
       "      <td></td>\n",
       "      <td>2016-07-06 23:10:54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>/VERMEUL/YET_ANOTHER_SAMPLE1</td>\n",
       "      <td>20160706002555747-209</td>\n",
       "      <td>None</td>\n",
       "      <td>UNKNOWN</td>\n",
       "      <td></td>\n",
       "      <td>2016-07-06 00:25:56</td>\n",
       "      <td></td>\n",
       "      <td>2016-11-09 10:18:18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7f2e99f1a518>"
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_samples(space='VERMEUL', tags=['*'])"
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "get the first sample of the above list and just display the basic attributes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   },
   "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>YEA21</td> </tr><tr> <td>permId</td> <td>20161025010638912-382</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/YEA21</td> </tr><tr> <td>type</td> <td>YEAST</td> </tr><tr> <td>space</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>['do', 'fa', 're']</td> </tr><tr><td>attachments</td><td></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
       "<pybis.pybis.Sample at 0x7f8ff54adb38>"
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = o.get_sample('/MY_NEW_SPACE/YEA21')\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show all the properties assigned to this sample type:"
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "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",
       "        "
       "<pybis.property.PropertyAssignments at 0x7f8ff55c26d8>"
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.type"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "however, you still can check whether the sample type corresponds to a certain string:"
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.type == 'YEAST'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "get experiment related to that sample"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "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_SPECIAL_EXPERIMENT</td> </tr><tr> <td>permId</td> <td>20161121013609807-402</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT</td> </tr><tr> <td>type</td> <td>UNKNOWN</td> </tr><tr> <td>space</td> <td></td> </tr><tr> <td>project</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT</td> </tr><tr> <td>tags</td> <td>[]</td> </tr><tr><td>attachments</td><td></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Experiment at 0x7f2e99ceee48>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.experiment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<p>ExperimentType: <b>UNKNOWN</b>\n",
       "<p>description: Unknown</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",
       "        \n",
       "            </tbody>\n",
       "            </table>\n",
       "<pybis.property.PropertyAssignments at 0x7f2e99cf6ef0>"
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.experiment.type"
   "execution_count": 10,
   "metadata": {
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.experiment.type == 'UNKNOWN'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "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>space</th>\n",
       "      <th>registrator</th>\n",
       "      <th>registrationDate</th>\n",
       "      <th>modifier</th>\n",
       "      <th>modificationDate</th>\n",
       "      <th>permid</th>\n",
       "      <th>identifier</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>BACTERIA</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-33</td>\n",
       "      <td>/MATERIALS/BACTERIA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>CELL_LINES</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-34</td>\n",
       "      <td>/MATERIALS/CELL_LINES</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>FLIES</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-35</td>\n",
       "      <td>/MATERIALS/FLIES</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>PLASMIDS</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-37</td>\n",
       "      <td>/MATERIALS/PLASMIDS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>POLYNUCLEOTIDES</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-38</td>\n",
       "      <td>/MATERIALS/POLYNUCLEOTIDES</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>PROJECT_ONE</td>\n",
       "      <td>VERMEUL</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-15 22:01:58</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-15 22:02:59</td>\n",
       "      <td>20170115220158336-410</td>\n",
       "      <td>/VERMEUL/PROJECT_ONE</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>PROTOCOLS</td>\n",
       "      <td>METHODS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-39</td>\n",
       "      <td>/METHODS/PROTOCOLS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>REAGENTS</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td>20160624054751885-32</td>\n",
       "      <td>/MATERIALS/REAGENTS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>VERMEUL_PROJECT</td>\n",
       "      <td>MY_NEW_SPACE</td>\n",
       "      <td></td>\n",
       "      <td>2016-09-26 23:47:55</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-09 01:33:37</td>\n",
       "      <td>20160926234755430-363</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>YEASTS</td>\n",
       "      <td>MATERIALS</td>\n",
       "      <td></td>\n",
       "      <td>2016-06-24 11:47:52</td>\n",
       "      <td></td>\n",
       "      <td>2016-10-04 22:04:57</td>\n",
       "      <td>20160624054751885-36</td>\n",
       "      <td>/MATERIALS/YEASTS</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7f2e99b5d9b0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_projects()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "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>YEA21</td> </tr><tr> <td>permId</td> <td>20161025010638912-382</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/YEA21</td> </tr><tr> <td>type</td> <td>YEAST</td> </tr><tr> <td>space</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>['do', 'fa', 're']</td> </tr><tr><td>attachments</td><td></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7f8ff55c2e10>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "list all the properties (p) of a given sample"
   ]
  },
3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169
   "metadata": {
    "collapsed": false
   },
   "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>URA3_HIS3_LEU2</td> <td>ura3- his3- leu2-</td> <td>The strain is a uracil, histidine, and leucine auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>URA3_HIS3</td> <td>ura3- his3-</td> <td>The strain is a uracil and histidine auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>URA3_LEU2</td> <td>ura3- leu2-</td> <td>The strain is a uracil and leucine auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>URA3</td> <td>ura3-</td> <td>The strain is a uracil auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>HIS3_LEU2</td> <td>his3- leu2-</td> <td>The strain is a histidine and leucine auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>HIS3</td> <td>his3-</td> <td>The strain is a histidine auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>LEU2</td> <td>leu2-</td> <td>The strain is a leucine auxotroph</td> <td>COMMON_MARKERS</td> </tr><tr> <td>NONE</td> <td>none</td> <td>The strain does not have any background-specific auxotrophies</td> <td>COMMON_MARKERS</td> </tr><tr> <td>UNKNOWN</td> <td>unknown</td> <td>No information about the auxotrophy</td> <td>COMMON_MARKERS</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Vocabulary at 0x7f6b74235358>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.props.common_markers_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "fetch just a single property: sample.p.«property_name»"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'comments: publication in my office'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.p.publication"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "if you don't know the controlled vocabulary of a property, just add an underscore and press shift-enter:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "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.pybis.Vocabulary at 0x7efe6097d828>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.p.mating_type_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "pybis will automatically check the controlled vocabulary when you assign a value to it:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Value must be one of these terms: A, ALPHA, DIPLOID, UNKNOWN",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m\u001b[0m",
      "\u001b[1;31mValueError\u001b[0mTraceback (most recent call last)",
      "\u001b[1;32m<ipython-input-24-d4d5f6a664c5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0ms\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmating_type\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'invalid content'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m/vagrant_python/PyBis/pybis/pybis.py\u001b[0m in \u001b[0;36m__setattr__\u001b[1;34m(self, name, value)\u001b[0m\n\u001b[0;32m   2122\u001b[0m             \u001b[0mvoc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_openbis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_terms\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2123\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mvoc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mterms\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2124\u001b[1;33m                 \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Value must be one of these terms: \"\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;34m\", \"\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvoc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mterms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2125\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0mdata_type\u001b[0m \u001b[1;32min\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'INTEGER'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'BOOLEAN'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'VARCHAR'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2126\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mcheck_datatype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata_type\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: Value must be one of these terms: A, ALPHA, DIPLOID, UNKNOWN"
     ]
    }
   ],
   "source": [
    "s.p.mating_type = 'invalid content'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "some properties are of a general type. Again, you can list it by adding an underscore _ :"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Storage Column': 'INTEGER'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.p.storage_column_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "### alter a sample and its properties"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from pybis import Openbis\n",
    "o = Openbis(url='https://localhost:8443', verify_certificates=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "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>FLY45</td> </tr><tr> <td>permId</td> <td>20170104000847172-405</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/FLY45</td> </tr><tr> <td>type</td> <td>FLY</td> </tr><tr> <td>parents</td> <td>['/MATERIALS/FLY43']</td> </tr><tr> <td>children</td> <td>[]</td> </tr><tr> <td>space</td> <td>MATERIALS</td> </tr><tr> <td>experiment</td> <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>[]</td> </tr><tr><td>attachments</td><td>openBIS JSON-RPC.md</td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7faa0c089828>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample = o.get_sample('/MATERIALS/FLY45')\n",
    "sample"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "            <table border=\"1\" class=\"dataframe\">\n",
       "            <thead>\n",
       "                <tr style=\"text-align: right;\">\n",
       "                <th>property</th>\n",
       "                <th>value</th>\n",
       "                </tr>\n",
       "            </thead>\n",
       "            <tbody>\n",
       "        <tr> <td>name</td> <td>a fly45 which is the child of fly43</td> </tr><tr> <td>show_in_project_overview</td> <td>False</td> </tr><tr> <td>owner</td> <td></td> </tr><tr> <td>owner_number</td> <td></td> </tr><tr> <td>genetic_modification</td> <td></td> </tr><tr> <td>fly_genotype</td> <td></td> </tr><tr> <td>associated_gene</td> <td></td> </tr><tr> <td>markers</td> <td></td> </tr><tr> <td>origin</td> <td></td> </tr><tr> <td>strain_check</td> <td></td> </tr><tr> <td>source</td> <td></td> </tr><tr> <td>mating_partners</td> <td></td> </tr><tr> <td>publication</td> <td></td> </tr><tr> <td>notes</td> <td></td> </tr><tr> <td>xmlcomments</td> <td><root>\n",
       "  <commentEntry date=\"1483484927350\" person=\"vermeul\"/>\n",
       "</root>\n",
       "</td> </tr><tr> <td>annotations_state</td> <td>�(undefined)</td> </tr><tr> <td>storage_names</td> <td></td> </tr><tr> <td>storage_row</td> <td></td> </tr><tr> <td>storage_column</td> <td></td> </tr><tr> <td>storage_box_name</td> <td></td> </tr><tr> <td>storage_box_size</td> <td></td> </tr><tr> <td>storage_user</td> <td></td> </tr><tr> <td>storage_position</td> <td></td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.PropertyHolder at 0x7faa0c089a20>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.props"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "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>experiment</th>\n",
       "      <th>sample_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/FLY43</td>\n",
       "      <td>20170104000802333-404</td>\n",
       "      <td>/MATERIALS/YEASTS/MY_EXPERIMENT007</td>\n",
       "      <td>FLY</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:02</td>\n",
       "      <td></td>\n",
       "      <td>2017-01-04 00:08:47</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7faa0c0de940>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.get_parents()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'sample' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m\u001b[0m",
      "\u001b[1;31mNameError\u001b[0mTraceback (most recent call last)",
      "\u001b[1;32m<ipython-input-65-066328cddbd3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0msample\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_datasets\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'sample' is not defined"
     ]
    }
   ],
   "source": [
    "sample.get_datasets()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Files downloaded to: localhost/20170104003608559-406\n"
     ]
    }
   ],
   "source": [
    "sample.get_datasets()[0].download()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "localhost/20170104003608559-406\r\n",
      "localhost/20170104003608559-406/original\r\n",
      "localhost/20170104003608559-406/original/jupyter_useage_lab.zip\r\n"
     ]
    }
   ],
   "source": [
    "!find localhost/20170104003608559-406"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s_up = o.get_sample('/VERMEUL/MY_WONDERFUL_SAMPLE_NAME')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s_up.space = 'ANOTHER_SPACE_NAME'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s_up.tags = ['one', 'two', 'three']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "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>identifier</td> <td>/VERMEUL/MY_WONDERFUL_SAMPLE_NAME</td> </tr><tr> <td>permId</td> <td>20160720225637704-262</td> </tr><tr> <td>code</td> <td>MY_WONDERFUL_SAMPLE_NAME</td> </tr><tr> <td>type</td> <td>UNKNOWN</td> </tr><tr> <td>space</td> <td>ANOTHER_SPACE_NAME</td> </tr><tr> <td>project</td> <td>None</td> </tr><tr> <td>experiment</td> <td></td> </tr><tr> <td>parents</td> <td>[]</td> </tr><tr> <td>children</td> <td>[]</td> </tr><tr> <td>tags</td> <td>['one', 'two', 'three']</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7efe60915668>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_up"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sample successfully updated\n"
     ]
    }
   ],
   "source": [
    "s_up.save()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### create a new sample"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from pybis import Openbis\n",
    "o = Openbis(url='https://localhost:8443', verify_certificates=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Experiment\n"
     ]
    },
    {
     "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>YEAST_COLLECTION_1</td> </tr><tr> <td>permId</td> <td>20160624054739283-9</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/YEASTS/YEAST_COLLECTION_1</td> </tr><tr> <td>type</td> <td>MATERIALS</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></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Experiment at 0x7f56f2f17b38>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_experiments()[31]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "to create a new sample, the sampletype must be specified"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "s_new = o.new_sample(type='YEAST', space='VERMEUL')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "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></td> </tr><tr> <td>permId</td> <td></td> </tr><tr> <td>identifier</td> <td></td> </tr><tr> <td>type</td> <td></td> </tr><tr> <td>parents</td> <td></td> </tr><tr> <td>children</td> <td></td> </tr><tr> <td>space</td> <td></td> </tr><tr> <td>experiment</td> <td></td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td></td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7f8177455898>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "s_new.delete('obsolete')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "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_EXPERIMENT4</td> </tr><tr> <td>permId</td> <td>20160924020719018-358</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td> </tr><tr> <td>type</td> <td>DEFAULT_EXPERIMENT</td> </tr><tr> <td>space</td> <td></td> </tr><tr> <td>project</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT</td> </tr><tr> <td>tags</td> <td>['A_tag', 'another_tag', 'too_late', 'tre']</td> </tr><tr><td>attachments</td><td></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Experiment at 0x7f10ecdadd30>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e = o.get_experiment('/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4')\n",
    "e"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "controlled vocabulary: find out which terms are allowed by adding an underscore to the property."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "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>CROSS</td> <td>cross</td> <td>The strain was produced by crossing two parent strains</td> <td>ORIGIN</td> </tr><tr> <td>TRANSFORMATION</td> <td>transformation</td> <td>The strain/ cell line was obtained by transformation</td> <td>ORIGIN</td> </tr><tr> <td>SPORULATION</td> <td>transformation sporulation</td> <td>The strain was obtained by sporulating a parent diploid strain</td> <td>ORIGIN</td> </tr><tr> <td>NEGATIVE_SELECTION</td> <td>negative selection</td> <td>The strain/cell line was obtained by negative selection</td> <td>ORIGIN</td> </tr><tr> <td>TRANSFECTION</td> <td>transfection</td> <td>The strain/cell line was obtained by transfection</td> <td>ORIGIN</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Vocabulary at 0x7fbfcacd5a58>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new.p.origin_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "assigning a wrong value to a property will lead to an error:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Value must be one of these terms: CROSS, TRANSFORMATION, SPORULATION, NEGATIVE_SELECTION, TRANSFECTION",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m\u001b[0m",
      "\u001b[1;31mValueError\u001b[0mTraceback (most recent call last)",
      "\u001b[1;32m<ipython-input-12-d9539d489991>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0ms_new\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0morigin\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'crozz'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m/vagrant_python/PyBis/pybis/pybis.py\u001b[0m in \u001b[0;36m__setattr__\u001b[1;34m(self, name, value)\u001b[0m\n\u001b[0;32m   2099\u001b[0m             \u001b[0mvoc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_openbis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_terms\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2100\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mvoc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mterms\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2101\u001b[1;33m                 \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Value must be one of these terms: \"\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;34m\", \"\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvoc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mterms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2102\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0mdata_type\u001b[0m \u001b[1;32min\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'INTEGER'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'BOOLEAN'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'VARCHAR'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2103\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mcheck_datatype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata_type\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: Value must be one of these terms: CROSS, TRANSFORMATION, SPORULATION, NEGATIVE_SELECTION, TRANSFECTION"
     ]
    }
   ],
   "source": [
    "s_new.p.origin = 'crozz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "s_new.p. + TAB autocompletes all available properties for that given sample type. To show the current attributes of our new sample just use this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "s_new.p.mating_type = 'ALPHA'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "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>identifier</td> <td>None</td> </tr><tr> <td>permId</td> <td>None</td> </tr><tr> <td>code</td> <td>None</td> </tr><tr> <td>type</td> <td>None</td> </tr><tr> <td>space</td> <td>VERMEUL</td> </tr><tr> <td>project</td> <td>None</td> </tr><tr> <td>experiment</td> <td>None</td> </tr><tr> <td>parents</td> <td>None</td> </tr><tr> <td>children</td> <td>None</td> </tr><tr> <td>tags</td> <td>None</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7f52d7cfb630>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## working with datasets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'vermeul-170213105629815x0CF2F2467FF08E65E79A1E25E0334BC3'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pybis import Openbis\n",
    "o = Openbis(url='https://localhost:8443', verify_certificates=False)\n",
    "o.token"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "ds = o.get_dataset('20160929145446460-367') # has no physical data, because it's a container"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "ds = o.get_dataset('20160719143426517-259')"
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "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>20160719143426517-259</td> </tr><tr> <td>permId</td> <td>20160719143426517-259</td> </tr><tr> <td>type</td> <td>JUPYTER_RESULT</td> </tr><tr> <td>experiment</td> <td></td> </tr><tr> <td>sample</td> <td>/VERMEUL/MON_160718_181654</td> </tr><tr> <td>parents</td> <td>[]</td> </tr><tr> <td>children</td> <td>[]</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>[]</td> </tr><tr> <td>accessDate</td> <td>2016-08-18 13:43:54</td> </tr><tr> <td>dataProducer</td> <td></td> </tr><tr> <td>dataProductionDate</td> <td></td> </tr><tr> <td>registrator</td> <td></td> </tr><tr> <td>registrationDate</td> <td>2016-07-19 14:34:33</td> </tr><tr> <td>modifier</td> <td></td> </tr><tr> <td>modificationDate</td> <td>2016-07-19 14:34:33</td> </tr><tr> <td>dataStore</td> <td>DSS1</td> </tr><tr> <td>measured</td> <td>True</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "property            value\n",
       "------------------  --------------------------\n",
       "code                20160719143426517-259\n",
       "permId              20160719143426517-259\n",
       "type                JUPYTER_RESULT\n",
       "experiment\n",
       "sample              /VERMEUL/MON_160718_181654\n",
       "parents             []\n",
       "children            []\n",
       "container\n",
       "components\n",
       "tags                []\n",
       "accessDate          2016-08-18 13:43:54\n",
       "dataProducer\n",
       "dataProductionDate\n",
       "registrator\n",
       "registrationDate    2016-07-19 14:34:33\n",
       "modifier\n",
       "modificationDate    2016-07-19 14:34:33\n",
       "dataStore           DSS1\n",
       "measured            True"
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ds.status  # always fetches the current status from the server, no caching"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "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>speedHint</td> <td>-50</td> </tr><tr> <td>complete</td> <td>UNKNOWN</td> </tr><tr> <td>shareId</td> <td>1</td> </tr><tr> <td>size</td> <td>None</td> </tr><tr> <td>fileFormatType</td> <td>None</td> </tr><tr> <td>storageFormat</td> <td>None</td> </tr><tr> <td>location</td> <td>68D4E291-7D2C-413C-B318-895E139D29D1/7c/3b/03/20160719143426517-259</td> </tr><tr> <td>presentInArchive</td> <td>False</td> </tr><tr> <td>storageConfirmation</td> <td>True</td> </tr><tr> <td>locatorType</td> <td>None</td> </tr><tr> <td>status</td> <td>AVAILABLE</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "attribute            value\n",
       "-------------------  -------------------------------------------------------------------\n",
       "speedHint            -50\n",
       "complete             UNKNOWN\n",
       "shareId              1\n",
       "size\n",
       "fileFormatType\n",
       "storageFormat\n",
       "location             68D4E291-7D2C-413C-B318-895E139D29D1/7c/3b/03/20160719143426517-259\n",
       "presentInArchive     False\n",
       "storageConfirmation  True\n",
       "locatorType\n",
       "status               AVAILABLE"
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   "execution_count": 8,
    "collapsed": false
   },
   "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>CHILD_OF_SAMPLE1</td> </tr><tr> <td>permId</td> <td>20160705234504004-206</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/CHILD_OF_SAMPLE1</td> </tr><tr> <td>type</td> <td>UNKNOWN</td> </tr><tr> <td>space</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>project</td> <td></td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td> </tr><tr> <td>tags</td> <td>['A_tag', 'due']</td> </tr><tr><td>attachments</td><td></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "property    value\n",
       "----------  --------------------------------------------\n",
       "code        CHILD_OF_SAMPLE1\n",
       "permId      20160705234504004-206\n",
       "identifier  /MY_NEW_SPACE/CHILD_OF_SAMPLE1\n",
       "type        UNKNOWN\n",
       "space       MY_NEW_SPACE\n",
       "project\n",
       "experiment  /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4\n",
       "tags        ['A_tag', 'due']"
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = o.get_sample('/MY_NEW_SPACE/CHILD_OF_SAMPLE1')\n",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "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_EXPERIMENT4</td> </tr><tr> <td>permId</td> <td>20160924020719018-358</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td> </tr><tr> <td>type</td> <td>DEFAULT_EXPERIMENT</td> </tr><tr> <td>project</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT</td> </tr><tr> <td>tags</td> <td>['A_tag', 'another_tag', 'too_late', 'tre']</td> </tr><tr><td>attachments</td><td></td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "property    value\n",
       "----------  --------------------------------------------\n",
       "code        MY_EXPERIMENT4\n",
       "permId      20160924020719018-358\n",
       "identifier  /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4\n",
       "type        DEFAULT_EXPERIMENT\n",
       "project     /MY_NEW_SPACE/VERMEUL_PROJECT\n",
       "tags        ['A_tag', 'another_tag', 'too_late', 'tre']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.get_experiment()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "s = o.get_sample('/MY_NEW_SPACE/HOW_WONDERFUL')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "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>experiment</th>\n",
       "      <th>sample</th>\n",
       "      <th>registrationDate</th>\n",
       "      <th>modificationDate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20160721002154012-269</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-07-21 00:22:11</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20160721002157457-270</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-07-21 00:22:11</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20160721002157457-271</td>\n",
       "      <td>{'NAME': 'my_delightful_analysis', 'DESCRIPTIO...</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-07-21 00:22:11</td>\n",
       "      <td>2017-01-20 23:41:42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20160721005440169-272</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-07-21 00:54:51</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20160721005441238-273</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-07-21 00:54:51</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20160818092513667-332</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-08-18 09:25:15</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20160818092513706-333</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-08-18 09:25:15</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20160826103944978-335</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-08-26 10:39:46</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20160826103945007-336</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-08-26 10:39:46</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20160929145446441-365</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-09-29 14:54:47</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20160929145446460-366</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-09-29 14:54:47</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20160929145446460-367</td>\n",
       "      <td>{'NAME': 'crc32 check', 'DESCRIPTION': 'should...</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-09-29 14:54:47</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>20161121005146312-396</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-11-21 00:51:47</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>20161121005146338-397</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-11-21 00:51:47</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>20161121005146338-398</td>\n",
       "      <td>{'NAME': 'my new data analysis', 'DESCRIPTION'...</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-11-21 00:51:47</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>20161121005357966-399</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_NOTEBOOK</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>20161121005357983-400</td>\n",
       "      <td>{}</td>\n",
       "      <td>JUPYTER_RESULT</td>\n",
       "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
       "    permId                 properties                                                                      type               experiment                                    sample                       registrationDate     modificationDate\n",
       "--  ---------------------  ------------------------------------------------------------------------------  -----------------  --------------------------------------------  ---------------------------  -------------------  -------------------\n",
       " 0  20160721002154012-269  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-07-21 00:22:11  2016-11-06 22:59:21\n",
       " 1  20160721002157457-270  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-07-21 00:22:11  2016-11-06 22:59:21\n",
       " 2  20160721002157457-271  {'NAME': 'my_delightful_analysis', 'DESCRIPTION': 'ave, some!'}                 JUPYTER_CONTAINER  /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-07-21 00:22:11  2017-01-20 23:41:42\n",
       " 3  20160721005440169-272  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-07-21 00:54:51  2016-11-06 22:59:21\n",
       " 4  20160721005441238-273  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-07-21 00:54:51  2016-11-06 22:59:21\n",
       " 5  20160818092513667-332  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-08-18 09:25:15  2016-11-06 22:59:21\n",
       " 6  20160818092513706-333  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-08-18 09:25:15  2016-11-06 22:59:21\n",
       " 7  20160826103944978-335  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-08-26 10:39:46  2016-11-06 22:59:21\n",
       " 8  20160826103945007-336  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-08-26 10:39:46  2016-11-06 22:59:21\n",
       " 9  20160929145446441-365  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-09-29 14:54:47  2016-11-06 22:59:21\n",
       "10  20160929145446460-366  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-09-29 14:54:47  2016-11-06 22:59:21\n",
       "11  20160929145446460-367  {'NAME': 'crc32 check', 'DESCRIPTION': 'should be aa4da9f7'}                    JUPYTER_CONTAINER  /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-09-29 14:54:47  2016-11-06 22:59:21\n",
       "12  20161121005146312-396  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-11-21 00:51:47  2016-11-21 00:53:59\n",
       "13  20161121005146338-397  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-11-21 00:51:47  2016-11-21 00:53:59\n",
       "14  20161121005146338-398  {'NAME': 'my new data analysis', 'DESCRIPTION': 'some meaningful description'}  JUPYTER_CONTAINER  /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-11-21 00:51:47  2016-11-21 00:53:59\n",
       "15  20161121005357966-399  {}                                                                              JUPYTER_NOTEBOOK   /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-11-21 00:53:59  2016-11-21 00:53:59\n",
       "16  20161121005357983-400  {}                                                                              JUPYTER_RESULT     /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4  /MY_NEW_SPACE/HOW_WONDERFUL  2016-11-21 00:53:59  2016-11-21 00:53:59"
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ds = s.get_datasets()[11]"
   "execution_count": 6,
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>isDirectory</th>\n",
       "      <th>pathInDataSet</th>\n",
       "      <th>fileSize</th>\n",
       "      <th>crc32Checksum</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>original</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>original/JUPYTER_NOTEBOOk</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>original/JUPYTER_NOTEBOOk/pybis demo.ipynb</td>\n",
       "      <td>77667</td>\n",
       "      <td>1fae7b5a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>original/JUPYTER_RESULT</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>original/JUPYTER_RESULT/PLATE1_A01_06_GFP.jpg</td>\n",
       "      <td>426229</td>\n",
       "      <td>aa4da9f7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  isDirectory                                  pathInDataSet fileSize  \\\n",
       "0        True                                       original       -1   \n",
       "1        True                      original/JUPYTER_NOTEBOOk       -1   \n",
       "2       False     original/JUPYTER_NOTEBOOk/pybis demo.ipynb    77667   \n",
       "3        True                        original/JUPYTER_RESULT       -1   \n",
       "4       False  original/JUPYTER_RESULT/PLATE1_A01_06_GFP.jpg   426229   \n",
       "\n",
       "  crc32Checksum  \n",
       "0             0  \n",
       "1             0  \n",
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.get_files()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pathInDataSet</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>original</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>original/JUPYTER_NOTEBOOk</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>original/JUPYTER_NOTEBOOk/pybis demo.ipynb</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>original/JUPYTER_RESULT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>original/JUPYTER_RESULT/PLATE1_A01_06_GFP.jpg</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
       "                                   pathInDataSet\n",
       "0                                       original\n",
       "1                      original/JUPYTER_NOTEBOOk\n",
       "2     original/JUPYTER_NOTEBOOk/pybis demo.ipynb\n",
       "3                        original/JUPYTER_RESULT\n",
       "4  original/JUPYTER_RESULT/PLATE1_A01_06_GFP.jpg"
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.get_files()[['pathInDataSet']]"
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DataSet 20160929145446460-367 archived\n"
     ]
    }
   ],
   "source": [
    "ds.archive(remove_from_data_store=False)"
   ]
  },
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Files downloaded to: localhost/20160929145446460-367\n"
     ]
    }
   ],
   "source": [
    "ds.download('/tmp')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "get_datasets() got an unexpected keyword argument 'withSamples'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0mTraceback (most recent call last)",
      "\u001b[1;32m<ipython-input-3-1a1f42c5c6c5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_datasets\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mwithSamples\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'20160630105304285-81'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: get_datasets() got an unexpected keyword argument 'withSamples'"
     ]
    "o.get_datasets(withSamples='20160630105304285-81')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "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>properties</th>\n",
       "      <th>type</th>\n",
       "      <th>sample</th>\n",
       "      <th>registrationDate</th>\n",
       "      <th>modificationDate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20160721002157457-271</td>\n",
       "      <td>{'NAME': 'my_delightful_analysis', 'DESCRIPTIO...</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-07-21 00:22:11</td>\n",
       "      <td>2016-11-21 00:51:47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20160817175233002-331</td>\n",
       "      <td>{'NAME': 'demo_analysis', 'DESCRIPTION': 'done!'}</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/VERMEUL/MON_160718_181654</td>\n",
       "      <td>2016-08-17 17:52:35</td>\n",
       "      <td>2016-10-05 12:46:43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20160929145446460-367</td>\n",
       "      <td>{'NAME': 'crc32 check', 'DESCRIPTION': 'should...</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-09-29 14:54:47</td>\n",
       "      <td>2016-11-06 22:59:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20161121005146338-398</td>\n",
       "      <td>{'NAME': 'my new data analysis', 'DESCRIPTION'...</td>\n",
       "      <td>JUPYTER_CONTAINER</td>\n",
       "      <td>/MY_NEW_SPACE/HOW_WONDERFUL</td>\n",
       "      <td>2016-11-21 00:51:47</td>\n",
       "      <td>2016-11-21 00:53:59</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<pybis.pybis.Things at 0x7fa301974c18>"
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o.get_datasets(type='JUPYTER_CONTAINER')"
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
      "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>20160721002157457-271</td> </tr><tr> <td>permId</td> <td>20160721002157457-271</td> </tr><tr> <td>type</td> <td>JUPYTER_CONTAINER</td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td> </tr><tr> <td>sample</td> <td>/MY_NEW_SPACE/HOW_WONDERFUL</td> </tr><tr> <td>parents</td> <td>[]</td> </tr><tr> <td>children</td> <td>['20160817175233002-331', '20161121005146338-398', '20170120234141588-419']</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>[]</td> </tr>\n",
       "property    value\n",
       "----------  ---------------------------------------------------------------------------\n",
       "code        20160721002157457-271\n",
       "permId      20160721002157457-271\n",
       "type        JUPYTER_CONTAINER\n",
       "experiment  /MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4\n",
       "sample      /MY_NEW_SPACE/HOW_WONDERFUL\n",
       "parents     []\n",
       "children    ['20160817175233002-331', '20161121005146338-398', '20170120234141588-419']\n",
       "container\n",
       "components\n",
       "tags        []"
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    "ds = o.get_dataset('20160721002157457-271')\n",
    "ds"
5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'_physicalData'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0mTraceback (most recent call last)",
      "\u001b[1;32m<ipython-input-24-86a39a42256d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mds\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__dict__\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'_physicalData'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m: '_physicalData'"
     ]
    }
   ],
   "source": [
    "ds.a.__dict__['_physicalData']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "ds.data['physicalData']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'@id': 1,\n",
       " '@type': 'as.dto.dataset.DataSet',\n",
       " 'accessDate': 1477299522237,\n",
       " 'children': [{'@id': 33,\n",
       "   '@type': 'as.dto.dataset.DataSet',\n",
       "   'accessDate': 1477522476771,\n",
       "   'children': None,\n",
       "   'code': '20160817175233002-331',\n",
       "   'components': None,\n",
       "   'containers': None,\n",
       "   'dataProducer': None,\n",
       "   'dataProductionDate': None,\n",
       "   'dataStore': None,\n",
       "   'experiment': None,\n",
       "   'fetchOptions': {'@id': 34,\n",
       "    '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "    'cacheMode': 'NO_CACHE',\n",
       "    'children': None,\n",
       "    'components': None,\n",
       "    'containers': None,\n",
       "    'count': None,\n",
       "    'dataStore': None,\n",
       "    'experiment': None,\n",
       "    'from': None,\n",
       "    'history': None,\n",
       "    'linkedData': None,\n",
       "    'materialProperties': None,\n",
       "    'modifier': None,\n",
       "    'parents': None,\n",
       "    'physicalData': None,\n",
       "    'properties': None,\n",
       "    'registrator': None,\n",
       "    'sample': None,\n",
       "    'sort': None,\n",
       "    'sortBy': None,\n",
       "    'tags': None,\n",
       "    'type': None},\n",
       "   'history': None,\n",
       "   'linkedData': None,\n",
       "   'materialProperties': None,\n",
       "   'measured': True,\n",
       "   'modificationDate': 1475664402592,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'permId': {'@id': 35,\n",
       "    '@type': 'as.dto.dataset.id.DataSetPermId',\n",
       "    'permId': '20160817175233002-331'},\n",
       "   'physicalData': None,\n",
       "   'postRegistered': True,\n",
       "   'properties': None,\n",
       "   'registrationDate': 1471449154550,\n",
       "   'registrator': None,\n",
       "   'sample': None,\n",
       "   'tags': None,\n",
       "   'type': None},\n",
       "  {'@id': 36,\n",
       "   '@type': 'as.dto.dataset.DataSet',\n",
       "   'accessDate': 1479685906571,\n",
       "   'children': None,\n",
       "   'code': '20161121005146338-398',\n",
       "   'components': None,\n",
       "   'containers': None,\n",
       "   'dataProducer': None,\n",
       "   'dataProductionDate': None,\n",
       "   'dataStore': None,\n",
       "   'experiment': None,\n",
       "   'fetchOptions': {'@id': 37,\n",
       "    '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "    'cacheMode': 'NO_CACHE',\n",
       "    'children': None,\n",
       "    'components': None,\n",
       "    'containers': None,\n",
       "    'count': None,\n",
       "    'dataStore': None,\n",
       "    'experiment': None,\n",
       "    'from': None,\n",
       "    'history': None,\n",
       "    'linkedData': None,\n",
       "    'materialProperties': None,\n",
       "    'modifier': None,\n",
       "    'parents': None,\n",
       "    'physicalData': None,\n",
       "    'properties': None,\n",
       "    'registrator': None,\n",
       "    'sample': None,\n",
       "    'sort': None,\n",
       "    'sortBy': None,\n",
       "    'tags': None,\n",
       "    'type': None},\n",
       "   'history': None,\n",
       "   'linkedData': None,\n",
       "   'materialProperties': None,\n",
       "   'measured': True,\n",
       "   'modificationDate': 1479686038994,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'permId': {'@id': 38,\n",
       "    '@type': 'as.dto.dataset.id.DataSetPermId',\n",
       "    'permId': '20161121005146338-398'},\n",
       "   'physicalData': None,\n",
       "   'postRegistered': True,\n",
       "   'properties': None,\n",
       "   'registrationDate': 1479685906571,\n",
       "   'registrator': None,\n",
       "   'sample': None,\n",
       "   'tags': None,\n",
       "   'type': None},\n",
       "  {'@id': 39,\n",
       "   '@type': 'as.dto.dataset.DataSet',\n",
       "   'accessDate': 1484952101835,\n",
       "   'children': None,\n",
       "   'code': '20170120234141588-419',\n",
       "   'components': None,\n",
       "   'containers': None,\n",
       "   'dataProducer': None,\n",
       "   'dataProductionDate': None,\n",
       "   'dataStore': None,\n",
       "   'experiment': None,\n",
       "   'fetchOptions': {'@id': 40,\n",
       "    '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "    'cacheMode': 'NO_CACHE',\n",
       "    'children': None,\n",
       "    'components': None,\n",
       "    'containers': None,\n",
       "    'count': None,\n",
       "    'dataStore': None,\n",
       "    'experiment': None,\n",
       "    'from': None,\n",
       "    'history': None,\n",
       "    'linkedData': None,\n",
       "    'materialProperties': None,\n",
       "    'modifier': None,\n",
       "    'parents': None,\n",
       "    'physicalData': None,\n",
       "    'properties': None,\n",
       "    'registrator': None,\n",
       "    'sample': None,\n",
       "    'sort': None,\n",
       "    'sortBy': None,\n",
       "    'tags': None,\n",
       "    'type': None},\n",
       "   'history': None,\n",
       "   'linkedData': None,\n",
       "   'materialProperties': None,\n",
       "   'measured': True,\n",
       "   'modificationDate': 1484952101835,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'permId': {'@id': 41,\n",
       "    '@type': 'as.dto.dataset.id.DataSetPermId',\n",
       "    'permId': '20170120234141588-419'},\n",
       "   'physicalData': None,\n",
       "   'postRegistered': True,\n",
       "   'properties': None,\n",
       "   'registrationDate': 1484952101835,\n",
       "   'registrator': None,\n",
       "   'sample': None,\n",
       "   'tags': None,\n",
       "   'type': None}],\n",
       " 'code': '20160721002157457-271',\n",
       " 'components': None,\n",
       " 'containers': [],\n",
       " 'dataProducer': None,\n",
       " 'dataProductionDate': None,\n",
       " 'dataStore': {'@id': 19,\n",
       "  '@type': 'as.dto.datastore.DataStore',\n",
       "  'code': 'DSS1',\n",
       "  'downloadUrl': 'https://localhost:8444',\n",
       "  'fetchOptions': {'@id': 20,\n",
       "   '@type': 'as.dto.datastore.fetchoptions.DataStoreFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'from': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None},\n",
       "  'modificationDate': 1486921080093,\n",
       "  'registrationDate': 1466761453065,\n",
       "  'remoteUrl': 'https://127.0.0.1:8444'},\n",
       " 'experiment': {'@id': 21,\n",
       "  '@type': 'as.dto.experiment.Experiment',\n",
       "  'attachments': None,\n",
       "  'code': 'MY_EXPERIMENT4',\n",
       "  'dataSets': None,\n",
       "  'fetchOptions': {'@id': 22,\n",
       "   '@type': 'as.dto.experiment.fetchoptions.ExperimentFetchOptions',\n",
       "   'attachments': None,\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'dataSets': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'project': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'samples': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'tags': None,\n",
       "   'type': 8},\n",
       "  'history': None,\n",
       "  'identifier': {'@id': 24,\n",
       "   '@type': 'as.dto.experiment.id.ExperimentIdentifier',\n",
       "   'identifier': '/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4'},\n",
       "  'materialProperties': None,\n",
       "  'modificationDate': 1483916743101,\n",
       "  'modifier': None,\n",
       "  'permId': {'@id': 23,\n",
       "   '@type': 'as.dto.experiment.id.ExperimentPermId',\n",
       "   'permId': '20160924020719018-358'},\n",
       "  'project': None,\n",
       "  'properties': None,\n",
       "  'registrationDate': 1474675639018,\n",
       "  'registrator': None,\n",
       "  'samples': None,\n",
       "  'tags': None,\n",
       "  'type': {'@id': 25,\n",
       "   '@type': 'as.dto.experiment.ExperimentType',\n",
       "   'code': 'DEFAULT_EXPERIMENT',\n",
       "   'description': 'Default Experiment',\n",
       "   'fetchOptions': 8,\n",
       "   'modificationDate': 1466758081586,\n",
       "   'permId': {'@id': 26,\n",
       "    '@type': 'as.dto.entitytype.id.EntityTypePermId',\n",
       "    'permId': 'DEFAULT_EXPERIMENT'},\n",
       "   'propertyAssignments': None}},\n",
       " 'fetchOptions': {'@id': 2,\n",
       "  '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "  'cacheMode': 'NO_CACHE',\n",
       "  'children': {'@id': 13,\n",
       "   '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'children': None,\n",
       "   'components': None,\n",
       "   'containers': None,\n",
       "   'count': None,\n",
       "   'dataStore': None,\n",
       "   'experiment': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'linkedData': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'physicalData': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'sample': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'tags': None,\n",
       "   'type': None},\n",
       "  'components': None,\n",
       "  'containers': {'@id': 14,\n",
       "   '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'children': None,\n",
       "   'components': None,\n",
       "   'containers': None,\n",
       "   'count': None,\n",
       "   'dataStore': None,\n",
       "   'experiment': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'linkedData': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'physicalData': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'sample': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'tags': None,\n",
       "   'type': None},\n",
       "  'count': None,\n",
       "  'dataStore': {'@id': 4,\n",
       "   '@type': 'as.dto.datastore.fetchoptions.DataStoreFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'from': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None},\n",
       "  'experiment': {'@id': 7,\n",
       "   '@type': 'as.dto.experiment.fetchoptions.ExperimentFetchOptions',\n",
       "   'attachments': None,\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'dataSets': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'project': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'samples': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'tags': None,\n",
       "   'type': {'@id': 8,\n",
       "    '@type': 'as.dto.experiment.fetchoptions.ExperimentTypeFetchOptions',\n",
       "    'cacheMode': 'NO_CACHE',\n",
       "    'count': None,\n",
       "    'from': None,\n",
       "    'propertyAssignments': None,\n",
       "    'sort': None,\n",
       "    'sortBy': None}},\n",
       "  'from': None,\n",
       "  'history': None,\n",
       "  'linkedData': {'@id': 6,\n",
       "   '@type': 'as.dto.dataset.fetchoptions.LinkedDataFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'externalDms': None,\n",
       "   'from': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None},\n",
       "  'materialProperties': None,\n",
       "  'modifier': None,\n",
       "  'parents': {'@id': 12,\n",
       "   '@type': 'as.dto.dataset.fetchoptions.DataSetFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'children': None,\n",
       "   'components': None,\n",
       "   'containers': None,\n",
       "   'count': None,\n",
       "   'dataStore': None,\n",
       "   'experiment': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'linkedData': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'physicalData': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'sample': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'tags': None,\n",
       "   'type': None},\n",
       "  'physicalData': {'@id': 5,\n",
       "   '@type': 'as.dto.dataset.fetchoptions.PhysicalDataFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'fileFormatType': None,\n",
       "   'from': None,\n",
       "   'locatorType': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'storageFormat': None},\n",
       "  'properties': {'@id': 11,\n",
       "   '@type': 'as.dto.property.fetchoptions.PropertyFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'from': None,\n",
       "   'sortBy': None},\n",
       "  'registrator': None,\n",
       "  'sample': {'@id': 9,\n",
       "   '@type': 'as.dto.sample.fetchoptions.SampleFetchOptions',\n",
       "   'attachments': None,\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'children': None,\n",
       "   'components': None,\n",
       "   'container': None,\n",
       "   'count': None,\n",
       "   'dataSets': None,\n",
       "   'experiment': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'space': None,\n",
       "   'tags': None,\n",
       "   'type': {'@id': 10,\n",
       "    '@type': 'as.dto.sample.fetchoptions.SampleTypeFetchOptions',\n",
       "    'cacheMode': 'NO_CACHE',\n",
       "    'count': None,\n",
       "    'from': None,\n",
       "    'propertyAssignments': None,\n",
       "    'sort': None,\n",
       "    'sortBy': None}},\n",
       "  'sort': None,\n",
       "  'sortBy': None,\n",
       "  'tags': {'@id': 15,\n",
       "   '@type': 'as.dto.tag.fetchoptions.TagFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'dataSets': None,\n",
       "   'experiments': None,\n",
       "   'from': None,\n",
       "   'materials': None,\n",
       "   'owner': None,\n",
       "   'samples': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None},\n",
       "  'type': {'@id': 3,\n",
       "   '@type': 'as.dto.dataset.fetchoptions.DataSetTypeFetchOptions',\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'count': None,\n",
       "   'from': None,\n",
       "   'propertyAssignments': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None}},\n",
       " 'history': None,\n",
       " 'linkedData': None,\n",
       " 'materialProperties': None,\n",
       " 'measured': True,\n",
       " 'modificationDate': 1484952101835,\n",
       " 'modifier': None,\n",
       " 'parents': [],\n",
       " 'permId': {'@id': 16,\n",
       "  '@type': 'as.dto.dataset.id.DataSetPermId',\n",
       "  'permId': '20160721002157457-271'},\n",
       " 'physicalData': None,\n",
       " 'postRegistered': True,\n",
       " 'properties': {'DESCRIPTION': 'ave, some!', 'NAME': 'my_delightful_analysis'},\n",
       " 'registrationDate': 1469053331423,\n",
       " 'registrator': None,\n",
       " 'sample': {'@id': 27,\n",
       "  '@type': 'as.dto.sample.Sample',\n",
       "  'attachments': None,\n",
       "  'children': None,\n",
       "  'code': 'HOW_WONDERFUL',\n",
       "  'components': None,\n",
       "  'container': None,\n",
       "  'dataSets': None,\n",
       "  'experiment': None,\n",
       "  'fetchOptions': {'@id': 28,\n",
       "   '@type': 'as.dto.sample.fetchoptions.SampleFetchOptions',\n",
       "   'attachments': None,\n",
       "   'cacheMode': 'NO_CACHE',\n",
       "   'children': None,\n",
       "   'components': None,\n",
       "   'container': None,\n",
       "   'count': None,\n",
       "   'dataSets': None,\n",
       "   'experiment': None,\n",
       "   'from': None,\n",
       "   'history': None,\n",
       "   'materialProperties': None,\n",
       "   'modifier': None,\n",
       "   'parents': None,\n",
       "   'properties': None,\n",
       "   'registrator': None,\n",
       "   'sort': None,\n",
       "   'sortBy': None,\n",
       "   'space': None,\n",
       "   'tags': None,\n",
       "   'type': 10},\n",
       "  'history': None,\n",
       "  'identifier': {'@id': 30,\n",
       "   '@type': 'as.dto.sample.id.SampleIdentifier',\n",
       "   'identifier': '/MY_NEW_SPACE/HOW_WONDERFUL'},\n",
       "  'materialProperties': None,\n",
       "  'modificationDate': 1479686038994,\n",
       "  'modifier': None,\n",
       "  'parents': None,\n",
       "  'permId': {'@id': 29,\n",
       "   '@type': 'as.dto.sample.id.SamplePermId',\n",
       "   'permId': '20160630105304285-81'},\n",
       "  'properties': None,\n",
       "  'registrationDate': 1467298384285,\n",
       "  'registrator': None,\n",
       "  'space': None,\n",
       "  'tags': None,\n",
       "  'type': {'@id': 31,\n",
       "   '@type': 'as.dto.sample.SampleType',\n",
       "   'autoGeneratedCode': False,\n",
       "   'code': 'UNKNOWN',\n",
       "   'description': 'Unknown',\n",
       "   'fetchOptions': 10,\n",
       "   'generatedCodePrefix': 'S',\n",
       "   'listable': True,\n",
       "   'modificationDate': 1466758020978,\n",
       "   'permId': {'@id': 32,\n",
       "    '@type': 'as.dto.entitytype.id.EntityTypePermId',\n",
       "    'permId': 'UNKNOWN'},\n",
       "   'propertyAssignments': None,\n",
       "   'showParentMetadata': False,\n",
       "   'subcodeUnique': False}},\n",
       " 'tags': [],\n",
       " 'type': {'@id': 17,\n",
       "  '@type': 'as.dto.dataset.DataSetType',\n",
       "  'code': 'JUPYTER_CONTAINER',\n",
       "  'description': 'Jupyter Analysis Results',\n",
       "  'fetchOptions': 3,\n",
       "  'kind': 'CONTAINER',\n",
       "  'modificationDate': 1467206946405,\n",
       "  'permId': {'@id': 18,\n",
       "   '@type': 'as.dto.entitytype.id.EntityTypePermId',\n",
       "   'permId': 'JUPYTER_CONTAINER'},\n",
       "  'propertyAssignments': None}}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.data"
   ]
  },
   "execution_count": 10,
    "collapsed": false,
    "scrolled": true
    "dss = o.get_datasets(type='JUPYTER_CONTAINER')"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "files = ds.get_files()\n",
    "files[0]"
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Files downloaded to: localhost/20160929145446460-367\n"
     ]
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "localhost/20160929145446460-367\r\n",
      "localhost/20160929145446460-367/original\r\n",
      "localhost/20160929145446460-367/original/JUPYTER_RESULT\r\n",
      "localhost/20160929145446460-367/original/JUPYTER_RESULT/PLATE1_A01_06_GFP.jpg\r\n",
      "localhost/20160929145446460-367/original/JUPYTER_NOTEBOOk\r\n",
      "localhost/20160929145446460-367/original/JUPYTER_NOTEBOOk/pybis demo.ipynb\r\n"
     ]
    "!find localhost/20160929145446460-367"
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'@id': 1,\n",
       "  '@type': 'FileInfoDssDTO',\n",
       "  'crc32Checksum': 1397688417,\n",
       "  'fileSize': '209715200',\n",
       "  'isDirectory': False,\n",
       "  'pathInDataSet': 'original/JUPYTER_RESULT/large_testfile',\n",
       "  'pathInListing': 'large_testfile'}]"
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    "ds2 = o.get_dataset('20160721002157457-271')\n",
    "ds2.get_file_list(start_folder='original/JUPYTER_RESULT/large_testfile')"
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Files downloaded to: localhost/20160721002157457-271\n"
     ]
    "ds2.download('original/JUPYTER_RESULT/large_testfile')"
   "execution_count": 28,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Files downloaded to: localhost/20160721002157457-271\n"
     ]
    }
   ],
   "source": [
    "ds2.download()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## upload data to openBIS\n",
    "The pybis data ingestion service «jupyter-uploader-api» in the openBIS instance is needed in order to work. Files are first uploaded to session workspace, then the ingestion service is activated which in turn registers 3 datasets:\n",
    "- a JUPYTER_CONTAINER containing:\n",
    "- JUPYTER_NOTEBOOK (containing the notebook files)\n",
    "- JUPYTER_RESULTS (containing any result files)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
      "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>20160721002157457-271</td> </tr><tr> <td>permId</td> <td>20160721002157457-271</td> </tr><tr> <td>type</td> <td>JUPYTER_CONTAINER</td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_EXPERIMENT4</td> </tr><tr> <td>sample</td> <td>/MY_NEW_SPACE/HOW_WONDERFUL</td> </tr><tr> <td>parents</td> <td>[]</td> </tr><tr> <td>children</td> <td>['20160817175233002-331', '20161121005146338-398']</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>[]</td> </tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "<pybis.pybis.DataSet at 0x7f3140f3dd30>"
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds = o.get_dataset('20160721002157457-271')\n",
    "ds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "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>YEA34</td> </tr><tr> <td>permId</td> <td>20161108230958839-384</td> </tr><tr> <td>identifier</td> <td>/MY_NEW_SPACE/YEA34</td> </tr><tr> <td>type</td> <td>YEAST</td> </tr><tr> <td>space</td> <td>MY_NEW_SPACE</td> </tr><tr> <td>experiment</td> <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPERIMENT</td> </tr><tr> <td>container</td> <td></td> </tr><tr> <td>components</td> <td></td> </tr><tr> <td>tags</td> <td>[]</td> </tr><tr><td>attachments</td><td>Bildschirmfoto 2016-12-20 um 10.47.26.png</td></tr>\n",
       "            </tbody>\n",
       "            </table>\n",
       "        "
      ],
      "text/plain": [
       "<pybis.pybis.Sample at 0x7f89bae33d30>"
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "cell_type": "code",
   "execution_count": 31,
    "o.new_analysis(\n",
    "    name='minimal', \n",
    "    sample = s\n",
    ")"
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Dataset registration successful'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    "o.new_analysis(\n",
    "    name='my new data analysis', \n",
    "    description='some meaningful description',\n",
    "    sample = s,\n",
    "    notebook_files=['pybis demo.ipynb'],\n",
    "    result_files=['PLATE1_A01_06_GFP.jpg'],\n",
    "    parents = [ds]\n",
    ")"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}