Lab 1: Introduction to the Unix command line



Find the program on your desktop called "Secure Shell Client". Log into the CGRB server: crick.cgrb.oregonstate.edu

Within your home directory, create a directory called "Scripts":

	$ mkdir Scripts
      

This directory will be used to keep the scripts that you write and download in this course. Next, let's create a simple python script example. First, let's open emacs to create a file:

	$ emacs Scripts/helloworld.py
      

Next, we'll type into the file the following command:

	print "Hello, world!"
      

To save the file, let's simply type Control-X, Control-S. Then to close emacs, type Control-X, Control-C. Once you've successfully saved and closed the file, we can run it with the following command:

	$ python Scripts/helloworld.py
      

If you haven't programmed anything before, this is your first program!

Now let's download a script file, and a fasta file. You can do this with the command wget, which can be run on the command line to directly download any file from the web:

	$ wget http://hendrixlab.cgrb.oregonstate.edu/teaching/readFastaFile.py
	$ wget http://hendrixlab.cgrb.oregonstate.edu/teaching/sequences.fasta
      

Try printing the contents of the fasta file to the screen:

	$ cat sequences.fasta
      

Move this file into your scripts directory. You can do this with the command "mv readFastaFile.py Scripts/.". You can run this script by simply typing the following:

	$ python Scripts/readFastaFile.py sequences.fasta
      

What is the output? Now let's go over each line of this script as a class.

Now modify the script to print out a new fasta file containing the reverse complement of each of the input sequences.