Skip to content

Using Python through Command Line on Biowulf

Copy Example Data to User's Biowulf Data Directory

This class will use Jupyter Lab installed on Biowulf for interactions with Python. To get started, open a Terminal (if working on a Mac) or a Command Prompt (if working on Windows) and sign into the user's Biowulf accounts.

In the ssh command construct below, be sure to replace user with the participant's own Biowulf login ID.

ssh user@biowulf.nih.gov

Next, change into the participant's Biowulf data directory. Remember to replace user with the participant's own Biowulf login ID.

cd /data/user

Then, copy the pies_data directory in /data/classes/BTEP on Biowulf to the pies_class_2025.

cp -r /data/classes/BTEP/pies_data .

Finally, change into pies_data.

cd pies_data

Starting Jupyter Lab

Step 1 to starting Jupyter Lab on Biowulf via command is to request an interactive compute session using sinteractive with the following options. The local temporary/scratch storage space and RAM allocation can be modified base on user needs.

  • --gres=lscratch:5: to allocate 5gb of local temporary/scratch storage space
  • --mem=2gb: to request 2gb of memory or RAM
  • --tunnel: to open up a channel of communication between local machine and Biowulf to allow interaction with applications like Jupyter Lab
sinteractive --gres=lscratch:5 --mem=2gb --tunnel

Figure 1: After interactive session resources have been allocated, users will see a ssh command that looks like that enclosed in the red rectangle in the figure below. Open a new terminal (if working on a Mac) or command prompt (if working on a Windows computer) and then copy and paste this ssh command into the new terminal.

Figure 2: Hit enter after copying and pasting the ssh command to a new terminal to provide password and log into Biowulf. This will complete the tunnel.

Figure 3: In the ssh command shown in Figure 1 and Figure 2, the numbers preceding and following "localhost" will differ depending on user. Also, the Biowulf username will differ for each user (wuz8 is the instructor's Biowulf username).

Figure 4: Go back to the terminal (Mac) or command prompt (Windows) with the interactive session (look for cn#### at the prompt). Do module load jupyter from here.

Figure 5: Start a Jupyter lab session using jupyter lab --ip localhost --port $PORT1 --no-browser and copy and paste either one of the http links to a local browser.