User Tools

Site Tools


assignments:ex2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
assignments:ex2 [2018/08/30 10:43]
dokuroot
assignments:ex2 [2018/08/30 10:46] (current)
dokuroot
Line 1: Line 1:
 ~~NOTOC~~ ​ ~~NOTOC~~ ​
-====== Exercise ​======+====== Exercise ​======
  
 ---- ----
-===== Sequence Alignments ​=====+===== UNIX and Command Line Tools =====
  
-In this exercise, we will examine the DNA sequencing data from your saliva sample using common, mostly web-based bioinformatics tools.+==== Part 1 ====
  
-====★ Independent Exercise 4 ====+In this exercise, we will attemp to demystify the computer terminal and introduce some common command line tools.
  
-**1.** Open and inspect your sequence trace with **4Peaks**. \\ \\ +**Useful UNIX commands for the exercises below **(see unix_commands.pdf for a more complete list)**:** 
-**2.** From the **links** page of the course websiteselect ​the **Pairwise sequence alignments** link\\ \\ +  
-**3.** ​Select ​the **Needle** or **Water** at the **EMBL** website\\ \\ +  ​To change directories use ''​cd''​. 
-**4.** Using **Needle** or **Water**, align your sequence to the reference sequence – are there any mismatches? \\ \\ + 
-**5.** From the **links** page of the course website, select ​the **TCoffee** link and align your sequence ​to the reference sequence – were you able to spot the same mismatches? \\ \\ +  ​To determine current working directory use ''​pwd''​
-**6.** What would happen if the allele was heterozygous? ​ How can you check? Check each SNP to determine if it's heterozygous. \\ \\ + 
-**7.** From the **links** page of the course websiteselect ​the **BLAST** link and blast your sequence ​against ​the human genome\\ \\ +  ​To list the contents of a directory use ''​ls''​. 
-**8.** Does your allele match the **BLAST** reference genome ​sequence? ​\\ \\ + 
-**9.** ​ What gene was sequenced? ​\\ \\ +  ​To create a new directory use ''​mkdir''​. 
-**10.**  ​Do google search ​and identify ​the function ​of the gene and what trait it's associated with\\ \\ + 
-**11.**  ​Using **BLAST**, find the closest homolog ​of the gene your sequence matches in mouse\\ \\ +  ​To create a new file use ''​touch''​. 
-**12.** Answer ​the following ​questions and submit your answers on Canvas+ 
-  What is the identity ​of the gene? \\ \\ +  ​To insert text into a file use ''​echo''​. 
-  What trait is the gene linked to? \\ \\+ 
 +  * To display ​the contents of a file in the terminal use ''​less''​ or ''​more''​. 
 + 
 +  ​To open a file from the command line use ''​open''​. To specify a program use the ''​-a''​ option. 
 + 
 +  ​To delete a file use ''​rm''​. To delete a directory use the ''​-r''​ option. 
 + 
 +  ​To print output from a command to a new file use ''>​file_name''​. 
 + 
 +  ​To append output from a command to an existing file use ''​%%>>​%%file_name''​. 
 + 
 +  * To go to the beginning ​of a line in the shelluse ''​ctrl+a''​. 
 + 
 +  * To go to the end of a line in the shell, use ''​ctrl+e''​. 
 + 
 +  ​To delete text preceeding cursor in the shell, use ''​ctrl+u''​. 
 + 
 +  ​To scroll back or forth in the command history use the ''​up''​ and ''​down''​ ''​arrow''​ keys. 
 + 
 +  ​To autofill text, use ''​tab''​. ​ This is highly recommended in order to minimize typos. 
 + 
 + 
 + 
 +====★ Interactive Exercise ==== 
 + 
 +**1.** Open a shell or terminal window. 
 + 
 +**2.** Print the phrase ''​Hello,​ world!''​ to the terminal window: 
 + 
 +  $ echo Hello, world! 
 + 
 +**3.** ​Change into the bz360 directory using ''​cd'':​ 
 + 
 +  $ cd /​Users/​bz360/​ 
 + 
 +**4.** Confirm that you are in the bz360 directory using ''​pwd'':​ 
 + 
 +  $ pwd 
 + 
 +**5.** List the contents of the unix directory using ''​ls'':​ 
 + 
 +  $ ls 
 + 
 +**6.** Open the unix directory using Finder and compare between the shell list of contents and the GUI list of contents. 
 + 
 +**7.** Create a new directory named ''​unix_temp''​ using ''​mkdir'':​ 
 + 
 +  $ mkdir unix_temp 
 + 
 + 
 +**8.** Change into the unix_temp directory using ''​cd'':​ 
 + 
 +  $ cd unix_temp 
 + 
 +**9.** List the contents of the unix_temp directory using ''​ls'':​ 
 + 
 +  $ ls 
 + 
 +**10.** Create a new file named ''​birthday.txt''​ using ''​touch'':​ 
 + 
 +  $ touch birthday.txt 
 + 
 +**11.** Examine the contents ​of the ''​unix_temp''​ directory using both ''​ls''​ and the Finder GUI to confirm that the new file exists: 
 + 
 +  $ ls 
 + 
 +**12.** Add your name to the file using ''​echo'':​ 
 + 
 +  $ echo name >>​birthday.txt 
 + 
 +**13.** Add your birthday to the file using ''​echo'':​ 
 + 
 +  $ echo birthday: birthday >>​birthday.txt 
 + 
 +**14.** Add the day of the week you were born using ''​echo''​ (if you don’t know what day you were born, use the cal command ​to find out:  cal month year): 
 + 
 +  $ echo born on: day >>​birthday.txt 
 + 
 +**15.** Add ​the day of the week your birthday falls on this year using ''​echo'':​ 
 + 
 +  $ echo Birthday in 2018: day >>​birthday.txt 
 + 
 +**16.** Display ​the contents of the file in the terminal using ''​more''​ or ''​less'':​ 
 + 
 +  $ more birthday.txt 
 + 
 +**17.** Open the file from the command line in the default program using ''​open'':​ 
 + 
 +  $ open birthday.txt 
 + 
 +**18.** Open the file in TextWrangler from the command line using ''​open'':​ 
 + 
 +  $ open birthday.txt -a TextWrangler 
 + 
 +**19.** Delete the file using ''​rm'':​ 
 + 
 +  $ rm birthday.txt  
 + 
 +**20.** Confirm that the file was deleted using ''​ls''​. 
 +\\ 
 +\\ 
 + 
 +====★ Independent Exercise 2A ==== 
 + 
 +During the exercise, practice using ''​ctrl+a''​ to go the beginning of a line, ''​ctrl+e''​ to go the end of a line, and ''​ctrl+u''​ to delete text. Examine the contents of the directory you make from both the command line and the Finder GUI.  
 + 
 +**1.** Create a new directory named ''​dna''​ within ​the ''​unix_temp''​ directory. 
 + 
 +**2.** From the command linecreate a new file named ''​dna.txt''​ within ​the ''​unix_temp''​ directory. 
 + 
 +**3.** From the command line, insert a 12-nt DNA sequence ​in the 5’-3’ direction into the file. 
 + 
 +**4.** From the command line, insert 12 pipes (i.e. '​||||||||||||'​ – be sure to include quotes around the pipes because pipes have a special meaning from the command line) into the dna.txt file. 
 + 
 +**5.** From the command line, add the reverse complement of the original DNA sequence ​in the 3’-5’ direction to the file. 
 + 
 +**6.** Display the contents of the sequence in the terminal. 
 + 
 +**7.** Open the file in TextWrangler from the command line. 
 + 
 +**8.** Are the sequences properly basepaired? 
 + 
 +**9.** From the command line, delete the file and the dna directory. 
 + 
 +**10.** Confirm that the directory and file were deleted. 
 +\\ 
 +\\ 
 +==== Part 2 ==== 
 + 
 +In this exercise, we'll introduce some basic text editing tools. 
 + 
 +**Useful UNIX commands for the exercises below **(see unix_commands.pdf for a more complete list)**:** 
 +  
 +  * To reverse ​string use ''​rev''​. 
 + 
 +  * To make single character substitutions use ''​tr''​. 
 + 
 +  * To pass one command to another use a pipe ''​|''​. 
 + 
 +  * To pass text to a command on the command line use ''​echo''​. 
 + 
 +  * To determine the number of characters, words, ​and lines in a document or string, use ''​wc''​. 
 + 
 +**1.** Determine ​the number ​of characters in your name using ''​wc'':​ 
 + 
 +  $ echo name | wc 
 + 
 +Notice ​the number of characters is one greater than expected. Use ''echo -n''​ to remove the new line character:​ 
 + 
 +  $ echo -n name | wc 
 + 
 +If you want to return only the number of characters, use  ''​wc -m'':​ 
 + 
 +  $ echo -n name | wc -m 
 + 
 +**2.** Convert DNA to RNA using ''​tr'':​ 
 + 
 +  $ echo ATGTTT | tr T U 
 + 
 +**3.** Convert lower case text to upper case text using ''​tr'':​ 
 + 
 +  $ echo atgctgact | tr a-z A-Z 
 + 
 +**4.** Copy the contents ​of your terminal window and submit it to Canvas for grading. 
 + 
 +\\ 
 + 
 + 
 +====★ Independent Exercise 2B ==== 
 + 
 +Use the unix commands from above to answer the questions below in the terminal. 
 + 
 +**1.** Determine the complement of the following ​oligonucleotide sequenceACTGCCCATTGCCTTGGGGG 
 + 
 +**2.** Determine ​the reverse ​of the above oligo. 
 + 
 +**3.** Determine ​the reverse complemepent of the above oligo. 
 + 
 +**4.** Determine the length of the above oligo.
assignments/ex2.txt · Last modified: 2018/08/30 10:46 by dokuroot