# NSCI 580A4 fall 2017

NSCI 580A4

Instructors
Tai Montgomery
Erin Nishimura

wiki:2016final

## CONCLUSIONS AND FUTURE DIRECTIONS

### OUTLINE

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

Common repositories for bioinformatics software:

Getting software from the command line using package managers:

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

Installing software manually:

• 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.

Example:

$mkdir$HOME/bin

$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