First Time: Tools Setup
There are two routes you can take to complete assignments in this class:
- Connect to the “virtual computing lab” (VCL) we’ve set up on BioHPC, a high-performance computing cluster on campus.
- Work on your local computer (laptop and/or desktop).
Why might you choose either route?
- The local route is much more convenient (all of the files and programs are on your local computer), but might require you to install a bunch of programs (git, Julia, and an editor of some kind [we recommend VS Code]) and possibly use the terminal. This will take a little more time up front, and in our experience some students are more comfortable doing this than others. Some computers are also a little more finicky to install new software on than others, depending on how they’re configured.
- The VCL route requires no setup on your part (other than going through the BioHPC onboarding and setting up your login), but you can only do work when connected to the Internet.1
1 In particular, BioHPC requires that you are connected to the Cornell network or using the Cornell VPN.
In either case, please make sure you can setup or access the appropriate tools using the relevant workflows below. In either case, you’ll need to set up a GitHub account.
Setting Up GitHub Account
If you already have a GitHub account, you can use that for this course and do not need to create a new account.
Create a GitHub account. It doesn’t have to be linked to your Cornell email or use your Cornell NetID.
For labs and homework assignments (we will work on Lab 1 in class and Homework 1 is available), you should use the GitHub Classroom link to “accept” the assignment provided on Ed Discussion, which will give you your own GitHub repository for that assignment. The first time you click one of these links, you will need to link your place on the course roster with your GitHub account.
Connecting to the Virtual Computing Lab
To use this option, you must either be connected to the Cornell network or use the Cornell VPN when connecting to BioHPC.
Set Up BioHPC Account and Connect
First, set up your BioHPC password; if you did not receive an email about an account being created and would like to use this option, let Vivek know.
After setting up your password, you can use https://biohpc.cornell.edu/lab/CALS_BEE4750.aspx to log in and access Jupyter Lab. You may need to copy the token (the numbers on the displayed url after ...token=
) and paste that into the subsequent form.
Using BioHPC and Jupyter Lab
Once the connection starts, it should put you on a terminal. You can then clone repositories with git clone <repository url>
and open the notebooks and files (Julia 1.10.4 is already installed by default). Note that the first time you run a notebook’s first cell, it might take a while to install the relevant packages.
The version of Jupyter Lab installed on your account has a git interface, so if you would prefer to not use the command line to interact with git, you can clone, push, and pull using the Git
menu.
If you want to work with a standalone script (to write up your answers separately), rather than the notebook, you can create a new Julia script with a *.jl
extension within the Jupyter Lab interface.
Exporting Notebook to PDF
We’re working on figuring out why there are some errors in direct exporting to PDF, but you can export a notebook to HTML with File -> Save and Export Notebook As -> HTML
, open the saved HTML file in your browser, and save page as a PDF. Make sure that you run all of the cells in your notebook in order before doing this!
Working On Your Local Machine
Getting set up for this course requires the following steps, if you haven’t done them for a previous course, club, or project:
- Install
git
on your machine if necessary. - Install Julia using the
juliaup
tool. - Install and set up VS Code if you don’t already have an editor you’d like to use. VS Code is an editor of choice for Julia, as it as a rich and well-supported Julia extension. If you have a different coding environment, please find instructions for how to set it up to edit Julia.
Install Git
If you have already installed git
, you don’t need to worry about this section. If you haven’t, download the appropriate version for your operating system.
If you have a Mac, be aware if you have an Apple Silicon (M1 or M2) Mac or an Intel Mac. Many of the installations you will go through in this exercise have different versions for each processor type, and the program may not work properly if you still the wrong version. There’s nothing that can’t be undone, but it’s easier to be install the correct version first!
Install Julia
I recommend installing Julia using the juliaup
tool, which will let you easily manage versions in the future and works seamlessly with VS Code. The instructions can be found at the JuliaUp GitHub repository, but we will summarize them here.
Installing Juliaup on Windows
If your computer uses Windows, you can install Juliaup from the Windows Store.
Installing Juliaup on MacOS
If you have a Mac, open a terminal (such as the Terminal app) and enter:
curl -fsSL https://install.julialang.org | sh
Installing Julia 1.10.4
Once you install Juliaup, install Julia version 1.10.4 by opening a terminal (in MacOS or Linux) or the command line (in Windows) and entering:
juliaup add 1.10.4
juliaup default 1.10.4
This will install Julia 1.10.4 and make it the default version, which should maximize package compatibility throughout this course. Going forward, if you want to add new versions or change the default, you can follow the Juliaup instructions.
Install and Set Up VS Code
You can skip this section if you already have a coding environment you like; just set it up to work with Julia. Otherwise, VS Code is as close to an officially supported editor for Julia as you can get. We will follow this guide for setting up VS Code with Julia.
Installing VS Code
You can download it here; open the downloaded file to install.
Install the Julia Extension
Open VS Code.
Select View and click Extensions to open the Extension View. This view can also be found on the sidebar with the following logo:
Search for
julia
in the search box. Click the green install button.Restart VS Code once the installation is complete. It should automatically find your Julia installation; talk to Vivek if not.
The Julia VS Code extension offers you some nice features. You can start a REPL (an interactive Julia coding environment) by opening the “Command Palette” (View -> Command Palette, or CTRL/CMD+SHIFT+P) and typing “REPL” to bring up “Julia: Start REPL”. You can also create *.jl
files to write Julia code and execute line by line. However, we will primarily use Jupyter notebooks in this class, but this might be useful for testing code or for your project.
Install the Jupyter Notebook Extension
The Jupyter Notebook extension allows you to export a Jupyter notebook to PDF or to HTML and then to PDF.
You will need to export every notebook to a PDF for submission to Gradescope. Direct export to PDF requires a LaTeX installation. If you would like to go this route, please look at the LaTeX installation instructions for your operating system.
Otherwise, exporting to HTML and then using your browser to save the resulting page to a PDF is a perfect solution.
Follow the same instructions as above, but search for jupyter
and install the Jupyter extension. Restart VS Code.
Using GitHub with VS Code
This Youtube video provides an overview of how to use GitHub within VS Code (with chapters for specific steps) and may be worth watching.