110 likes | 233 Vues
In this week's session, we focused on essential Unix commands and Perl programming exercises. Participants practiced by counting words in a dictionary file, filtering words containing 'nj', and creating directories to manage files. Tasks included working with sequence files—downloading, unzipping, and comparing formats. We delved into Perl programming, writing scripts to manipulate DNA sequences, read files, and output content in various formats. Students also learned about tools like HMMER and continued building their coding skills through hands-on exercises.
E N D
CS 451 / 558 Week 2, Thur
Misc • Website updates • Homework • Projects
In class exercises – Unix 4 • How many words in /usr/share/dict/words? • Print a list of words that contain ‘nj’ • Write that list to a file (do this in a new directory)
In class exercises – Unix 5 • Create a new directory • Download sequences.fa • Look at the format of the file • How many sequences are there? • Download .gz version • Unzip it • Is it the same as the other file?
In class exercises – Unix 6 • Create a new directory • Use browser to HMMER from hmmer.org • Move the .tar.gz file to your new directory • Unzip the file Creates hmmer-3.1b1-linux-intel-x86_64/ • Look at contents • Make a copy of the entire directory • Remove the original directory
Unix side notes • awk, sed, man
In class exercises – Perl 1 • Write a program that stores an integer in a variable, then prints it out (4.2 from the book)
In class exercises – Perl 2 • Write a program that prints DNA of arbitrary case in lowercase (acgt); write another that prints in upper case (ACGT). (4.3 from the book)
In class exercises – Perl 3 • Write a program to reverse transcribe RNA to DNA (4.5 from the book)
In class exercises – Perl 4 • Read two files of data (sequence1.fa and sequence2.fa). Print the contents of the first, then the contents of the 2nd. (4.6 from the book)
In class exercises – Perl 5 • Write a program to read a file, then print its lines in reverse order (last line first). • Options • reverse • push/pop/shift/unshift (possibly with loops) (4.7 from the book)