diff --git a/notebook.ipynb b/notebook.ipynb index ff7d920b6194c5f05814f776b048a798f34b4037..0cb4c87d901ec0f1b37b591f5fbb38db72be2574 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:f32a4926b7461da7133e01bae5a7f9c6b580667534ff6f2af9832df26de9c88e" + "signature": "sha256:50f0011df38c64a61f87d0fd5e0bd41496c221072c1ed80168340a42e699384e" }, "nbformat": 3, "nbformat_minor": 0, @@ -88,15 +88,14 @@ "level": 4, "metadata": {}, "source": [ - "The cornerstones of the scientific method:" + "The cornerstone of the scientific method:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "- Replication\n", - "- Reproduction" + "- Replication & Reproduction" ] }, { @@ -181,7 +180,15 @@ "level": 4, "metadata": {}, "source": [ - "Strong position!" + "Lots of reasons to python!\n" + ] + }, + { + "cell_type": "heading", + "level": 4, + "metadata": {}, + "source": [ + "How to python?" ] }, { @@ -271,7 +278,7 @@ "source": [ "- Started by typing 'ipython notebook' in the directory where you want to store notebooks\n", "- Opens a new browser window with an index page where existing notebooks are shown\n", - "- New notebooks can be created in that directory" + "- New notebooks can be created in that same directory" ] }, { @@ -364,11 +371,12 @@ "metadata": {}, "source": [ "- Install locally\n", - " - See instructions in this course\n", + " - See instructions in this course\n", + " - Linux, Windows\n", " \n", " \n", - "- Shark cluster LUMC\n", - " - Type 'notebook' and click the URL" + "- Remotely, Shark cluster LUMC\n", + " - Type 'notebook' and click the given URL" ] }, { @@ -418,7 +426,7 @@ " - Indicated with a <font color='grey'>grey</font> cell border\n", " - Edit the notebook as a whole\n", "\n", - "Different shortcuts apply in both modes!\n", + "Note: Different shortcuts apply in both modes!\n", "\n", "\n" ] @@ -434,13 +442,10 @@ { "cell_type": "code", "collapsed": false, - "input": [ - "a = 12" - ], + "input": [], "language": "python", "metadata": {}, - "outputs": [], - "prompt_number": 63 + "outputs": [] }, { "cell_type": "heading", @@ -472,7 +477,6 @@ "\n", "\n", "- esc : command mode\n", - "- ctrl+m : command mode\n", "- shift+enter : run cell\n", "- ctrl+enter : run cell, select below\n" ] @@ -492,19 +496,61 @@ "- enter : edit mode\n", "- shift+enter : run cell\n", "- ctrl+enter : run cell, select below\n", + "\n", + "\n", "- y : to code\n", "- m : to markdown\n", + "\n", + "\n", "- ctrl+k : move cell up\n", "- ctrl+j : move cell down\n", + "\n", + "\n", "- a : insert cell above\n", "- b : insert cell below\n", + "\n", + "\n", "- x : cut cell\n", "- c : copy cell\n", "- v : paste cell below\n", + "\n", + "\n", "- z : undo last delete\n", "- d : delete cell (press twice)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Press 'h' to show the help." + ] + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Saving your notebook\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- The notebook automatically saves\n", + "- You can manually click the 'save' icon or press CTRL+s" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Checkpoints**\n", + "\n", + "Currently only single checkpoints are stored, but multiple checkpoints will be enabled for future versions of IPython and Bookstore. " + ] + }, { "cell_type": "heading", "level": 1, @@ -539,8 +585,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "- Markdown cell\n", - " - Format your document nicely\n" + "This is a markdown cell which allows to format your document nicely and add context to code cells." ] }, { @@ -564,13 +609,29 @@ "level": 1, "metadata": {}, "source": [ - "Running code in a code cell" + "Running python code" ] }, { "cell_type": "heading", "level": 4, "metadata": {}, + "source": [ + "All of the python goodness works!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- Cells run asynchronous\n", + "- Results are persistent\n", + "- Save time by running intensive code blocks only once" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, "source": [ "Run a code cell by pressing the play button or shift+enter" ] @@ -595,69 +656,23 @@ ] } ], - "prompt_number": 43 + "prompt_number": 10 }, { - "cell_type": "heading", - "level": 1, + "cell_type": "markdown", "metadata": {}, "source": [ - "\u00a7 Excercise : My first Notebook" + "Use the 'Cell' option in the toolbar to run multiple cells at once." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Start a Notebook session.\n", - " - $ ipython notebook\n", - "This opens a webbrowser and shows existing notebooks.\n", - " - Create a new notebook by clicking the 'New notebook' button.\n", - "A new tab will open with a fresh notebook. Rename your notebook to something useful\n", - " - Click on the current name (Untitled1) and edit this\n", - "Add the code shown below to some cells\n", - " - Add cells by pressen the '+' button or ALT+ENTER" + "- If the kernel is busy running it states 'Busy' in the header of the window or tab\n", + "- The indicator in the top right corner shows the kernel state" ] }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "complements = {'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C'} " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 1 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def translate(s):\n", - " c = ''\n", - " for i in s:\n", - " c = c + complements[i]\n", - " return c" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def reverse(s):\n", - " rev = s[::-1]\n", - " return rev" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 7 - }, { "cell_type": "heading", "level": 1, @@ -801,37 +816,65 @@ }, { "cell_type": "heading", - "level": 4, + "level": 1, "metadata": {}, "source": [ - "Exceptions are formatted nicely:" + "\u00a7 Excercise : My first Notebook" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Start a Notebook session.\n", + " - $ ipython notebook\n", + "This opens a webbrowser and shows existing notebooks.\n", + " - Create a new notebook by clicking the 'New notebook' button.\n", + "A new tab will open with a fresh notebook. Rename your notebook to something useful\n", + " - Click on the current name (Untitled1) and edit this\n", + "Add the code shown below to some **_code_** cells\n", + " - Add cells by pressen the '+' button or ALT+ENTER\n", + " - Remember the keyboard shortcuts or the help function ('h')\n", + "\n", + "\n", + "Notice the laste cell produced output! We will continue to develop this notebook later this session." ] }, { "cell_type": "code", "collapsed": false, "input": [ - "# Let's distribute a few cookies to nobody\n", - "cookies = 3\n", - "persons = 0\n", - "share = cookies / persons\n", - "print share" + "def translate(seq):\n", + " complements = {'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C'}\n", + " c_seq = ''\n", + " for n in seq:\n", + " c_seq = c_seq + complements[n]\n", + " return c_seq" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 40 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "translate('ACGT')" ], "language": "python", "metadata": {}, "outputs": [ { - "ename": "ZeroDivisionError", - "evalue": "integer division or modulo by zero", - "output_type": "pyerr", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m<ipython-input-51-0d805d7db48f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mcookies\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mpersons\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mshare\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcookies\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mpersons\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[0mshare\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero" + "metadata": {}, + "output_type": "pyout", + "prompt_number": 41, + "text": [ + "'TGCA'" ] } ], - "prompt_number": 51 + "prompt_number": 41 }, { "cell_type": "heading", @@ -848,7 +891,7 @@ "- When a cell is run it can generate output\n", "- This is shown below the cell in the output area\n", "- Output is asynchronous\n", - "- Outputs are objects and are available under the variable '_'\n", + "- Outputs are objects and the last one is available under the variable '_'\n", " " ] }, @@ -929,6 +972,40 @@ ], "prompt_number": 115 }, + { + "cell_type": "heading", + "level": 4, + "metadata": {}, + "source": [ + "Exceptions are formatted nicely:" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Let's distribute a few cookies to nobody\n", + "cookies = 3\n", + "persons = 0\n", + "share = cookies / persons\n", + "print share" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "ename": "ZeroDivisionError", + "evalue": "integer division or modulo by zero", + "output_type": "pyerr", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m<ipython-input-51-0d805d7db48f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mcookies\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mpersons\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mshare\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcookies\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mpersons\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[0mshare\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero" + ] + } + ], + "prompt_number": 51 + }, { "cell_type": "heading", "level": 1, @@ -941,7 +1018,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Formatted **text** _can_ **_be_** ~~aded~~ added to IPython Notebooks using Markdown cells. \n", + "Formatted **text** _can_ **_be_** added to IPython Notebooks using Markdown cells. \n", "\n" ] }, @@ -961,6 +1038,17 @@ "http://daringfireball.net/projects/markdown/" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To create a markdown cell:\n", + "- First focus on the cell you want to format\n", + "- Then select 'Markdown' the dropdown box in the toolbar or press 'm' in command mode\n", + "- Note that you need to run a markdown cell to show the result\n", + " - Click 'play' or SHIFT+ENTER" + ] + }, { "cell_type": "heading", "level": 1, @@ -1037,6 +1125,13 @@ "General HTML" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Since markdown is a subset of HTML, this will also work" + ] + }, { "cell_type": "raw", "metadata": {}, @@ -1081,6 +1176,13 @@ "Markdown also supports formulas" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Nicely formatted" + ] + }, { "cell_type": "raw", "metadata": {}, @@ -1097,77 +1199,83 @@ }, { "cell_type": "heading", - "level": 1, + "level": 4, "metadata": {}, "source": [ - "\u00a7 Excercise : My next Notebook" + "We can also show figures. These can be locally or linked from the www." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Let's add some markdown cells\n", - "- Select the top code cell, press ESC to go into command mode\n", - "- Press 'b', this will add a cell above the selected cell\n", - "- Notice the focus is on the new cell\n", - "- Now press 'm' to set the celltype to Markdown\n", - "- Press ENTER and add some text" + "- Notebook has acceess to all the files down in the directory" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### My next notebook\n", - "[Michiel van Galen](mailto:m.van_galen@lumc.nl)" + "" ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "complements = {'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C'} " - ], - "language": "python", + "cell_type": "markdown", "metadata": {}, - "outputs": [], - "prompt_number": 8 + "source": [ + "" + ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "def translate(s):\n", - " c = ''\n", - " for i in s:\n", - " c = c + complements[i]\n", - " return c" - ], - "language": "python", + "cell_type": "heading", + "level": 1, "metadata": {}, - "outputs": [], - "prompt_number": 9 + "source": [ + "<br></br><br></br>\n", + "Some final examples:" + ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "def reverse(s):\n", - " rev = s[::-1]\n", - " return rev" - ], - "language": "python", + "cell_type": "heading", + "level": 4, "metadata": {}, - "outputs": [] + "source": [ + "Python supports videos also. Note this is not a markdown cell, but a code cell using a python package." + ] }, { "cell_type": "code", "collapsed": false, - "input": [], + "input": [ + "from IPython.display import YouTubeVideo\n", + "# a talk about IPython at Sage Days at U. Washington, Seattle.\n", + "# Video credit: William Stein.\n", + "YouTubeVideo('1j_HxD4iLn8')" + ], "language": "python", "metadata": {}, - "outputs": [] + "outputs": [ + { + "html": [ + "\n", + " <iframe\n", + " width=\"400\"\n", + " height=300\"\n", + " src=\"https://www.youtube.com/embed/1j_HxD4iLn8\"\n", + " frameborder=\"0\"\n", + " allowfullscreen\n", + " ></iframe>\n", + " " + ], + "metadata": {}, + "output_type": "pyout", + "prompt_number": 34, + "text": [ + "<IPython.lib.display.YouTubeVideo at 0x331c850>" + ] + } + ], + "prompt_number": 34 }, { "cell_type": "heading", @@ -1178,11 +1286,10 @@ ] }, { - "cell_type": "heading", - "level": 4, + "cell_type": "markdown", "metadata": {}, "source": [ - "More on this later in the course" + "More on this later in the course." ] }, { @@ -1202,93 +1309,139 @@ "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEACAYAAABYq7oeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHX1JREFUeJzt3XmYFNW5x/HviCASEQQDsgZEUHFBwF2UUREQZVEQEBcS\nkCSiEhNXjDfMjcarPmhERKKICERG9hGQHWlBYFhkERzZBWWQQfZFYLa+f7w1djOydvdMVXf9Ps9T\nT1efqep+p2D67bPUOSAiIiIiIiIiIiIiIiIiIiIiIiIi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mpXAvhFc\n4OxXwT44E9mNQBvgOyAVuA27Hn67DmD//7dgE1SCdUw3Arbhv2txNTAf2AnkAuOwpmg/XosCx/ub\nKPxZWt0pOy6vJ4clQF1CN8h1ItQZ6QdJwGBsRMpbYeUTsI43nMc0EtsL2H/s2kBn4HPgIfx3HcA+\n+H4A6jnPm2GjdSbiv2uxGms3Pxv7W2mG/a348VoUON7fxATsb6cU9ndUF1hU7NHFmJ9vkGuCtbEv\nx5pUlmFDeytgnbOJPlTvWJoS+oLg1+vQAKs5rMC+LZfDv9fiWUJDWYdiNW2/XItUrK8lG/vC8AdO\n/Lu/gH2OrgZaFGukIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIisfT/aY4DA839B3AAAAAASUVO\nRK5CYII=\n", "text": [ - "<matplotlib.figure.Figure at 0x3cda910>" + "<matplotlib.figure.Figure at 0x333b590>" ] } ], - "prompt_number": 21 + "prompt_number": 36 }, { "cell_type": "heading", - "level": 4, + "level": 1, "metadata": {}, "source": [ - "Support for Latex" + "\u00a7 Excercise : My first Notebook" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's add some markdown cells to the notebook you created earlier:\n", + " - Select the top code cell\n", + " - Press ESC to go into command mode\n", + " - Press 'b', this will add a cell above the selected cell\n", + " - Notice the focus is on the new cell\n", + " - Now press 'm' to set the celltype to Markdown\n", + " - Press ENTER and add some code (see below for example)\n", + " - Run the cell and see if it worked\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Example markdown code:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### My next notebook\n", + "\n", + "This notebook is my first notebook with some experimental code.\n", + "\n", + "Author: [Michiel van Galen](mailto:m.van_galen@lumc.nl)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, try to add more python code to the notebook:\n", + " - Make sure to set the cell type to code\n", + " - Add the 'reverse' function to your notebook as shown below" ] }, { "cell_type": "code", "collapsed": false, "input": [ - "from IPython.display import Math\n", - "Math(r'F(k) = \\int_{-\\infty}^{\\infty} f(x) e^{2\\pi i k} dx')\n" + "def reverse(seq):\n", + " rev = seq[::-1]\n", + " return rev" ], "language": "python", "metadata": {}, - "outputs": [ - { - "latex": [ - "$$F(k) = \\int_{-\\infty}^{\\infty} f(x) e^{2\\pi i k} dx$$" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 126, - "text": [ - "<IPython.core.display.Math at 0x3318ed0>" - ] - } - ], - "prompt_number": 126 + "outputs": [], + "prompt_number": 42 }, { - "cell_type": "heading", - "level": 1, + "cell_type": "markdown", "metadata": {}, "source": [ - "Other integration such as videos" + "Try using both the 'reverse' and 'translate' function." ] }, { - "cell_type": "heading", - "level": 4, + "cell_type": "code", + "collapsed": false, + "input": [ + "reverse('AACGT')" + ], + "language": "python", "metadata": {}, - "source": [ - "For example youtube" - ] + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 45, + "text": [ + "'TGCAA'" + ] + } + ], + "prompt_number": 45 }, { "cell_type": "code", "collapsed": false, "input": [ - "from IPython.display import YouTubeVideo\n", - "# a talk about IPython at Sage Days at U. Washington, Seattle.\n", - "# Video credit: William Stein.\n", - "YouTubeVideo('1j_HxD4iLn8')" + "translate(_)" ], "language": "python", "metadata": {}, "outputs": [ { - "html": [ - "\n", - " <iframe\n", - " width=\"400\"\n", - " height=300\"\n", - " src=\"https://www.youtube.com/embed/1j_HxD4iLn8\"\n", - " frameborder=\"0\"\n", - " allowfullscreen\n", - " ></iframe>\n", - " " - ], "metadata": {}, "output_type": "pyout", - "prompt_number": 116, + "prompt_number": 46, "text": [ - "<IPython.lib.display.YouTubeVideo at 0x331a6d0>" + "'ACGTT'" ] } ], - "prompt_number": 116 + "prompt_number": 46 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Palindromic sequences play an important role in molecular biology:\n", + "\n", + "http://en.wikipedia.org/wiki/Palindromic_sequence" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Add the following features to your notebook:\n", + " - Think of function which can test if a seqeunce is palindromic\n", + " - Nicely formatted mardown cell(s) explaining the notebook\n", + " - Add links as references like above" + ] }, { "cell_type": "heading", @@ -1299,6 +1452,7 @@ "<br></br><br></br><br></br><br></br>\n", "<br></br><br></br><br></br><br></br>\n", "<br></br><br></br><br></br><br></br>\n", + "<br></br><br></br><br></br><br></br>\n", "Ignore following code for layout" ] },