|
11 | 11 | "<small><small><i>\n",
|
12 | 12 | "\n",
|
13 | 13 | "## Attribution\n",
|
14 |
| - "This is an adaptation of the Introduction to Python for Maths by [Andreas Ernst](http://users.monash.edu.au/~andreas), available from https://gitlab.erc.monash.edu.au/andrease/Python4Maths.git. The original version was written by Rajath Kumar and is available at https://github.com/rajathkumarmp/Python-Lectures.\n", |
| 14 | + "These tutorials are an adaptation of the Introduction to Python for Maths by [Andreas Ernst](http://users.monash.edu.au/~andreas), available from https://gitlab.erc.monash.edu.au/andrease/Python4Maths.git. The original version was written by Rajath Kumar and is available at https://github.com/rajathkumarmp/Python-Lectures.\n", |
15 | 15 | "\n",
|
16 |
| - "These notes have been greatly amended and updated for the EANBiT Introduction to Python for Bioinformatics by [Caleb Kibet](https://twitter.com/calkibet). \n", |
| 16 | + "These notes have been greatly amended and updated for the EANBiT Introduction to Python for Bioinformatics course facilitated [Caleb Kibet](https://twitter.com/calkibet), Audrey Mbogho and Anthony Etuk. \n", |
17 | 17 | "</small></small></i>\n",
|
18 | 18 | "\n",
|
19 | 19 | "# Quick Introduction to Jupyter Notebooks\n",
|
|
30 | 30 | "* Images\n",
|
31 | 31 | "* Video\n",
|
32 | 32 | "\n",
|
33 |
| - "It is good to note that \"Jupyter\" is a loose acronym meaning Julia, Python, and R; the initial languages supported by Jupyter. \n", |
| 33 | + "It is good to note that \"Jupyter\" is a loose acronym meaning Julia, Python, and R; the primary languages supported by Jupyter. \n", |
34 | 34 | "\n",
|
35 |
| - "The notebook can allow a computational researcher to create a reproducible documentation of their research. As Bioinformatics is datacentric, use of Jupyter Notebooks increases research transparency, hence promoting open science. \n", |
| 35 | + "The notebook can allow a computational researcher to create reproducible documentation of their research. As Bioinformatics is datacentric, use of Jupyter Notebooks increases research transparency, hence promoting open science. \n", |
36 | 36 | "\n",
|
37 | 37 | "## First Steps\n",
|
38 | 38 | "\n",
|
39 | 39 | "### Installation\n",
|
40 | 40 | "\n",
|
41 |
| - "1. [Download Anaconda](https://www.anaconda.com/download/) for your specific OS to your home directory\n", |
42 |
| - " - Linux: `wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh`\n", |
43 |
| - " - Mac: `curl https://repo.anaconda.com/archive/Anaconda3-5.2.0-MacOSX-x86_64.sh`\n", |
| 41 | + "1. [Download Miniconda](https://www.anaconda.com/download/) for your specific OS to your home directory\n", |
| 42 | + " - Linux: `wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh`\n", |
| 43 | + " - Mac: `curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh`\n", |
44 | 44 | "2. Run:\n",
|
45 |
| - " - `bash Anaconda3-5.2.0-Linux-x86_64.sh`\n", |
46 |
| - " - `bash Anaconda3-5.2.0-MacOSX-x86_64.sh`\n", |
| 45 | + " - `bash Miniconda3-latest-Linux-x86_64.sh`\n", |
| 46 | + " - `bash Miniconda3-latest-MacOSX-x86_64.sh`\n", |
47 | 47 | "3. Follow all the prompts: if unsure, accept defaults\n",
|
48 | 48 | "4. Close and re-open your terminal\n",
|
49 |
| - "5. If installation is successful, you should see a list of installed packages with\n", |
| 49 | + "5. If the installation is successful, you should see a list of installed packages with\n", |
50 | 50 | " - `conda list`\n",
|
51 |
| - "If the command cannot be found, you can add Anaconda bin to path using:\n", |
| 51 | + "If the command cannot be found, you can add Anaconda bin to the path using:\n", |
52 | 52 | " ` export PATH=~/anaconda3/bin:$PATH`\n",
|
53 | 53 | "\n",
|
54 | 54 | "For reproducible analysis, you can [create a conda environment](https://conda.io/docs/user-guide/tasks/manage-environments.html) with all the Python packages you used.\n",
|
55 | 55 | "\n",
|
56 |
| - " `conda create --name my-env python jupyter`\n", |
| 56 | + " `conda create --name bioinf python jupyter`\n", |
57 | 57 | " \n",
|
58 | 58 | "To activate the conda environment:\n",
|
59 |
| - " `source activate myenv`\n", |
| 59 | + " `source activate bioinf`\n", |
60 | 60 | "\n",
|
61 | 61 | "Having set-up conda environment, you can install any package you need using pip. \n",
|
62 | 62 | "\n",
|
|
67 | 67 | "\n",
|
68 | 68 | "`pip3 install jupyter`\n",
|
69 | 69 | "\n",
|
70 |
| - "Then you can easily launch it using:\n", |
| 70 | + "Then you can quickly launch it using:\n", |
71 | 71 | "\n",
|
72 | 72 | "`jupyter notebook` or `jupyter lab`\n",
|
73 | 73 | "\n",
|
74 |
| - "NB: We will use jupyter lab in the training. \n", |
| 74 | + "NB: We will use a jupyter lab for training. \n", |
75 | 75 | "\n",
|
76 | 76 | "\n",
|
77 |
| - "A Jupyter notebook is made up of a number of cells. Each cell can contain Python code. You can execute a cell by clicking on it and pressing `Shift-Enter` or `Ctrl-Enter` (execute without moving to the next line). \n", |
| 77 | + "A Jupyter notebook is made up of many cells. Each cell can contain Python code. You can execute a cell by clicking on it and pressing `Shift-Enter` or `Ctrl-Enter` (run without moving to the next line). \n", |
| 78 | + "\n", |
| 79 | + "### Login into the web server\n", |
| 80 | + "\n", |
| 81 | + "The easiest way to run this and other notebooks for the EANBiT course participants is to log into the Jupyter server (Unfortunately, this is not currently working). The steps for running notebooks are:\n", |
| 82 | + "* Log in using the username and password assigned to you. The first time you log in an empty account will automatically be set up for you.\n", |
| 83 | + "* Press the start button (if prompted by the system)\n", |
| 84 | + "* Use the menu of the jupyter system to upload a .ipynb python notebook file or to start a new notebook.\n", |
78 | 85 | "\n",
|
79 | 86 | "### Further help\n",
|
80 | 87 | "\n",
|
|
86 | 93 | "\n",
|
87 | 94 | "## Introduction\n",
|
88 | 95 | "\n",
|
89 |
| - "Python is a modern, robust, high-level programming language. It is very easy to pick up even if you are completely new to programming. \n", |
| 96 | + "Python is a modern, robust, high-level programming language. It is straightforward to pick up even if you are entirely new to programming. \n", |
90 | 97 | "\n",
|
91 |
| - "Python, similar to other languages like Matlab or R, is interpreted hence runs slowly compared to C++, Fortran or Java. However, writing programs in Python is very quick. Python has a very large collection of libraries for everything from scientific computing to web services. It caters for object-oriented and functional programming with a module system that allows large and complex applications to be developed in Python. \n", |
| 98 | + "Python, similar to other languages like Matlab or R, is interpreted hence runs slowly compared to C++, Fortran or Java. However, writing programs in Python is very quick. Python has an extensive collection of libraries for everything from scientific computing to web services. It caters for object-oriented and functional programming with a module system that allows large and complex applications to be developed in Python. \n", |
92 | 99 | "\n",
|
93 | 100 | "These lectures are using Jupyter notebooks which mix Python code with documentation. The python notebooks can be run on a web server or stand-alone on a computer.\n",
|
94 | 101 | "\n",
|
|
99 | 106 | "### Session 1\n",
|
100 | 107 | "* [00](Intro-to-Python/00.ipynb) This introduction with additional information below on how to get started in running python\n",
|
101 | 108 | "* [01](Intro-to-Python/01.ipynb) Basic data types and operations (numbers, strings) \n",
|
| 109 | + "\n", |
102 | 110 | "### Session 2\n",
|
103 | 111 | "* [02](Intro-to-Python/02.ipynb) String manipulation \n",
|
104 | 112 | "* [03](Intro-to-Python/03.ipynb) Data structures: Lists and Tuples\n",
|
|
111 | 119 | "* [08](Intro-to-Python/08.ipynb) Data Analysis and plotting with Pandas\n",
|
112 | 120 | "* [09](Intro-to-Python/09.ipynb) Reproducible Bioinformatics Research\n",
|
113 | 121 | "\n",
|
114 |
| - "This is a tutorial style introduction to Python. For a quick reminder/summary of Python syntax, the following [Quick Reference Card](http://www.cs.put.poznan.pl/csobaniec/software/python/py-qrc.html) may be useful. A longer and more detailed tutorial style introduction to python is available from the python site at: https://docs.python.org/3/tutorial/\n", |
115 |
| - "\n", |
| 122 | + "This is a tutorial style introduction to Python. For a quick reminder/summary of Python syntax, the following [Quick Reference Card](http://www.cs.put.poznan.pl/csobaniec/software/python/py-qrc.html) may be useful. A longer and more detailed tutorial style introduction to python is available from the python site at: https://docs.python.org/3/tutorial/.\n", |
116 | 123 | "\n",
|
117 |
| - "## Installation\n", |
118 |
| - "\n", |
119 |
| - "### Login into the web server\n", |
120 |
| - "The easiest way to run this and other notebooks for the EANBiT course participants is to log into the Jupyter server. The steps for running notebooks are:\n", |
121 |
| - "* Log in using the username and password assigned to you. The first time you log in an empty account will automatically be set up for you.\n", |
122 |
| - "* Press the start button (if prompted by the system)\n", |
123 |
| - "* Use the menu of the jupyter system to upload a .ipynb python notebook file or to start a new notebook.\n", |
124 |
| - "\n", |
125 |
| - "### Installing \n", |
126 |
| - "\n", |
127 |
| - "Python runs on Windows, Linux, Mac and other environments. There are many python distributions available. However, the recommended way to install python under Microsoft Windows or Linux is to use the Anaconda distribution available at [https://www.continuum.io/downloads]. Make sure to get the Python *3.5* version, not 2.7. This distribution comes with the [SciPy](https://www.scipy.org/) collection of scientific python tools as well as the iron python notebook.\n", |
128 | 124 | "\n",
|
129 | 125 | "## How to learn from this resource?\n",
|
130 | 126 | "\n",
|
131 |
| - "Download all the notebooks from [https://github.com/kipkurui/Python4Bioinformatics]. For the EANBiT course, we have initialized you Jupyter lab session with all the required resources. (Confirm this has been set up before the course)\n", |
| 127 | + "Download all the notebooks from [Python4Bioinformatics](https://github.com/kipkurui/Python4Bioinformatics). The easiest way to do that is to clone the GitHub repository to your working directory using any of the following commands:\n", |
132 | 128 | "\n",
|
133 |
| - "In case they are not provided, you can simply clone the GitHub repository to you jupyter lab session using the following command:\n", |
| 129 | + " git clone https://github.com/kipkurui/Python4Bioinformatics.git\n", |
134 | 130 | "\n",
|
135 |
| - "clone https://github.com/kipkurui/Python4Bioinformatics.git\n", |
| 131 | + "or\n", |
136 | 132 | "\n",
|
137 |
| - "Cell > All Output > Clear\n", |
138 |
| - "\n", |
139 |
| - "This will clear all the outputs and now you can understand each statement and learn interactively.\n", |
| 133 | + " wget https://github.com/kipkurui/Python4Bioinformatics/archive/master.zip\n", |
| 134 | + " \n", |
| 135 | + " unzip master.zip\n", |
| 136 | + " \n", |
| 137 | + " rm master.zip\n", |
| 138 | + " \n", |
140 | 139 | "\n",
|
141 | 140 | "## How to Contribute\n",
|
142 | 141 | "\n",
|
|
145 | 144 | "Alternatively, you can open an issue. \n",
|
146 | 145 | "\n",
|
147 | 146 | "## License\n",
|
148 |
| - "This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/\n" |
| 147 | + "This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/.\n" |
149 | 148 | ]
|
150 | 149 | },
|
151 | 150 | {
|
|
0 commit comments