Skip to content

TACC Instructions

Neal W Morton edited this page Jan 31, 2022 · 10 revisions

Accessing Lonestar

The tutorial (and the instructions below) assume that you have access to Lonestar 6 and that you will be installing things there. If you don't have an account yet, first go to the TACC user portal and click Create a TACC Account. Once you have an account, email Neal Morton with your TACC username to request access. If you are a research assistant, please also CC the person you are working with in the lab on the email.

Before accessing Lonestar, read the Lonestar 6 User Guide to learn about how to properly use TACC resources.

You will also need to add two factor authentication to your TACC account by installing the TACC Token app either for iOS or Android or by using a different MFA application. See more information about this process here.

Editing files on Lonestar

There are a few options for creating and editing files, like scripts, on Lonestar.

  • The simplest method is to open an ssh connection and edit files from there. In an ssh session, use a text editor like nano or emacs:
ssh [username]@ls6.tacc.utexas.edu
nano myfile.txt
  • Access Lonestar using a program like Fetch, and launch a text editor from there.

  • More experimentally, you can also use SSHFS with OSX FUSE, which mounts a remote drive on your computer so it's similar to accessing an external drive (i.e., the remote drive will appear in the Finder, etc., and files can be modified with any program). To use it download and run the FUSE installer from FUSE for MacOS. Then, to mount lonestar so that files on your home directory are available on your local machine at ~/lonestar, in the Terminal on your local computer:

mkdir ~/lonestar
sshfs [username]@ls6.tacc.utexas.edu: ~/lonestar

Setting up Your Environment

Installing fprep and its dependencies mainly involves setting up a startup script properly. Commands can be placed in Lonestar in $HOME/.bashrc (it must be exactly that path) so they will be executed every time you ssh in. Note that files that start with "." are often hidden by default. For example, using the ls command, you need to specify ls -a to show "hidden" files like .bashrc.

Loading Modules

For fprep to function properly, there are some modules that must be loaded on login. Once you begin editing your .bashrc file in your $HOME directory (with nano ~/.bashrc, for example), you should see the module loading section (you should see comments already in your .bashrc file telling you where to place different commands), add these commands:

module use /work/03206/mortonne/software/modules # makes lab-wide software available
module load fsl/5.0.11  # main fMRI analysis package
module load fslview/5.0.9  # MR image viewer
module load ants/2.1.0  # used for registration and template generation
module load matlab
module load freesurfer/6.0.0 
module load fprepcore  # core modules and scripts maintained in fprep
module load python/3.9.7  # language used by many scripts

Close the ssh connection by typing exit or pressing control-D, and ssh into Lonestar again. As part of signing in, the commands in the .bashrc file will be loaded. Check the installation of some of the packages:

which fsl
which antsRegistration

Each of these commands should show the path to that program. If you instead get a message saying that the program was not found, there is a problem with the installation. Type module list to see which modules are currently loaded and troubleshoot from there.

Setting up your Python Environment

To make use of fprep commands, you need to set up a Python virtual environment. This only needs to be done once and can easily be accessed in all later sessions.

Note: By default, ls6 uses Python 3.9 and has no other loadable versions of python. This is fine for the purpose of this tutorial, but should you need to run anything in Python 2, this can be accomplished by prefacing your script with python2 [your_script.py].

Begin by heading over to your $WORK directory on ls6 and execute the following commands.

python3 -m venv $WORK/fprep  # create environment directory
. $WORK/fprep/bin/activate  # activate the environment
pip install git+https://github.com/prestonlab/fprep.git
pip install ezlaunch  # utilities for submitting jobs

This will both create the python virtual environment (called fprep) and activate it for your current session. You will notice that a (fprep) will appear at the beginning of your command prompt.

In later sessions (e.g., if you log out and log back in), you just need to run . $WORK/fprep/bin/activate to activate the environment. If you want, you can add that command to your $HOME/.bashrc file to execute automatically on login.

From here, you can test that eveything is working as intended. Each which command below should display the path to the installed program.

which dcm2nii
which c3d_affine_tool
which prep_bold_run.sh
which fmriqa.py

Once this is all working, continue on with the tutorial.

Running the .bashrc

When you log in, the code in the .bashrc file is sourced; this does the same thing as if you directly entered the lines yourself. Note, however, that the .bashrc template on Lonestar 6 is designed to only run most code once per ssh session (this is done to avoid code re-running when you submit a job to run on the cluster).

In order for changes to the .bashrc to take effect, you can either log out any existing ssh sessions on Lonestar and ssh back in, or just copy and paste the lines you want to run directly into the terminal on an existing ssh session.