# Lauren M. Magee Week 11

## Background

• Wild type vs. Δhmo1: Lucia and Lauren
• Δhmo1 has five time points (15, 30, 60, 90, 120) and it has four replicates for each point, making the number of data points 20.
1. Perform statistical analysis on the ratios
2. Compare individual genes with known data ## Steps 6-7 are performed in Microsoft Excel
3. Pattern finding algorithms (clustering)
4. Map onto biological pathways ## We will use software called STEM for the clustering and mapping
5. Create mathematical model of transcriptional network ## The modeling will be performed in MATLAB

## Statistical Analysis: ANOVA

1. Create a new worksheet, naming it stats
2. Copy the first two columns of the data worksheet (containing ID and Standard Name) into the stats sheet.
3. In the first row, columns c through g, create column labels of the form Δhmo1_xbar_(TIME) where (TIME) is 15, 30, 60, 90, 120.
4. In the first row, columns h and i, create the column labels Δhmo1_xbar_grand and Δhmo1_ss_HO.
5. In the first row, columns j through n, create the column labels Δhmo1_ss_(TIME) as in (3).
6. In the first row, columns o, p, and q, create the column labels Δhmo1_SS_full, Fstat and p-value.
7. Now we're ready to compute. In cell c2, type =AVERAGE(
8. Then click on the tab containing the data, and highlight all the data in row 2 associated with Δhmo1 and t15, press the closing paren key (shift 0),and press the "enter" key.
9. Click on the tab for the stats sheet. Cell c2 now contains the average of the log fold change data from the first gene at t=15 minutes.
10. Click on cell c2 and position your cursor at the bottom right corner. You should see your cursor change to a thin black plus sign (not a chubby white one). When it does, double click, and the formula will magically be copied to the entire column of 6188 other genes.
11. Move to cell d2, and repeat (7) through (10) with the t30 data, to e2 with the t60 data, f2 with the t90, g2 with the 120.
12. Move to cell h2, and repeat (7) through (10) highlighting all the data for Δhmo1 in row 2 instead of the individual time points.
13. Now, we move to cell i2. Type =SUMSQ(
14. Click on the data sheet's tab again, and highlight all the data in row 2 for your Δhmo1, press the closing paren key (shift 0),and press the "enter" key.
• The data highlighted here will be same as in (12).
15. In cell j2, type =SUMSQ(data!C2:F2)-4*stats!C2^2 and hit enter.
• The phrase "data!C2:F2" should be the data associated with t15. The number "4" is the number of data points (note that cells c2, d2, e2, f2 contain 4 data points). The phrase "stats!c2" gets the average you computed in Step (8) for t15, and the "^2" squares that value. Upon completion of this single computation, use the Step (10) trick to copy the formula throughout the column.
16. In cells k2 through n2, repeat (15) for the t30 through t120 data points. Again, be sure to get the data for each time point, type the right number of data points, and get the average from the appropriate cell (d2,e2,f2,g2) for each time point, and copy the formula to the whole column for each computation.
17. Once you've populated cells j2 through n2, click on o2 and type =sum(j2:n2) and hit enter. Copy to the whole column.
18. Recall the number of data points as 20 (5 time points with four replicates).
19. In cell p2, type =((20-5)/5)*(i2-o2)/o2 and hit enter. Don't actually type the n but instead use the number from (20). copy to the whole column.
20. In cell q2, type =FDIST(P2,5,n-5) replacing n as in (20) with the number of data points total. Copy to the whole column.
21. Now we will perform adjustments to the p value to correct for the multiple testing problem. Label column r "STRAIN_Bonferroni_p-value".
22. Type the equation =q2*6189, Upon completion of this single computation, use the Step (10) trick to copy the formula throughout the column.
23. Replace any corrected p value that is greater than 1 by the number 1 by typing the following formula into cell s2: =IF(r2>1,1,r2)

## Calculate the Benjamini & Hochberg p value Correction

1. Insert a new worksheet named "B&H".
2. First, create an index column by first typing "Index" into cell A1. Then type "1" into cell A2 and "2" into cell A3. Select both cells A2 and A3. Double-click on the plus sign on the lower right-hand corner of your selection to fill the column with a series of numbers from 1 to 6189. We will use this to put the genes back in order at the end of these calculations.
3. Copy and paste the column of ID's from one of the previous worksheets into column B.
4. For the following, use Paste special > Paste values. Copy Column Q (the unadjusted p values) from the stats worksheet and paste it into Column C.
5. Select all of columns A, B, and C. Sort by ascending values on Column C. Click the sort button from A to Z on the toolbar, in the window that appears, sort by column C, smallest to largest.
6. Type the header "Rank" in cell D1. Repeat what you did in step 2 to create a series of numbers in ascending order from 1 to 6189. This is the p value rank, smallest to largest.
7. Now you can calculate the Benjamini and Hochberg p value correction. Type "Δhmo1_B-H_p-value" in cell E1. Type the following formula in cell E2: =(C2*6189)/D2 and press enter. Copy that equation to the entire column using the trick you learned last week.
8. Type "Δhmo1_B-H_p-value" into cell F1.
9. Type the following formula into cell F2: =IF(E2>1,1,E2) and press enter. Copy that equation to the entire column using the trick you learned last week.
10. Select columns A through F. Now sort them by your Index in Column A in ascending order.
11. Copy column F and use Paste special < Paste values to paste it into column T of your stats sheet.

## Clustering and Gene Ontology Analysis with STEM

• Click on the download link, register, and download the stem.zip file to your Desktop.
• Unzip the file. In Seaver 120, you can right click on the file icon and select the menu item 7-zip > Extract Here.
• This will create a folder called stem. Inside the folder, double-click on the stem.cmd to launch the STEM program.
• In Seaver 120, we encountered an issue where the program would not launch on the Windows XP machines due to a lack of memory. (Even though the computers have been upgraded to Windows 7, do this to launch the program.) To get around this problem, launch STEM from the command line.
• Go to the start menu and click on Programs > Accessories > Command Prompt.
• You will need to navigate to the directory (folder) in which the STEM program resides. If you followed the instructions above and extracted the stem folder to the Desktop, type the following: cd Desktop\stem and press "Enter".
• To launch the program then type: java -mx512M -jar stem.jar -d defaults.txt and press "Enter". This will launch the program with less memory allocated to it.
• Insert a new worksheet into your Excel workbook, and name it "stem".
• Copy the "Index" column from your "B&H" worksheet and paste it into column A of your "stem" worksheet. Select all of the data from your "stats" worksheet and Paste special > paste values into your "stem" worksheet, starting with column B.
• Your leftmost column should have the column header "Index". Rename this column to "SPOT". Column B should be named "ID". Rename this column to "Gene Symbol".
• Filter the data on the uncorrected p value to be > 0.05 (that's greater than in this case).
• Once the data has been filtered, select all of the rows (except for your header row) and delete the rows by right-clicking and choosing "Delete Row" from the context menu. Undo the filter. This ensures that we will cluster only the genes with a "significant" change in expression and not the noise.
• Delete all of the data columns EXCEPT for the Average Log Fold change columns for each timepoint (for example, wt_xbar_t15, etc.).
• Rename the data columns with just the time and units (for example, 15m, 30m, etc.).
• Save your work. Then use Save As to save this spreadsheet as Text (Tab-delimited) (*.txt). Click OK to the warnings and close your file.
• Note that it would be a good idea to turn on the file extensions by following the procedure on the class Help page.
3. Running STEM
1. In section 1 (Expression Data Info) of the the main STEM interface window, click on the Browse... button to navigate to and select your file.
• Take a screenshot of this window (on a PC, simultaneously press the Alt and PrintScreen buttons to save the view in the active window to the clipboard) and paste it into a PowerPoint presentation to save your figures.