Aporras1 Week 8

From LMU BioDB 2017
Jump to: navigation, search

User page: Antonio Porras

Assignment page: Week 8

Electronic Notebook

Statistical Analysis Part 1

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

  1. Downloaded the excel file and renamed it AP dZAP1.
  2. Created a new worksheet, naming it dZAP1_ANOVA".
  3. Copied the first three columns A, B, and C containing the "MasterIndex", "ID", and "Standard Name" from the "Master_Sheet" worksheet for the strain and pasted it into the new worksheet dZAP1_ANOVA columns A, B and C. Copied the entire columns EI through FB containing the data for dZAP1 strain and pasted it into the worksheet columns D through W.
  4. In columns X, Y, Z, AA, and AB: created five column headers dZAP1_AvgLogFC_t15, dZAP1_AvgLogFC_t30, dZAP1_AvgLogFC_t60, dZAP1_AvgLogFC_t90, dZAP1_AvgLogFC_t120 respectively in that order X through AB.
  5. In the cell below the dZAP1_AvgLogFC_t15 header, typed =AVERAGE(D2:G2)
  6. Pressed the "enter" key.
  7. Clicked on cell X2 and positioned my cursor at the bottom right corner. Saw my cursor change to a thin black plus sign and double clicked.
  8. In the cell below the dZAP1_AvgLogFC_t30 header, typed =AVERAGE(H2:K2)
  9. Pressed the "enter" key.
  10. Clicked on cell Y2 and positioned my cursor at the bottom right corner. Saw my cursor change to a thin black plus sign and double clicked.
  11. In the cell below the dZAP1_AvgLogFC_t60 header, typed =AVERAGE(L2:O2)
  12. Pressed the "enter" key.
  13. Clicked on cell X2 and positioned my cursor at the bottom right corner. Saw my cursor change to a thin black plus sign and double clicked.
  14. In the cell below the dZAP1_AvgLogFC_t90 header, typed =AVERAGE(P2:S2)
  15. Pressed the "enter" key.
  16. Clicked on cell AA2 and positioned my cursor at the bottom right corner. Saw my cursor change to a thin black plus sign and double clicked.
  17. In the cell below the dZAP1_AvgLogFC_t120 header, typed =AVERAGE(T2:W2)
  18. Pressed the "enter" key.
  19. Clicked on cell AB2 and positioned my cursor at the bottom right corner. Saw my cursor change to a thin black plus sign and double clicked.
  20. Now in cell AC1, I created the column header dZAP1_ss_HO.
  21. In cell AC2, I typed =SUMSQ(D2:W2)
  22. Pressed the "enter" key.
  23. Clicked on the cell AC1 with =SUMSQ(D2:W2) data of dZAP1_ss_HO and saw the cursor change to a thin black plus sign and double clicked.
  24. In cells AD1, AE1, AF1, AG1, AH1 I created the column headers dZAP1_ss_t15, dZAP1_ss_t30, dZAP1_ss_t60, dZAP1_ss_t90, dZAP1_ss_t120 for AD1 through AH1 respectively.
  25. I found these data points: t15 had 4 data points, t30 had 4 data points, t60 had 4 data points, t90 had 4 data points, and t120 had 4 data points.
  26. Counted the total data points to be 20.
  27. Highlighted the data in columns D through W of dZAP1_LogFC_t15 through dZAP1_LogFC_t120 and pressed CTL+F.
  28. In the "Replace" tab, typed "NA" and clicked "Replace All".
  29. Found that it replaced 5100 "NA"s.
  30. In cell AD2, I typed =SUMSQ(D2:G2)-COUNTA(D2:G2)*X2^2 and pressed "enter".
    • The COUNTA function counted 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> was replaced by the data range associated with t15.
    • The phrase <number of data points> was replaced by the number of data points for that timepoint (either 3, 4, or 5).
    • The phrase <AvgLogFC_t15> was replaced by the cell number in which I computed the AvgLogFC for t15, and the "^2" squares that value.
    • Upon completion of this single computation, used the Step (7) trick to copy the formula throughout the column.
  31. In cell AE2, I typed =SUMSQ(H2:K2)-COUNTA(H2:K2)*Y2^2 and pressed "enter".
    • Upon completion of this single computation, used the Step (7) trick to copy the formula throughout the column.
  32. In cell AF2, I typed =SUMSQ(L2:O2)-COUNTA(L2:O2)*Z2^2 and pressed "enter".
    • Upon completion of this single computation, used the Step (7) trick to copy the formula throughout the column.
  33. In cell AG2, I typed =SUMSQ(P2:S2)-COUNTA(P2:S2)*AA2^2 and pressed "enter".
    • Upon completion of this single computation, used the Step (7) trick to copy the formula throughout the column.
  34. In cell AH2, I typed =SUMSQ(T2:W2)-COUNTA(T2:W2)*AB2^2 and pressed "enter".
    • Upon completion of this single computation, used the Step (7) trick to copy the formula throughout the column.
  35. In cell AI1, created the header by typing dZAP_SS_full.
  36. In cell AI2, typed =sum(AD2:AH2) and hit enter.
  37. In cell AJ1, created the header by typing dZAP1_Fstat.
  38. In cell AK1, created the header by typing dZAP1_p-value.
  39. Recalled the number of data points: n=20
  40. In cell AJ2 of the dZAP1_Fstat column, typed =((20-5)/5)*(AC2-AI2)/AI2 and hit enter.
    • Copied to the whole column using step 7 again.
  41. In cell AK2 of the dZAP1_p-value column, typed =FDIST(AJ2,5,20-5)
    • Used the Step (7) trick to copy the formula throughout the column.
  42. Before we move on to the next step, I performed a quick sanity check to see if I did all of these computations correctly.
    • Clicked on cell A1 and clicked on the Data tab. Selected the Filter icon.
    • Clicked on the drop-down arrow on cell AK1 dZAP1_p-value column. Selected "Number Filters". In the window that appeared, set a criterion that would filter the data so that the p value has to be less than 0.05.
    • Excel only displayed the rows that correspond to data meeting that filtering criterion which was 2485 out of 6189.

Calculate the Bonferroni and p value Correction

  1. Labeled the next two cells AL1 and AM1 with the same label: dZAP1_Bonferroni_p-value.
  2. Typed the equation =AK2*6189, Upon completion of this single computation, used the Step (7) trick to copy the formula throughout the column.
  3. Replaced any corrected p value that is greater than 1 by the number 1 and typed the following formula into the first cell below the second dZAP1_Bonferroni_p-value header: =IF(AL2>1,1,AL2), where "dZAP1_Bonferroni_p-value" referred to the cell in which the first Bonferroni p value computation was made. Used the Step (7) trick to copy the formula throughout the column.

Calculate the Benjamini & Hochberg p value Correction

  1. Inserted a new worksheet named "dZAP1_ANOVA_B-H".
  2. Copied and pasted the "MasterIndex", "ID", and "Standard Name" columns from columns A, B, and C from the previous worksheet into the first three columns A, B and C respectively of the new worksheet.
  3. For the following, used Paste special > Paste values. Copied the unadjusted p values from column AK in the dZAP1_ANOVA worksheet and pasted it into Column D.
  4. Selected all of columns A, B, C, and D. Sorted by ascending values on Column D. Clicked the sort button from A to Z on the toolbar, in the window that appeared, sorted by column D, smallest to largest.
  5. Typed the header "Rank" in cell E1. Typed "1" into cell E2 and "2" into cell E3. Selected both cells E2 and E3. Double-clicked on the plus sign on the lower right-hand corner of the selection to fill the column with a series of numbers from 1 to 6189.
  6. Typed dZAP1_B-H_p-value in cell F1. Typed the following formula in cell F2: =(D2*6189)/E2 and pressed enter. Copied the equation to the entire column.
  7. Typed "dZAP1_B-H_p-value" into cell G1.
  8. Typed the following formula into cell G2: =IF(F2>1,1,F2) and pressed enter. Copied the equation to the entire column.
  9. Selected columns A through G. Sorted them by the MasterIndex in Column A in ascending order.
  10. Copied column G and used Paste special > Paste values to paste it into the next column on the right of the ANOVA sheet.

Final Spreadsheet

Media:AP dZAP1.zip

Sanity Check: Number of genes significantly changed

  • Went to the dZAP1_ANOVA worksheet.
  • Selected row 1 (the row with the column headers) and selected the menu item Data > Filter > Autofilter (The funnel icon on the Data tab). Little drop-down arrows appeared at the top of each column. This enabled me to filter the data according to criteria I set.
  • Clicked on the drop-down arrow for the unadjusted p value. Set a criterion that would filter the 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)?

2485 genes out of 6189 (40.2%) have p < 0.05

  • How many genes have p < 0.01? and what is the percentage (out of 6189)?

1609 genes out of 6189 (26.0%) have p < 0.01

  • How many genes have p < 0.001? and what is the percentage (out of 6189)?

885 genes out of 6189 (14.3%) have p < 0.001

  • How many genes have p < 0.0001? and what is the percentage (out of 6189)?

457 genes out of 6189 (7.4%) have p < 0.0001

  • 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)?

209 genes out of 6189 (3.4%) have p <0.05

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

1766 out of 6189 (28.5%) have p < 0.05

  • 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 "dZAP1)_AvgLogFC_(TIME)" in step 3 of the ANOVA analysis.

Unadjusted p-value: 6.05652 E-08

Bonferroni corrected p-value: 0.000374838

B-H-Corrected p-value: 1.04122 E-05 Average Log fold change:

  1. t15: 3.899590737
  2. t30: 3.723795809
  3. t60: 3.962776134
  4. t90: -2.155992517
  5. t120: 0.054215477

The NSR1 gene did display changes in the times from t15 to t90 due to the cold shock experiment. Looking at the calculated log values would lead to this conclusion and the extremely small p-values further support this idea.

  • For fun, find "your favorite gene" (CLN1) 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?

CLN1 Gene

Unadjusted p-value: 0.980371562

Bonferroni corrected p-value: 1

B-H-Corrected p-value: 0.991586795

Average Log fold change:

  1. t15: -0.037053381
  2. t30: -0.098693863
  3. t60: -0.045766701
  4. t90: 0.297607262
  5. t120: -0.304161793

The CLN1 gene didn't change in expression when examining the smaller log fold change values and the larger p values.

Summary Paragraph

In this week's assignment we examined the effect of cold shock on genes in various strains of yeast. Specifically, we were assigned the dZAP1 strain of yeast and examined the time intervals of 15 minutes, 30 minutes, 60 minutes, 90 minutes, and 120 minutes. We then analyzed the data at these various time intervals and used Excel to calculate the average log fold changes, calculated p-values, calculated Benjamini and Hochberg-corrected p values, and Bonferroni-corrected p-values. The percent of genes were reported at different cut-off levels to convey their significance in the analysis of the data. The last two calculations mentioned were used because of the pure amount of data we were analyzing across thousands of genes. More specifically, we found that 209 genes or 3.4% had Bonferroni-corrected p values less than 0.05 and 1766 genes or 28.5% had Benjamini and Hochberg-corrected p values less than 0.05. Lastly when examining NSR1, because the log fold change values were large with small p-values, we found the specific gene it was affected by the cold shock. On the other hand the gene we examined for our "Favorite Gene" was not affected by the cold shock when analyzing the smaller log fold change values and larger p values.

Deliverables

Powerpoint Slide:Media:Aporras1 dZAP1 slide.zip

Zip File of Excel Spreadsheet Media:AP dZAP1.zip

Acknowledgements

  1. Met outside of class and worked in class with Katie Wright to discuss any questions we had throughout the process of completing the Week 8 assignment.
  2. Was assisted during the completion of the Week 8 Assignment in class by Dr. Dondi and Dr. Dalquist.
  3. Copied and modified the Week 8 assignment page instructions to fit the assigned dZAP1.
  4. Received the data used in this week's assignment from the Week 8 assignment page.

While I worked with the people noted above, this individual journal entry was completed by me and not copied from another source.

Aporras1 (talk) 20:27, 23 October 2017 (PDT)

References

  1. LMU BioDB 2017. (2017). Week 8. Retrieved October 27, 2017, from https://xmlpipedb.cs.lmu.edu/biodb/fall2017/index.php/Week_8