|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "attachments": {}, |
| 5 | + "cell_type": "markdown", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "# Tutorial 1: How to download a Tutorial from the NIH Sandbox\n", |
| 9 | + "--------------------------------------------" |
| 10 | + ] |
| 11 | + }, |
| 12 | + { |
| 13 | + "cell_type": "markdown", |
| 14 | + "metadata": {}, |
| 15 | + "source": [] |
| 16 | + }, |
| 17 | + { |
| 18 | + "cell_type": "markdown", |
| 19 | + "metadata": {}, |
| 20 | + "source": [ |
| 21 | + "## Overview\n", |
| 22 | + "Congratulations! You have decided to make use of the fantastic NIH tutorials that are stored in the NIGMS Sandbox at the site called Github.\n", |
| 23 | + "\n", |
| 24 | + "To use these resources, you need to understand a little about \"where\" these files are and how to save them in a way that will let you use them to learn about the technique. \n", |
| 25 | + "\n", |
| 26 | + "The intent of this tutorial is to make sure you have clear instructions (with pictures) that will work for the most novice user." |
| 27 | + ] |
| 28 | + }, |
| 29 | + { |
| 30 | + "cell_type": "markdown", |
| 31 | + "metadata": {}, |
| 32 | + "source": [ |
| 33 | + "## Learning Objectives\n", |
| 34 | + "+ Navigate the Github sandbox to find a tutorial\n", |
| 35 | + "+ Find & read the \"readme\" file\n", |
| 36 | + "+ Download a tutorial\n", |
| 37 | + "+ Have a preliminary understanding of Github" |
| 38 | + ] |
| 39 | + }, |
| 40 | + { |
| 41 | + "cell_type": "markdown", |
| 42 | + "metadata": {}, |
| 43 | + "source": [ |
| 44 | + "## Prerequisites\n", |
| 45 | + "- Knowledge of file saving & retrieving\n", |
| 46 | + "- An internet connection" |
| 47 | + ] |
| 48 | + }, |
| 49 | + { |
| 50 | + "cell_type": "markdown", |
| 51 | + "metadata": {}, |
| 52 | + "source": [ |
| 53 | + "## Get Started\n", |
| 54 | + "Make sure that you are connected to the internet\n", |
| 55 | + "\n", |
| 56 | + "-------------------------------------------------------------" |
| 57 | + ] |
| 58 | + }, |
| 59 | + { |
| 60 | + "cell_type": "markdown", |
| 61 | + "metadata": {}, |
| 62 | + "source": [ |
| 63 | + "# Step 1: Get to the NIGMS \"Sandbox\" & overview" |
| 64 | + ] |
| 65 | + }, |
| 66 | + { |
| 67 | + "cell_type": "markdown", |
| 68 | + "metadata": {}, |
| 69 | + "source": [ |
| 70 | + "## Background\n", |
| 71 | + "In technology and software development, a \"sandbox\" is a place to \"play,\" trying out new ideas or collaborating. \n", |
| 72 | + "\n", |
| 73 | + "The National Institute of General Medical Sciences (NIGMS) is one of the NIH Institutes. That institute sponsored the development of many short courses (modules) to help biomedical researchers learn some of the techniques that can take advantage of the powerful options of \"cloud computing.\"\n", |
| 74 | + "\n", |
| 75 | + "You are likely familiar with cloud data storage, for example with your files saved on OneDrive (Microsoft) or Google Drive (Google). Cloud *computing* takes that a step farther and carries out data processing and runs programs on computers that are located in some distant site. \n", |
| 76 | + "\n", |
| 77 | + "The advantage of \"cloud computing\" is that the computational speed and power is not limited by what you have in *your* desktop or laptop. Rather, cloud computers are very FAST computers with substantially more memory (to work on big biological data sets). Additionally, the providers of cloud computing can make more (or fewer) processors available to your job, depending on the need. " |
| 78 | + ] |
| 79 | + }, |
| 80 | + { |
| 81 | + "attachments": {}, |
| 82 | + "cell_type": "markdown", |
| 83 | + "metadata": {}, |
| 84 | + "source": [ |
| 85 | + "## What you see when you arrive at the \"Sandbox\"\n", |
| 86 | + "It is possible that you are reading this file having already navigated to the \"Sandbox.\" \n", |
| 87 | + "\n", |
| 88 | + "The [Sandbox](https://github.com/NIGMS/NIGMS-Sandbox) is housed at github.com. Github is a collaboration tool/website/repository that is being used by NIGMS as a great way to share materials.\n", |
| 89 | + "\n", |
| 90 | + "BUT, what you see when you get to github is NOT what a novice in cloud-computing-user might expect. It looks something like this picture below. It is certainly **overly complicated** for a novice because Github is not designed with novices in mind. Thus, EVERY Github site (or \"repository\" of materials) looks basically the same. It shows a lot of needed tools and a list of the folders in the repository. \n", |
| 91 | + "\n", |
| 92 | + "**The key point:** scroll down ON THAT PAGE to see the nice description and information you want about the repository. It is information in the \"readme\" file that is displayed for you. It is just very unfortunate that unless you know to scroll past the folder structure, you start with a mysterious interface.\n", |
| 93 | + "\n", |
| 94 | + "\n" |
| 95 | + ] |
| 96 | + }, |
| 97 | + { |
| 98 | + "cell_type": "markdown", |
| 99 | + "metadata": {}, |
| 100 | + "source": [ |
| 101 | + "# Step 2: Choose a course (module) to use\n", |
| 102 | + "If you have scrolled down on the Sandbox readme page, you have encountered the list of available courses (\"modules\") that you might want to use to learn a technique. \n", |
| 103 | + "\n", |
| 104 | + "Or, perhaps you are going to use more of this module (Introduction to Github and Python for Bioinformatics). \n", |
| 105 | + "\n", |
| 106 | + "You should click on the link to that module from the list. It will take you to another Github Repository. Of course, the interfaces will also start with the file structure as all Github repositories look the same. These Modules typically contain a Readme.md file that explains the structure & contents of the overall tutorial module. Inside of each Module are folders (\"Submodules\") that contain the lessons in the form of Jupyter Notebooks (next lesson in this list)\n", |
| 107 | + "\n", |
| 108 | + "<div class=\"alert alert-block alert-warning\"> <b>Attention:</b> Please go to that module in another tab on your browser before following the next set of directions</a>. </div>\n" |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "attachments": {}, |
| 113 | + "cell_type": "markdown", |
| 114 | + "metadata": {}, |
| 115 | + "source": [ |
| 116 | + "# Step 3: Two ways to make a copy of the Github Repository\n", |
| 117 | + "\n", |
| 118 | + "Unlike just reading a web page as you are doing now, the Sandbox tools are all constructed as special kinds of pages (\"Jupyter notebooks\") that combine text with interactive boxes where you will be able to write and use computer code to carry out bioinformatics functions.\n", |
| 119 | + "<br>\n", |
| 120 | + "So, in order to use the contents of any of the learning modules in the Sandbox, you need to copy them to a \"virtual machine\" (like moving to the hard drive of a computer running in GCP, Azure, or AWS). Github is quite prepared for this, in fact, it is one key purpose of the NIGMS using Github as a place for you to collect the materials.\n", |
| 121 | + "<br>\n", |
| 122 | + "There isn't a normal download button that you can see in a repository. At Github, most of the materials are code that developers want to download. Thus, you will click on the green code button to get the #option# to download or to copy.\n", |
| 123 | + "<br>\n", |
| 124 | + "\n", |
| 125 | + "<br>\n", |
| 126 | + "\n", |
| 127 | + "There are two main ways to clone (that is, make a copy) of this material. The most efficient way to accomplish this is to clone the whole collection directly from cloud storage to cloud storage. For large files, this makes the most sense. \n", |
| 128 | + "<br>\n", |
| 129 | + "The more familiar brute-force way is to download a copy of the repository to your computer's hard drive, then upload it again to the cloud. \n", |
| 130 | + "<br>\n", |
| 131 | + "Both options are described below.\n" |
| 132 | + ] |
| 133 | + }, |
| 134 | + { |
| 135 | + "cell_type": "markdown", |
| 136 | + "metadata": {}, |
| 137 | + "source": [ |
| 138 | + "## Elegant Version: Clone into a Virtual Machine\n", |
| 139 | + "\n", |
| 140 | + "This method requires that you already have a cloud computing instance (what a virtual computer is called) up and running. You can see how to get that started in [Microsoft Azure](Submodule_0_Tutorial_3_AzureML.ipynb )\n", |
| 141 | + "\n", |
| 142 | + "### Open a terminal\n", |
| 143 | + "In the Notebooks portion of the Workspace, you need to open up a command line terminal. \n", |
| 144 | + "<br>\n", |
| 145 | + "\n", |
| 146 | + "\n", |
| 147 | + "After you are in the terminal view, you'll need to turn on the computer instance with the `play` button on the top menu. \n", |
| 148 | + "<br>\n", |
| 149 | + "\n", |
| 150 | + "\n", |
| 151 | + "That button could be found in somewhat different places, depending on how collapsed the terminal window is. For example:\n", |
| 152 | + "<br>\n", |
| 153 | + "\n", |
| 154 | + "<br> \n", |
| 155 | + "It is the same `play` button. If you want to make the terminal bigger, click on the << button (yellow arrow).\n", |
| 156 | + "\n", |
| 157 | + "### Clone in the repository\n", |
| 158 | + "\n", |
| 159 | + "It is very easy to clone a public repository into the terminal with `git clone`. You need the web address for the Module:\n", |
| 160 | + "<br>\n", |
| 161 | + "\n", |
| 162 | + "<br>\n", |
| 163 | + "1. Click on the copy button next to the URL.\n", |
| 164 | + "2. Go to the Azure terminal\n", |
| 165 | + "3. type: git clone *then paste the url you copied*\n", |
| 166 | + "\n", |
| 167 | + "<br>\n", |
| 168 | + "The whole set of folders and proper file structure will instantly be in your notebook list.\n" |
| 169 | + ] |
| 170 | + }, |
| 171 | + { |
| 172 | + "cell_type": "markdown", |
| 173 | + "metadata": {}, |
| 174 | + "source": [ |
| 175 | + "\n", |
| 176 | + "\n", |
| 177 | + "## Familiar, inelegant version: Downloading the contents of the repository then uploading\n", |
| 178 | + "\n", |
| 179 | + "There isn't a normal download button that you can see in a repository. At Github, most of the materials are code that developers want to download. Thus, you will click on the green code button to get the #option# to download or to copy.\n", |
| 180 | + "<br>\n", |
| 181 | + "\n", |
| 182 | + "\n", |
| 183 | + "<br>\n", |
| 184 | + "The menu you will see has the more elegant options, and also the button to download a zipped version:\n", |
| 185 | + "<br>\n", |
| 186 | + "\n", |
| 187 | + "\n", |
| 188 | + "\n", |
| 189 | + "# \"Unzipping\" your folder\n", |
| 190 | + "\n", |
| 191 | + "The folder of materials does not download in a ready-to-use format. It is compressed (\"zipped\") so it needs to be extracted| into its full form before you upload it to use as a tutorial.\n", |
| 192 | + "\n", |
| 193 | + "**To unzip a file on Windows:**\n", |
| 194 | + "\n", |
| 195 | + "1. Locate the zip file (it's probably in \"downloads\" but you can look at this button near the top right of Chrome, for example, to see where it downloaded)\n", |
| 196 | + "2. Once you find the zipped folder, right-click on the zip file\n", |
| 197 | + "3. Select \"Extract All\": From the context menu, which should look something like this on the menu bar:\n", |
| 198 | + "<br>\n", |
| 199 | + "\n", |
| 200 | + "\n", |
| 201 | + "\n", |
| 202 | + "<br>\n", |
| 203 | + "4. Choose the destination folder where you want to extract the folder. (it is fine to extract them in the same folder the file is already)\n", |
| 204 | + "5. Click \"Extract\" to start the unzipping process. \n", |
| 205 | + "\n", |
| 206 | + "<br>\n", |
| 207 | + "\n", |
| 208 | + "**To unzip a file on a Mac:**\n", |
| 209 | + "\n", |
| 210 | + "<br>\n", |
| 211 | + "1. Double-click the zipped file\n", |
| 212 | + "2. The file will automatically decompress and a new folder will appear in the same location as the zipped file. \n", |
| 213 | + "<br>\n", |
| 214 | + "You should now be ready to upload those files to run the lessons in Azure. \n", |
| 215 | + "\n", |
| 216 | + "\n" |
| 217 | + ] |
| 218 | + }, |
| 219 | + { |
| 220 | + "cell_type": "markdown", |
| 221 | + "metadata": {}, |
| 222 | + "source": [ |
| 223 | + "# Conclusion\n", |
| 224 | + "If you have followed these steps, you should now have a copy of the lessons module on your local computer or already cloned into Azure. \n", |
| 225 | + "\n", |
| 226 | + "To learn how to use these lessons in a cloud computer at Amazon (AWS), [Google Cloud Computing (GCP)](https://github.com/STRIDES/NIHCloudLabGCP/blob/main/docs/vertexai.md), or Microsoft's Azure ([Azure ML](./Module_0_Tutorial_3_AzureML.ipynb)) you can use one of the linked tutorials. \n", |
| 227 | + "\n", |
| 228 | + "Or, if you want to learn more about how to use [Jupyter Notebooks](./Submodule_0_Tutorial_2_JupyterNotebooks.ipynb)\n", |
| 229 | + "\n", |
| 230 | + "For the \"Intro to Github and Python for Bioinformatics\" module, we provide information for those using [Azure](./Submodule_0_Tutorial_2_AzureML.ipynb) and have tested to make sure that all the materials work as expected on Azure. " |
| 231 | + ] |
| 232 | + }, |
| 233 | + { |
| 234 | + "cell_type": "markdown", |
| 235 | + "metadata": {}, |
| 236 | + "source": [ |
| 237 | + "## Clean up\n", |
| 238 | + "On most Jupyter notebooks in these modules you will see directions here to \"stop your compute instance\" (we'll explain later). But, since this is just a web page, you are done. \n", |
| 239 | + "\n", |
| 240 | + "Good work & we hope you enjoy learning these powerful techniques for bioinformatics!\n" |
| 241 | + ] |
| 242 | + } |
| 243 | + ], |
| 244 | + "metadata": { |
| 245 | + "kernelspec": { |
| 246 | + "display_name": "conda_python3", |
| 247 | + "language": "python", |
| 248 | + "name": "conda_python3" |
| 249 | + }, |
| 250 | + "language_info": { |
| 251 | + "codemirror_mode": { |
| 252 | + "name": "ipython", |
| 253 | + "version": 3 |
| 254 | + }, |
| 255 | + "file_extension": ".py", |
| 256 | + "mimetype": "text/x-python", |
| 257 | + "name": "python", |
| 258 | + "nbconvert_exporter": "python", |
| 259 | + "pygments_lexer": "ipython3", |
| 260 | + "version": "3.10.16" |
| 261 | + } |
| 262 | + }, |
| 263 | + "nbformat": 4, |
| 264 | + "nbformat_minor": 4 |
| 265 | +} |
0 commit comments