Skip to content
Snippets Groups Projects
pybis demo.ipynb 205 KiB
Newer Older
  • Learn to ignore specific revisions
  • {
     "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": 5,
    
       "metadata": {
        "collapsed": false
       },
       "outputs": [
        {
         "data": {
          "text/plain": [
    
           "'vermeul-170126143455586x8A10E9354784B7ED77C8901A15079664'"
    
         "execution_count": 5,
    
         "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": 5,
    
       "metadata": {
        "collapsed": false
       },
       "outputs": [
        {
         "data": {
          "text/plain": [
           "True"
          ]
         },
    
         "execution_count": 5,
    
         "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": 4,
    
       "metadata": {
        "collapsed": false
       },
       "outputs": [
        {
         "name": "stdout",
         "output_type": "stream",
         "text": [
          "········\n"
         ]
        },
        {
         "data": {
          "text/plain": [
    
           "'vermeul-170126143455586x8A10E9354784B7ED77C8901A15079664'"
    
         "execution_count": 4,
    
         "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 have to:"
       ]
      },
      {
       "cell_type": "code",
    
       "execution_count": 3,
    
       "metadata": {
        "collapsed": false
       },
       "outputs": [
        {
         "name": "stdout",
         "output_type": "stream",
         "text": [
          "········\n"
         ]
        },
        {
    
         "ename": "ValueError",
         "evalue": "login to openBIS failed",
         "output_type": "error",
         "traceback": [
          "\u001b[1;31m\u001b[0m",
          "\u001b[1;31mValueError\u001b[0mTraceback (most recent call last)",
          "\u001b[1;32m<ipython-input-3-1d417cc1b72e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[0mo2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOpenbis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'https://sprint-openbis.ethz.ch:8443'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mverify_certificates\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[0mpassword\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetpass\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgetpass\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mo2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlogin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'vermeul'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mpassword\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      6\u001b[0m \u001b[0mo2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtoken\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
          "\u001b[1;32m/vagrant_python/PyBis/pybis/pybis.py\u001b[0m in \u001b[0;36mlogin\u001b[1;34m(self, username, password, save_token)\u001b[0m\n\u001b[0;32m    636\u001b[0m         \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_post_request\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mas_v3\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlogin_request\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    637\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mresult\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 638\u001b[1;33m             \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"login to openBIS failed\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    639\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    640\u001b[0m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtoken\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
          "\u001b[1;31mValueError\u001b[0m: login to openBIS failed"
         ]
    
        }
       ],
       "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)"
       ]
      },
    
       "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>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": 6,
    
         "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"
       ]
      },
    
       "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": [
    
        "list all possible attributes and methods by using TAB completition"
    
       "execution_count": 5,
    
       },
       "outputs": [],
       "source": [
    
        "# try it: put the cursor after the dot and press TAB\n",
        "pr."
    
       "execution_count": 12,
    
        "collapsed": false
    
       "outputs": [
        {
         "data": {
          "text/plain": [
    
           "'vermeul-170124150556968xD89B56E418C00C50087A3B6D282B996F'"
    
          ]
         },
         "execution_count": 12,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
    
        "from pybis import Openbis\n",
        "o = Openbis(url='https://localhost:8443', verify_certificates=False)\n",
        "o.token"
    
       "execution_count": 13,
    
       "metadata": {
        "collapsed": false
       },
    
       "outputs": [],
       "source": [
        "pr = o.get_project('/MY_NEW_SPACE/VERMEUL_PROJECT')"
       ]
      },
      {
       "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>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/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>1</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>"
          ],
          "text/plain": [
    
           "<pybis.pybis.Things at 0x7fe9324b8e10>"
    
         "execution_count": 14,
    
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
    
        "pr.get_experiments()"
    
       "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>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>/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>vermeul</td>\n",
           "      <td>2016-07-05 23:45:04</td>\n",
           "      <td>vermeul</td>\n",
           "      <td>2016-10-07 01:05:46</td>\n",
           "    </tr>\n",
           "    <tr>\n",
           "      <th>1</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>vermeul</td>\n",
           "      <td>2016-06-30 16:53:04</td>\n",
           "      <td>vermeul</td>\n",
           "      <td>2016-11-21 00:53:59</td>\n",
           "    </tr>\n",
           "    <tr>\n",
           "      <th>2</th>\n",
           "      <td>/MY_NEW_SPACE/YEA21</td>\n",
           "      <td>20161025010638912-382</td>\n",
           "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPER...</td>\n",
           "      <td>YEAST</td>\n",
           "      <td>vermeul</td>\n",
           "      <td>2016-10-25 01:06:39</td>\n",
           "      <td>vermeul</td>\n",
           "      <td>2017-01-19 00:02:53</td>\n",
           "    </tr>\n",
           "    <tr>\n",
           "      <th>3</th>\n",
           "      <td>/MY_NEW_SPACE/YEA34</td>\n",
           "      <td>20161108230958839-384</td>\n",
           "      <td>/MY_NEW_SPACE/VERMEUL_PROJECT/MY_SPECIAL_EXPER...</td>\n",
           "      <td>YEAST</td>\n",
           "      <td>vermeul</td>\n",
           "      <td>2016-11-08 23:09:59</td>\n",
           "      <td>vermeul</td>\n",
           "      <td>2017-01-20 23:41:42</td>\n",
    
           "    </tr>\n",
           "  </tbody>\n",
           "</table>\n",
           "</div>"
    
           "<pybis.pybis.Things at 0x7fe9324b8668>"
          ]
         },
         "execution_count": 15,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "pr.get_samples()"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": 16,
       "metadata": {
        "collapsed": false
       },
       "outputs": [
        {
         "data": {
          "text/html": [
    
           "            <table border=\"1\" class=\"dataframe\">\n",
           "            <thead>\n",
           "                <tr style=\"text-align: right;\">\n",
           "                <th>attribute</th>\n",
           "                <th>value</th>\n",
           "                </tr>\n",
           "            </thead>\n",
           "            <tbody>\n",
           "        <tr> <td>code</td> <td>20160929145446460-367</td> </tr><tr> <td>permId</td> <td>20160929145446460-367</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>[]</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.DataSet at 0x7fe9329712e8>"
    
         "execution_count": 16,
    
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
    
        "pr.get_datasets()[13]"
    
       "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>VERMEUL</td> </tr><tr> <td>description</td> <td>Space for user vermeul</td> </tr><tr> <td>registrator</td> <td>admin</td> </tr><tr> <td>registrationDate</td> <td>2016-06-24 11:50:48</td> </tr><tr> <td>modificationDate</td> <td>2016-06-24 11:50:48</td> </tr>\n",
           "            </tbody>\n",
           "            </table>\n",
           "        "
          ],
          "text/plain": [
           "<pybis.pybis.Space at 0x7fdf746a6080>"
          ]
         },
         "execution_count": 6,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "o.get_space('vermeul')"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": 16,
       "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>FLIES</td> </tr><tr> <td>description</td> <td></td> </tr><tr> <td>permId</td> <td>20160624054751885-35</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/FLIES</td> </tr><tr> <td>space</td> <td>MATERIALS</td> </tr><tr><td>attachments</td><td></td></tr>\n",
           "            </tbody>\n",
           "            </table>\n",
           "        "
          ],
          "text/plain": [
           "<pybis.pybis.Project at 0x7f3140f7ac50>"
          ]
         },
         "execution_count": 16,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "o.get_project('/Materials/FLIES')"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": 21,
       "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>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>6</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 0x7f3140faf710>"
    
         "execution_count": 21,
    
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
    
        "ps = o.get_projects(space='materials')\n",
        "ps"
    
       "execution_count": 10,
    
       "metadata": {
        "collapsed": false
       },
       "outputs": [
        {
         "data": {
          "text/html": [
    
           "            <table border=\"1\" class=\"dataframe\">\n",
           "            <thead>\n",
           "                <tr style=\"text-align: right;\">\n",
           "                <th>attribute</th>\n",
           "                <th>value</th>\n",
           "                </tr>\n",
           "            </thead>\n",
           "            <tbody>\n",
           "        <tr> <td>code</td> <td>YEASTS</td> </tr><tr> <td>description</td> <td></td> </tr><tr> <td>permId</td> <td>20160624054751885-36</td> </tr><tr> <td>identifier</td> <td>/MATERIALS/YEASTS</td> </tr><tr> <td>space</td> <td>MATERIALS</td> </tr><tr><td>attachments</td><td></td></tr>\n",
    
           "            </tbody>\n",
           "            </table>\n",
           "        "
          ],
          "text/plain": [
    
           "<pybis.pybis.Project at 0x7f81504f8630>"
    
         "execution_count": 10,
    
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
    
        "ps[6]"
       ]
      },
      {
       "cell_type": "markdown",
       "metadata": {},
       "source": [
        "**get vocabulary terms**"
    
       ]
      },
      {
       "cell_type": "code",
    
       "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": "code",
    
       "execution_count": 11,
    
       "metadata": {
        "collapsed": false
       },
    
       "outputs": [],
       "source": [
        "from pybis import Openbis\n",
        "o = Openbis(url='https://localhost:8443', verify_certificates=False)"
       ]