diff --git a/notebook.ipynb b/notebook.ipynb index 84ad0542284c2fa26ddd5e0765afd1f74102cffa..ff7d920b6194c5f05814f776b048a798f34b4037 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:bf6c651b1482834080a5bec22664d3f8b69e32fdf9036b00a12959d76f47d3be" + "signature": "sha256:f32a4926b7461da7133e01bae5a7f9c6b580667534ff6f2af9832df26de9c88e" }, "nbformat": 3, "nbformat_minor": 0, @@ -613,9 +613,10 @@ " - $ 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.\n", - " - Rename your notebook to something useful by clicking on the current name (Untitled1).\n", - "Add the code shown below to some cells and run it by pressing the play button or shift+enter" + "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" ] }, { @@ -626,17 +627,8 @@ ], "language": "python", "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "seq = 'GAATTC'" - ], - "language": "python", - "metadata": {}, - "outputs": [] + "outputs": [], + "prompt_number": 1 }, { "cell_type": "code", @@ -650,7 +642,8 @@ ], "language": "python", "metadata": {}, - "outputs": [] + "outputs": [], + "prompt_number": 3 }, { "cell_type": "code", @@ -662,17 +655,8 @@ ], "language": "python", "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "print reverse(translate(seq))" - ], - "language": "python", - "metadata": {}, - "outputs": [] + "outputs": [], + "prompt_number": 7 }, { "cell_type": "heading", @@ -994,13 +978,16 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ + "cell_type": "code", + "collapsed": false, + "input": [ "# Header 1\n", "## Header 2\n", "### Header 3" - ] + ], + "language": "python", + "metadata": {}, + "outputs": [] }, { "cell_type": "markdown", @@ -1020,14 +1007,17 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ + "cell_type": "code", + "collapsed": false, + "input": [ "- A list\n", " - A sublist\n", " - Yet another level\n", " - And so on" - ] + ], + "language": "python", + "metadata": {}, + "outputs": [] }, { "cell_type": "markdown", @@ -1048,7 +1038,7 @@ ] }, { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ "<table border=\"1\" style=\"width:200px\">\n", @@ -1092,7 +1082,7 @@ ] }, { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ "\\begin{equation*} \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) \\end{equation*}\n" @@ -1105,6 +1095,80 @@ "\\begin{equation*} \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) \\end{equation*}\n" ] }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "\u00a7 Excercise : My next Notebook" + ] + }, + { + "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" + ] + }, + { + "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", + "metadata": {}, + "outputs": [], + "prompt_number": 8 + }, + { + "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": 9 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def reverse(s):\n", + " rev = s[::-1]\n", + " return rev" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + }, { "cell_type": "heading", "level": 1,