Imacarae Week 8
Jump to navigation
Jump to search
Contents
Purpose
- With the ANOVA test, it is to determine if any genes had a gene expression change that was significantly different than zero at any timepoint.
- With the sanity checks, it is to ensure that the data analysis was performed correctly.
- To learn to run the data with STEM.
Methods and Results
Statistical Analysis Part 1: ANOVA
- We created a new worksheet, naming it "dCIN5_ANOVA".
- We copied the first three columns containing the "MasterIndex", "ID", and "Standard Name" from the "Master_Sheet" worksheet for our strain and paste it into your the worksheet.
- At the top of the first column to the right of the data, we created five column headers of the form dCIN5_AvgLogFC_(TIME) where (TIME) is 15, 30, 60, 90, and 120.
- In the cell below the dCIN5_AvgLogFC_t15 header, we typed
=AVERAGE(
- Then we highlighted all the data in row 2 associated with t15, pressed the closing paren key (shift 0),and pressed enter.
- This cell now contains the average of the log fold change data from the first gene at t=15 minutes.
- We clicked on this cell and positioned the cursor at the bottom right corner to copy the entire column of 6188 other genes.
- We repeated steps 4-7 with the t30, t60, t90, and the t120 data.
- In the first empty column to the right of the dCIN5_AvgLogFC_t120 calculation, we created the column header dCIN5_ss_HO.
- In the first cell below this header, we typed
=SUMSQ(
- We highlighted all the LogFC data in row 2 (but not the AvgLogFC), pressed the closing paren key (shift 0),and pressed the enter.
- In the empty column to the right of dCIN5_ss_HO, we created the column headers dCIN5_ss_(TIME) as in (3).
- We made a note of how many data points we have at each time point for our strain. For this strain, it is 20.
- In the first cell below the header dCIN5)_ss_t15, we typed
=SUMSQ(<range of cells for logFC_t15>)-COUNTA(<range of cells for logFC_t15>)*<AvgLogFC_t15>^2
and hit enter.- The
COUNTA
function counts the number of cells in the specified range that have data in them (i.e., does not count cells with missing values). - The phrase <range of cells for logFC_t15> should be replaced by the data range associated with t15.
- The phrase <AvgLogFC_t15> should be replaced by the cell number in which you computed the AvgLogFC for t15, and the "^2" squares that value.
- Upon completion of this single computation, we used Step (7) trick to copy the formula throughout the column.
- The
- We repeated this computation for the t30 through t120 data points. We were sure to get the data right for each time point for each cell, column, and row for each computation.
- In the first column to the right of dCIN5_ss_t120, we created the column header dCIN5_SS_full.
- In the first row below this header, we typed
=sum(<range of cells containing "ss" for each timepoint>)
and hit enter. - In the next two columns to the right, we created the headers dCIN5_Fstat and dCIN5_p-value.
- Recall the number of data points from (13): call that total n. This is n=20.
- In the first cell of the dCIN5_Fstat column, type
=((20-5)/5)*(<dCIN5_ss_HO>-<dCIN5_SS_full>)/<dCIN5_SS_full>
and hit enter.- We replaced the phrase dCIN5_ss_HO with the cell designation.
- We replaced the phrase <dCIN5_SS_full> with the cell designation.
- We copied it to the whole column.
- In the first cell below the dCIN5_p-value header, we type
=FDIST(<dCIN5_Fstat>,5,n-5)
replacing the phrase <dCIN5_Fstat> with the cell designation and the "n" as in (13) with the number of data points total. We copied it to the whole column. - Before we moved on to the next step, we performed a sanity check to see if we did all of these computations correctly.
- We clicked on cell A1 and click on the Data tab and selected the Filter icon. Little drop-down arrows appeared at the top of each column. This enabled us to filter the data according to criteria we set.
- We clicked on the drop-down arrow on your dCIN5_p-value column, select "Number Filters". In the window that appears, we set a criterion so that the p value is less than 0.05.
- Excel now only displayed the rows that correspond to data meeting that filtering criterion. The number that appears in the lower left hand corner of the window gives the number of rows that meet that criterion. We checked our results with each other to make sure that the computations were performed correctly.
Calculate the Bonferroni and p value Correction
- We performed adjustments to the p value to correct for the multiple testing problem. We labeled the next two columns to the right with the same label, dCIN5_Bonferroni_p-value.
- We typed the equation
=<dCIN5_p-value>*6189
. Upon completion of this single computation, we used the Step (6) trick to copy the formula throughout the column. - We replaced any corrected p value that is greater than 1 by the number 1 by typing the following formula into the first cell below the second dCIN5_Bonferroni_p-value header:
=IF(dCIN5_Bonferroni_p-value>1,1,dCIN5_Bonferroni_p-value)
, where "dCIN5_Bonferroni_p-value" refers to the cell in which the first Bonferroni p value computation was made. We used the Step (10) trick again to copy the formula throughout the column.
Calculate the Benjamini & Hochberg p value Correction
- We created a new worksheet named "dCIN5_ANOVA_B-H".
- We copied and pasted the "MasterIndex", "ID", and "Standard Name" columns from our previous worksheet into the first two columns of the new worksheet.
- Using Paste special > Paste values, we copied our unadjusted p values from our ANOVA worksheet and pasted it into Column D.
- We select all of columns A, B, C, and D, sorted them by ascending values on Column D, clicked the sort button from A to Z on the toolbar, in the window that appears, and sorted by column D, smallest to largest.
- We typed the header "Rank" in cell E1. This created a series of numbers in ascending order from 1 to 6189 in this column. This is the p value rank, smallest to largest. We typed "1" into cell E2 and "2" into cell E3. We selected both cells E2 and E3 and double-clicked on the plus sign on the lower right-hand corner of our selection to fill the column with a series of numbers from 1 to 6189.
- We calculated the Benjamini and Hochberg p value correction. We typed dCIN5_B-H_p-value in cell F1. We typed
=(D2*6189)/E2
in cell F2 and pressed enter. We copied that equation to the entire column. - We typed "dCIN5_B-H_p-value" into cell G1.
- We typed
=IF(F2>1,1,F2)
into G2 and pressed enter. We copied that equation to the entire column. - We selected columns A through G and sorted them by our MasterIndex in Column A in ascending order.
- We copied column G and use Paste special > Paste values to paste it into the next column on the right of our ANOVA sheet.
- We zipped and uploaded the .xlsx file onto the wiki.
Sanity Check: Number of genes significantly changed
Before we move on to further analysis of the data, we want to perform a more extensive sanity check to make sure that we performed our data analysis correctly. We are going to find out the number of genes that are significantly changed at various p value cut-offs.
- Go to your (STRAIN)_ANOVA worksheet.
- Select row 1 (the row with your column headers) and select the menu item Data > Filter > Autofilter (The funnel icon on the Data tab). Little drop-down arrows should appear at the top of each column. This will enable us to filter the data according to criteria we set.
- Click on the drop-down arrow for the unadjusted p value. Set a criterion that will filter your data so that the p value has to be less than 0.05.
- How many genes have p < 0.05? and what is the percentage (out of 6189)?
- How many genes have p < 0.01? and what is the percentage (out of 6189)?
- How many genes have p < 0.001? and what is the percentage (out of 6189)?
- How many genes have p < 0.0001? and what is the percentage (out of 6189)?
- Note that it is a good idea to create a new worksheet in your workbook to record the answers to these questions. Then you can write a formula in Excel to automatically calculate the percentage for you.
- When we use a p value cut-off of p < 0.05, what we are saying is that you would have seen a gene expression change that deviates this far from zero by chance less than 5% of the time.
- We have just performed 6189 hypothesis tests. Another way to state what we are seeing with p < 0.05 is that we would expect to see this a gene expression change for at least one of the timepoints by chance in about 5% of our tests, or 309 times. Since we have more than 309 genes that pass this cut off, we know that some genes are significantly changed. However, we don't know which ones. To apply a more stringent criterion to our p values, we performed the Bonferroni and Benjamini and Hochberg corrections to these unadjusted p values. The Bonferroni correction is very stringent. The Benjamini-Hochberg correction is less stringent. To see this relationship, filter your data to determine the following:
- How many genes are p < 0.05 for the Bonferroni-corrected p value? and what is the percentage (out of 6189)?
- How many genes are p < 0.05 for the Benjamini and Hochberg-corrected p value? and what is the percentage (out of 6189)?
- In summary, the p value cut-off should not be thought of as some magical number at which data becomes "significant". Instead, it is a moveable confidence level. If we want to be very confident of our data, use a small p value cut-off. If we are OK with being less confident about a gene expression change and want to include more genes in our analysis, we can use a larger p value cut-off.
- We will compare the numbers we get between the wild type strain and the other strains studied, organized as a table. Use this sample PowerPoint slide to see how your table should be formatted. Upload your slide to the wiki.
- Note that since the wild type data is being analyzed by one of the groups in the class, it will be sufficient for this week to supply just the data for your strain. We will do the comparison with wild type at a later date.
- Comparing results with known data: the expression of the gene NSR1 (ID: YGR159C)is known to be induced by cold shock. Find NSR1 in your dataset. What is its unadjusted, Bonferroni-corrected, and B-H-corrected p values? What is its average Log fold change at each of the timepoints in the experiment? Note that the average Log fold change is what we called "STRAIN)_AvgLogFC_(TIME)" in step 3 of the ANOVA analysis. Does NSR1 change expression due to cold shock in this experiment?
- For fun, find "your favorite gene" (from your Week 3 assignment) in the dataset. What is its unadjusted, Bonferroni-corrected, and B-H-corrected p values? What is its average Log fold change at each of the timepoints in the experiment? Does your favorite gene change expression due to cold shock in this experiment?
Clustering and GO Term Enrichment with stem (part 2)
- Prepare your microarray data file for loading into STEM.
- Insert a new worksheet into your Excel workbook, and name it "(STRAIN)_stem".
- Select all of the data from your "(STRAIN)_ANOVA" worksheet and Paste special > paste values into your "(STRAIN)_stem" worksheet.
- Your leftmost column should have the column header "Master_Index". Rename this column to "SPOT". Column B should be named "ID". Rename this column to "Gene Symbol". Delete the column named "Standard_Name".
- Filter the data on the B-H corrected 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_AvgLogFC_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 you should turn on the file extensions if you have not already done so.
- Now download and extract the STEM software. Click here to go to the STEM web site.
- Click on the download link 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
.- You now need to download the Gene Ontology and yeast GO annotations and place them in this folder.
- Click here to download the file "gene_ontology.obo".
- Click here to download the file "gene_association.sgd.gz".
- Inside the folder, double-click on the
stem.jar
to launch the STEM program.
- Click on the download link and download the
- Running STEM
- 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.
- Click on the radio button No normalization/add 0.
- Check the box next to Spot IDs included in the data file.
- In section 2 (Gene Info) of the main STEM interface window, leave the default selection for the three drop-down menu selections for Gene Annotation Source, Cross Reference Source, and Gene Location Source as "User provided".
- Click the "Browse..." button to the right of the "Gene Annotation File" item. Browse to your "stem" folder and select the file "gene_association.sgd.gz" and click Open.
- In section 3 (Options) of the main STEM interface window, make sure that the Clustering Method says "STEM Clustering Method" and do not change the defaults for Maximum Number of Model Profiles or Maximum Unit Change in Model Profiles between Time Points.
- In section 4 (Execute) click on the yellow Execute button to run STEM.
- If you get an error, there are some known reasons why stem might not work. If you had #DIV/0! errors in your input file, it will cause problems. Re-open your file and open the Find/Replace dialog. Search for #DIV/0!, but don't put anything in the replace field. Click "Replace all" to remove the #DIV/0! errors. Then save your file and try again with stem.
- This is the stopping point for the Week 8 assignment.
- 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.