Difference between revisions of "Kmill104 Week 9"

From LMU BioDB 2024
Jump to navigation Jump to search
(Methods/Results: adding third methods/results part)
(Calculate the Bonferroni and p value Correction: adding fourth methods/results part)
Line 64: Line 64:
 
# Type the equation <code>=<wt_p-value>*6189</code>, Upon completion of this single computation, use the Step (10) trick to copy the formula throughout the column.
 
# Type the equation <code>=<wt_p-value>*6189</code>, Upon completion of this single computation, use the Step (10) trick to copy the formula throughout the column.
 
# Replace 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 wt_Bonferroni_p-value header: <code>=IF(wt_Bonferroni_p-value>1,1,wt_Bonferroni_p-value)</code>, where "wt_Bonferroni_p-value" refers to the cell in which the first Bonferroni p value computation was made.  Use the Step (10) trick to copy the formula throughout the column.
 
# Replace 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 wt_Bonferroni_p-value header: <code>=IF(wt_Bonferroni_p-value>1,1,wt_Bonferroni_p-value)</code>, where "wt_Bonferroni_p-value" refers to the cell in which the first Bonferroni p value computation was made.  Use the Step (10) trick to copy the formula throughout the column.
 +
 +
==== Calculate the Benjamini & Hochberg p value Correction ====
 +
 +
# Insert a new worksheet named "wt_ANOVA_B-H".
 +
# Copy and paste the "MasterIndex", "ID", and "Standard Name" columns from your previous worksheet into the first two columns of the new worksheet.
 +
# For the following, use Paste special > Paste values.  Copy your unadjusted p values from your ANOVA worksheet and paste it into Column D.
 +
# Select all of columns A, B, C, and D. Sort by ascending values on Column D. Click the sort button from A to Z on the toolbar, in the window that appears, sort by column D, smallest to largest.
 +
# Type the header "Rank" in cell E1.  We will create a series of numbers in ascending order from 1 to 6189 in this column.  This is the p value rank, smallest to largest.  Type "1" into cell E2 and "2" into cell E3. Select both cells E2 and E3. 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.
 +
# Now you can calculate the Benjamini and Hochberg p value correction. Type wt_B-H_p-value in cell F1. Type the following formula in cell F2: <code>=(D2*6189)/E2</code> and press enter. Copy that equation to the entire column.
 +
# Type "wt_B-H_p-value" into cell G1.
 +
# Type the following formula into cell G2: <code>=IF(F2>1,1,F2)</code> and press enter. Copy that equation to the entire column.
 +
# Select columns A through G.  Now sort them by your MasterIndex in Column A in ascending order.
 +
# Copy column G and use Paste special > Paste values to paste it into the next column on the right of your ANOVA sheet.
 +
 +
* '''''Zip and upload the .xlsx file that you have just created to the wiki.'''''
  
 
==Data & Files==
 
==Data & Files==

Revision as of 19:14, 20 March 2024

Purpose

Methods/Results

Experimental Design and Getting Ready

The data used in this exercise is publicly available at the NCBI GEO database in record GSE83656.

  • Begin by downloading the Excel file for your group's strain.
  • NOTE: before beginning any analysis, immediately change the filename (Save As...) so that it contains your initials to distinguish it from other students' work.
  • In the Excel spreadsheet, there is a worksheet labeled "Master_Sheet_<STRAIN>", where <STRAIN> is replaced by the strain designation wt.
    • In this worksheet, each row contains the data for one gene (one spot on the microarray).
    • The first column contains the "MasterIndex", which numbers all of the rows sequentially in the worksheet so that we can always use it to sort the genes into the order they were in when we started.
    • The second column (labeled "ID") contains the Systematic Name (gene identifier) from the Saccharomyces Genome Database.
    • The third column contains the Standard Name for each of the genes.
    • Each subsequent column contains the log2 ratio of the red/green fluorescence from each microarray hybridized in the experiment (steps 1-5 above having been performed for you already), for each strain starting with wild type and proceeding in alphabetical order by strain deletion.
    • Each of the column headings from the data begin with the experiment name ("wt" for wild type S. cerevisiae data). "LogFC" stands for "Log2 Fold Change" which is the Log2 red/green ratio. The timepoints are designated as "t" followed by a number in minutes. Replicates are numbered as "-0", "-1", "-2", etc. after the timepoint.
      • The timepoints are t15, t30, t60 (cold shock at 13°C) and t90 and t120 (cold shock at 13°C followed by 30 or 60 minutes of recovery at 30°C).
  • Begin by recording in your wiki, the strain that you will analyze, the filename, the number of replicates for each strain and each time point in your data.

The strain that me and Dean will analyze is the wild type strain. The name of the file is BIOL367_S24_microarray-data_wt.xlsx.

Statistical Analysis Part 1: ANOVA

The purpose of the within-stain ANOVA test is to determine if any genes had a gene expression change that was significantly different than zero at any timepoint.

  1. Create a new worksheet, naming it "wt_ANOVA".
  2. Copy all data from the "Master_Sheet" worksheet and paste it in your new worksheet.
  3. At the top of the first column to the right of your data, create five column headers of the form wt_AvgLogFC_(TIME) where wt is your strain designation and (TIME) is 15, 30, 60, 90, and 120.
  4. In the cell below the wt_AvgLogFC_t15 header, type =AVERAGE(
  5. Then highlight all the data in row 2 associated with t15, press the closing paren key (shift 0),and press the "enter" key.
  6. This cell now contains the average of the log fold change data from the first gene at t=15 minutes.
  7. Click on this cell 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.
  8. Repeat steps (4) through (8) with the t30, t60, t90, and the t120 data.
  9. Now in the first empty column to the right of the wt_AvgLogFC_t120 calculation, create the column header wt_ss_HO.
  10. In the first cell below this header, type =SUMSQ(
  11. Highlight all the LogFC data in row 2 (but not the AvgLogFC), press the closing paren key (shift 0),and press the "enter" key.
  12. In the next empty column to the right of wt_ss_HO, create the column headers wt_ss_(TIME) as in (3).
  13. Make a note of how many data points you have at each time point for your strain. For the wild type it will be "4" or "5". Count carefully. Also, make a note of the total number of data points. For wt it should be 23 (double-check).
  14. In the first cell below the header wt_ss_t15, type =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, use the Step (7) trick to copy the formula throughout the column.
  15. Repeat this computation 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 for each time point, and copy the formula to the whole column for each computation.
  16. In the first column to the right of wt_ss_t120, create the column header wt_SS_full.
  17. In the first row below this header, type =sum(<range of cells containing "ss" for each timepoint>) and hit enter.
  18. In the next two columns to the right, create the headers wt_Fstat and wt_p-value.
  19. Recall the number of data points from (13) -> 23.
  20. In the first cell of the wt_Fstat column, type =(n-5)/5)*(<(wt_ss_HO>-<wt_SS_full>)/<wt_SS_full> and hit enter.
  21. Don't actually type the n but instead use the number from (13), which is 23. Also note that "5" is the number of timepoints.
    • Replace the phrase wt_ss_HO with the cell designation.
    • Replace the phrase wt_ss_full with the cell designation.
    • Copy to the whole column.
  22. In the first cell below the wt_p-value header, type =FDIST(<wt_Fstat>,5,n-5) replacing the phrase wt_Fstat> with the cell designation and the "n" as in (13) with 23. Copy to the whole column.
  23. Before we move on to the next step, we will perform a quick sanity check to see if we did all of these computations correctly.
    • Click on cell A1 and click on the Data tab. Select the Filter icon (looks like a funnel). 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 on your wt_p-value column. Select "Number Filters". In the window that appears, set a criterion that will filter your data so that the p value has to be less than 0.05.
    • Excel will now only display the rows that correspond to data meeting that filtering criterion. A number will appear in the lower left hand corner of the window giving you the number of rows that meet that criterion. We will check our results with each other to make sure that the computations were performed correctly.
    • Be sure to undo any filters that you have applied before making any additional calculations.

Calculate the Bonferroni and p value Correction

Note: Be sure to undo any filters that you have applied before continuing with the next steps.

  1. Now we will perform adjustments to the p value to correct for the multiple testing problem. Label the next two columns to the right with the same label, wt_Bonferroni_p-value.
  2. Type the equation =<wt_p-value>*6189, Upon completion of this single computation, use the Step (10) trick to copy the formula throughout the column.
  3. Replace 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 wt_Bonferroni_p-value header: =IF(wt_Bonferroni_p-value>1,1,wt_Bonferroni_p-value), where "wt_Bonferroni_p-value" refers to the cell in which the first Bonferroni p value computation was made. Use the Step (10) trick to copy the formula throughout the column.

Calculate the Benjamini & Hochberg p value Correction

  1. Insert a new worksheet named "wt_ANOVA_B-H".
  2. Copy and paste the "MasterIndex", "ID", and "Standard Name" columns from your previous worksheet into the first two columns of the new worksheet.
  3. For the following, use Paste special > Paste values. Copy your unadjusted p values from your ANOVA worksheet and paste it into Column D.
  4. Select all of columns A, B, C, and D. Sort by ascending values on Column D. Click the sort button from A to Z on the toolbar, in the window that appears, sort by column D, smallest to largest.
  5. Type the header "Rank" in cell E1. We will create a series of numbers in ascending order from 1 to 6189 in this column. This is the p value rank, smallest to largest. Type "1" into cell E2 and "2" into cell E3. Select both cells E2 and E3. 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.
  6. Now you can calculate the Benjamini and Hochberg p value correction. Type wt_B-H_p-value in cell F1. Type the following formula in cell F2: =(D2*6189)/E2 and press enter. Copy that equation to the entire column.
  7. Type "wt_B-H_p-value" into cell G1.
  8. Type the following formula into cell G2: =IF(F2>1,1,F2) and press enter. Copy that equation to the entire column.
  9. Select columns A through G. Now sort them by your MasterIndex in Column A in ascending order.
  10. Copy column G and use Paste special > Paste values to paste it into the next column on the right of your ANOVA sheet.
  • Zip and upload the .xlsx file that you have just created to the wiki.

Data & Files

Conclusion

Acknowledgements

References

Begin by recording in your wiki, the strain that you will analyze, the filename, the number of replicates for each strain and each time point in your data.

Analyzing the wild type strain Original filename: , Updated filename: MillerSymondsSheet At time 15, 4 replicates 30, 5 60, 4 90, 5 120, 5

Total is 23

How many genes have p < 0.05? and what is the percentage (out of 6189)? 2528 How many genes have p < 0.01? and what is the percentage (out of 6189)? 1652 How many genes have p < 0.001? and what is the percentage (out of 6189)? 919 How many genes have p < 0.0001? and what is the percentage (out of 6189)? 496

How many genes are p < 0.05 for the Bonferroni-corrected p value? and what is the percentage (out of 6189)? 248 How many genes are p < 0.05 for the Benjamini and Hochberg-corrected p value? and what is the percentage (out of 6189)? 1822

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?

2.86939E-10 1.77586E-06 8.87932E-07 3.279225 3.621 3.526525 -2.04985 -0.60622

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?

0.563798852 3489.351093 0.679258535 0.1076 -0.46192 -0.47075 0.16805 -0.18418

Media:MillerSymondsSheet.zip