{ "metadata": { "name": "", "signature": "sha256:32aa2705fc2a411912d990d943f9130c01a0c08bf7a75a96a81adf27964bde7d" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "import synapseclient" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "#login to synapse\n", "syn = synapseclient.login() #if you are logging for the first time you need to specify the username and password" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stderr", "text": [ "Welcome, Abhishek Pratap!\n" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Provenence for creating training data for Adalimumab" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#get the current synapse entity and then add the entities that were used to produce it\n", "\n", "ada_training_data = syn.get('syn2754093', downloadFile=False)\n", "\n", "#adding the things used and executed to produce this\n", "ada_training_data = syn.store(ada_training_data,\n", " used = ['syn2343245', 'syn2343207'],\n", " executed = ['syn2775464'])" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Provenence for creating training data for Etanercept" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#get the current synapse entity and then add the entities that were used to produce it\n", "\n", "etan_training_data = syn.get('syn2754073', downloadFile=False)\n", "\n", "#adding the things used and executed to produce this\n", "etan_training_data = syn.store(etan_training_data,\n", " used = ['syn2343245', 'syn2343207'],\n", " executed = ['syn2775464'])" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Provenence for creating training data for Infliximab" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#get the current synapse entity and then add the entities that were used to produce it\n", "inflix_training_data = syn.get('syn2754077', downloadFile=False)\n", "\n", "#adding the things used and executed to produce this\n", "inflix_training_data = syn.store(inflix_training_data,\n", " used = ['syn2343245', 'syn2343207'],\n", " executed = ['syn2775464'])" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 2. Now creating the provenance for the final prediction" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#get the final prediction\n", "final_prediction = syn.get('syn2484813', downloadFile=False)\n", "\n", "\n", "final_prediction = syn.store(final_prediction,\n", " used = [inflix_training_data, ada_training_data, etan_training_data],\n", " executed = ['syn2754070', 'syn2754071', 'syn2754072'])\n" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 10 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }