User Tools

Site Tools


wiki:2016scripting

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
wiki:2016scripting [2016/09/07 11:34]
tai
wiki:2016scripting [2016/09/07 11:35] (current)
tai
Line 15: Line 15:
 In this exercise, we’ll discuss variable assignment and manipulation. The goal is to demonstrate the need to automate repeated tasks, which will be done in the next exercise in which we introduce scripts. In this exercise, we’ll discuss variable assignment and manipulation. The goal is to demonstrate the need to automate repeated tasks, which will be done in the next exercise in which we introduce scripts.
  
-Open a shell or terminal window.\\+**1.** ​Open a shell or terminal window.\\
  
-Assign a DNA sequence to a variable (sequence):+**2.** ​Assign a DNA sequence to a variable (sequence):
   $ sequence=ACTGTACGGTACAC   $ sequence=ACTGTACGGTACAC
-Complement the sequence using tr:+**3.** ​Complement the sequence using tr:
   $ echo $sequence | tr [ACTGactg] [TGACtgac]   $ echo $sequence | tr [ACTGactg] [TGACtgac]
-Reverse the sequence using rev:+**4.** ​Reverse the sequence using rev:
   $ echo $sequence | rev   $ echo $sequence | rev
-Reverse complement the sequence using tr and rev:+**5.** ​Reverse complement the sequence using tr and rev:
   $ echo $sequence | rev | tr [ACTGactg] [TGACtgac]   $ echo $sequence | rev | tr [ACTGactg] [TGACtgac]
-Calculate the length of the sequence using wc -c:+**6.** ​Calculate the length of the sequence using wc -c:
   $ echo -n $sequence | wc -c    $ echo -n $sequence | wc -c 
  
wiki/2016scripting.txt · Last modified: 2016/09/07 11:35 by tai