Newer
Older
},
{
"cell_type": "code",
"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"
]
}
],
"source": [
"!find localhost/20160929145446460-367"
]
},
{
"cell_type": "code",
"execution_count": 10,
"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"
}
],
"source": [
"ds2 = o.get_dataset('20160721002157457-271')\n",
"ds2.get_file_list(start_folder='original/JUPYTER_RESULT/large_testfile')"
"execution_count": 17,
"name": "stdout",
"output_type": "stream",
"text": [
"Files downloaded to: localhost/20160721002157457-271\n"
]
"ds2.download('original/JUPYTER_RESULT/large_testfile')"
]
},
{
"cell_type": "code",
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
"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,
"outputs": [
{
"data": {
" <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,
"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",
" "
],
"<pybis.pybis.Sample at 0x7f89bae33d30>"
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 31,
"o.new_analysis(\n",
" name='minimal', \n",
" sample = s\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 30,
"data": {
"text/plain": [
"'Dataset registration successful'"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"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,