Skip to content
Snippets Groups Projects
pybis demo.ipynb 260 KiB
Newer Older
  • Learn to ignore specific revisions
  •        "      <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>"
    
         "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:"
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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>"
    
         "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:"
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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>"
    
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
    
        "o.get_dataset_type('ELN_PREVIEW')"
    
       ]
      },
      {
       "cell_type": "code",
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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,
    
       },
       "outputs": [
        {
         "data": {
          "text/html": [
           "<div>\n",
           "<table border=\"1\" class=\"dataframe\">\n",
           "  <thead>\n",
           "    <tr style=\"text-align: right;\">\n",
           "      <th></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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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": [
    
       "cell_type": "markdown",
       "metadata": {},
    
       "source": [
    
        "## working with projects"
    
       ]
      },
      {
       "cell_type": "code",
    
       "execution_count": 1,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "outputs": [],
       "source": [
    
        "sp = o.get_space('VERMEUL')"
    
       ]
      },
      {
       "cell_type": "code",
    
       "execution_count": 6,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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": [
    
       "execution_count": 7,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "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>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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "outputs": [
        {
         "data": {
          "text/plain": [
           "['localhost/20170115220158336-410/IMG_3587.JPG']"
          ]
         },
         "execution_count": 7,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
    
        "p.download_attachments()"
    
       "execution_count": 8,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "outputs": [],
       "source": [
    
        "p.add_attachment(fileName='testfile', description= 'another file', title= 'one more attachment')"
    
       "execution_count": 10,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "outputs": [
        {
         "data": {
          "text/html": [
    
           "            <table border=\"1\" class=\"dataframe\">\n",
           "            <thead>\n",
           "                <tr style=\"text-align: right;\">\n",
           "                <th>attribute</th>\n",
           "                <th>value</th>\n",
           "                </tr>\n",
           "            </thead>\n",
           "            <tbody>\n",
           "        <tr> <td>code</td> <td>PROJECT_ONE</td> </tr><tr> <td>description</td> <td></td> </tr><tr> <td>permId</td> <td>20170115220158336-410</td> </tr><tr> <td>identifier</td> <td>/VERMEUL/PROJECT_ONE</td> </tr><tr> <td>space</td> <td>VERMEUL</td> </tr><tr> <td>leader</td> <td></td> </tr><tr> <td>registrator</td> <td>vermeul</td> </tr><tr> <td>registrationDate</td> <td>2017-01-15 22:01:58</td> </tr><tr> <td>modifier</td> <td></td> </tr><tr> <td>modificationDate</td> <td>2017-01-24 15:13:08</td> </tr><tr><td>attachments</td><td>IMG_3587.JPG<br/>testfile</td></tr>\n",
    
           "            </tbody>\n",
           "            </table>\n",
           "        "
    
           "<pybis.pybis.Project at 0x7fc53d9cd780>"
    
         "execution_count": 10,
    
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
    
       ]
      },
      {
       "cell_type": "code",
    
       "execution_count": 12,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "outputs": [
        {
    
         "name": "stdout",
         "output_type": "stream",
         "text": [
          "Project successfully updated.\n"
         ]
    
       ]
      },
      {
       "cell_type": "markdown",
       "metadata": {},
       "source": [
    
        "## working with experiments"
    
       "execution_count": 1,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
        "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": {
    
       },
       "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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "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>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,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "cell_type": "code",
       "execution_count": 9,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},
    
       "source": [
    
        "e0.add_tags('uno')"
    
       "execution_count": 12,
    
    Swen Vermeul's avatar
    Swen Vermeul committed
       "metadata": {},