User Tools

Site Tools




  1. Choosing the right tools for your problem
  2. Finding help on the web
  3. Course Surveys
  4. Final Exam

1. Choosing the right tools for your problem

  • Become familiar with the commands in the unix cheat sheet.
  • Save the Notes and Exercises from this course. Practice regularly!

grep….search for patterns within a file and return lines containing the pattern.

$ grep "pattern" input_file >ouput_file (optional)

tr….deletes or replaces one set of characters in a file with another set of characters.

$ tr 'ACTG' 'TGAC' input_file >ouput_file (optional)

sed….for more complex substitutions than tr.

$ sed 's/"old_pattern"/"new_pattern"/g' input_file >ouput_file (optional)

awk….for complex text editing and processing.

$ awk 'pattern { action }' input_file >output_file (optional)

When needing to automate a task or chain together multiple commands, it may be useful to write a bash script.

2. Finding help on the web

Google your problem! Someone has likely already solved it. But be careful not to trust anything you find on the web without testing it and confirming its correctness.

Generally trustworthy sites:

3. Installing software

Download the software appropriate for your computer system.

Common repositories for bioinformatics software:

Getting software from the command line using package managers:

  • apt-get (Linux)
  • Homebrew (Mac)

Installing software manually:

  • Download software
  • Unpackage
  • See README file for compatibility and dependency information
  • See INSTALL file for installation instructions

Standard installation:

  • Step 1: Configure software for installation.
  • Step 2: Build the softare from the source code using the Makefile included in the distribution.
  • Step 3: Install the software on your machine and move the files to the correct locations.

Typically done using the following commands:

$ ./configure
$ make
$ make install

Making software accessible from any directory:

  • Add the absolute path to the program to PATH environment variable. The PATH environment variable tells your computer where to look for software - it's a colon-delimited list of directories that your shell searches when you type a command.
  • To see what's in your PATH variable in unix, type echo $PATH.


$ mkdir $HOME/bin

Add the directory to your PATH environment variable:

$ export PATH=$HOME/bin:$PATH

On a Mac, to permanently add a path, you need to edit, or create ~/.bash_profile, the terminal startup configuration file that loads all your preferences. Multiple ways to edit it.

* Mac users must install xcode tools:

$ xcode-select –install
wiki/2016final.txt · Last modified: 2017/09/14 09:51 by tai