Doing More in UNIX HORT 59000 Lab 3 Instructor: Kranthi Varala Today’S Pairs

Doing More in UNIX HORT 59000 Lab 3 Instructor: Kranthi Varala Today’S Pairs

Doing more in UNIX HORT 59000 Lab 3 Instructor: Kranthi Varala Today’s pairs Pair #1 Pair #2 Pair #3 Pair #4 Pair #5 Pair #6 Pair #7 Pair #8 Aishwarya, Habte, Chancellor, Rachel F., Rachel H., Michelle, Raquel, Katherine, Shawna Xiaojin Thiti Sara AuditorX Jay Courtney Hannah If your partner is missing, let me know and we’ll adjust the pairs based on availability. Quiz 2 • Open-book policy: You are free to look at all the slides from previous Lectures and labs. • No internet searches for answers. • No talking to others. • You have 20 minutes to complete the quiz. Creating pipelines from commands • The STDIN and STDOUT of each command can be redirected to combine programs together. • For example, the STDOUT of one program can be sent to the STDIN of another program. • STDIN and STDOUT streams can be redirected using the following symbols: 1. > 2. < 3. | Writing vs. Appending to a file $ cat Pasture.txt > Poems.txt Send the contents of Pasture.txt to a new file called Poems.txt. If Poems.txt exists, its contents are over- written. $ cat WoodPile.txt >> Poems.txt Add the contents of WoodPile.txt to the end of the existing file Poems.txt. If Poems.txt does not exist, it will be created. Exercises UNIX commands wget and nano • Search NCBI’s GEO website for the experiment GSE49418. • Find the FTP link for the series matrix file. • Copy the link to the GSE49418_series_matrix.txt.gz file. • Use wget to download the matrix file to a new directory in your scratch folder. • Expand the gzip file and open the resulting text file in nano editor: $ nano GSE49418_series_matrix.txt Create the header file • Open GSE49418_series_matrix.txt in the nano editor and scroll down to the line that starts with “!Sample_title” • Press Ctrl+c to find the line number for this line. • Now create a file that contains only the header row using the head and tail commands. • Hint: Direct STDOUT of head to STDIN of tail $ head –n 30 GSE49418_series_matrix.txt | tail –n 1 > Header.txt • Edit the header line using nano to look like this: Create the matrix file • Use the tail command to create a matrix file that only contains the gene_IDs and expression values. • NOTE: You can do simple arithmetic on the command line using the bc command. $ tail –n 22811 GSE49418_series_matrix.txt |head –n 22810 >Matrix.txt General recipe for creating custom groups of columns • Use the cut command to extract required column headers from the Header file. $ cut –f1,7 Header.txt > WTvsMT_CK.header • Use the cut command to extract required columns from the Matrix file. $ cut –f1,7 Matrix.txt | sort -n -k2,2 > WTvsMT_CK.matrix • Use the cat command to attach the header to the data columns. $ cat Header.txt Matrix.txt > WTvsMT_CK.txt Create these files • From matrix file create a new file WTvsMT_CK.txt with the columns 1-7. • Sort this file based on Column 2. • From matrix file create a new file WTvsMT_Dry.txt with the columns 1,8-13. • Sort this file based on ‘MT’ columns • From matrix file create a new file CKvsDry_WT.txt with the columns 1-4,8-10. • Sort this file based on ‘CK’ columns • From matrix file create a new file MTvsWT_CK.txt with the columns 1,5-7,2-4. • NOTE: Pay attention to the order of the columns.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us