Difference between revisions of "Eyoung20 journal week 8"
(→Calculate the Bonferroni and p value Correction: changed the tense so it was in scientific voice) |
(→Calculate the Benjamini & Hochberg p value Correction: changed methods to scientific tense) |
||
Line 74: | Line 74: | ||
=== Calculate the Benjamini & Hochberg p value Correction === | === Calculate the Benjamini & Hochberg p value Correction === | ||
− | # | + | # A new worksheet named "dCIN5_ANOVA_B-H" was created. |
− | # | + | # The "MasterIndex", "ID", and "Standard Name" columns from the previous worksheet were copied and pasted into the first two columns of the new worksheet. |
− | # For the | + | # For the the next steps Paste special > Paste values was used to get the correct values copied into the new sheet. The unadjusted p values from the ANOVA worksheet where copied and pasted into Column D. |
− | # | + | # All of columns A, B, C, and D were selected. Then the selected columns were sorted by ascending values on Column D. this was done by clicking the sort button from A to Z on the toolbar, in the window that appeared, sorted by column D, smallest to largest. |
− | # | + | # The header "Rank" was typed into cell E1. A series of numbers in ascending order from 1 to 6189 were created in this column. These were the p value rank, smallest to largest. "1" was typed into cell E2 and "2" into cell E3. Both cells E2 and E3 were selected. The plus sign on the lower right-hand corner of the selection was double-clicked to fill the column with a series of numbers from 1 to 6189. |
− | # | + | # then the Benjamini and Hochberg p value correction was calculated. dCIN5_B-H_p-value was typed into cell F1. The formula : <code>=(D2*6189)/E2</code> was typed into cell F2 and the enter key was pressed. The equation was copied to the entire column. |
− | # | + | # "dCIN5_B-H_p-value" was typed into cell G1. |
− | # | + | # the formula <code>=IF(F2>1,1,F2)</code> was typed into cell G2 and the enter key was pressed. The was copied equation to the entire column. |
− | # | + | # Columns A through G were selected. Then they were sorted by MasterIndex in Column A in ascending order. |
− | # | + | # Column G was then copied and Paste special > Paste values was used to paste the column into the available column that was on the dCIN5_ANOVA sheet. |
− | |||
− | |||
− | |||
− | |||
=== Sanity Check: Number of genes significantly changed === | === Sanity Check: Number of genes significantly changed === |
Revision as of 21:15, 23 October 2019
Contents
- 1 purpose
- 2 Methods
- 2.1 Experimental Design and Getting Ready
- 2.2 Statistical Analysis Part 1: ANOVA
- 2.3 Calculate the Bonferroni and p value Correction
- 2.4 Calculate the Benjamini & Hochberg p value Correction
- 2.5 Sanity Check: Number of genes significantly changed
- 2.6 Clustering and GO Term Enrichment with stem (part 2)
- 3 Data and Files
- 4 Conclusion
- 5 Acknowledgements
- 6 references
purpose
Methods
Experimental Design and Getting Ready
This Group includes Ivy, Delisa, Mihir, and Emma
Gene information
- Strain: dCIN5
- Filename: Master_Sheet_dCIN5
- Number of Replicates: for each time point there are four replicates
- Time points:
- T15: 15 minutes
- T30: 30 minutes
- T60: 60 minutes
- T90: 90 minutes
- T120: 120 minutes
The Data file was Downloaded form the link with the group and gene assignments on the week 7 assignment page. The Data file was renamed adding the initials ERY, making the File name Master_Sheet_dCIN5_ERY so I will be able to be differentiated from the other group mates downloaded files.
Statistical Analysis Part 1: ANOVA
The purpose of the within-stain ANOVA test is to determine if any genes in dCIN5 had a gene expression change that was significantly different than zero at any timepoint.
- A new worksheet was created, "named dCIN5_ANOVA".
- The first three columns containing the "MasterIndex", "ID", and "Standard Name" from the "Master_Sheet" worksheet in the file "BIOL367_F19_microarray-data_dCIN5_ERY" were copies and pasted it into a new worksheet in the same file. The columns containing the data for dCIN5 were copied and pasted it into the new worksheet as well.
- At the top of the first column to the right the data, five column headers of the form dCIN5_AvgLogFC_(TIME), where (TIME) is 15, 30, etc.
- In the cell below the dCIN5_AvgLogFC_t15 header,
=AVERAGE(
was entered. - Then all the data in row 2 associated with t15 was highlighted, the closing paren key (shift 0) was pressed, and then the "enter" key.
- The cell then contained the average of the log fold change data from the first gene at t=15 minutes.
- The cell was then clicked on and and the cursor was positioned at the bottom right corner. when the cursor changed to a thin black plus sign it was double clicked allowing the formula to be copied to the entire column of 6188 other genes.
- The steps (4) through (8) were repeated with the t30, t60, t90, and the t120 data.
- In the empty column to the right of the dCIN5_AvgLogFC_t120 calculation, the column header dCIN5_ss_HO was created.
- In the first cell below this header,
=SUMSQ(
was entered. - All the LogFC data in row 2 was highlighted (except for the AvgLogFC), the closing paren key (shift 0) was pressed, and then "enter" key was pressed.
- In the empty column to the right of dCIN5_ss_HO, the column headers dCIN5_ss_(TIME) as in (3) were created.
- It was noted that there were 4 data points at each time point for dCIN5. It was also noted that the total number of data points was 20.
- In the first cell below the header dCIN5_ss_t15,
=SUMSQ(<range of cells for logFC_t15>)-COUNTA(<range of cells for logFC_t15>)*<AvgLogFC_t15>^2
was inserted and the enter key was pressed.- 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> was replaced by the data range associated with t15.
- The phrase <AvgLogFC_t15> was replaced by the cell number in which the AvgLogFC for t15 was computed, and the "^2" squared that value.
- Upon completion of this single computation, the Step (7) trick was used to copy the formula throughout the column.
- The
- This computation was repeated for the t30 through t120 data points. All the information used for the calculations were confirmed when placed in the equation. The formula was copied to the whole column for each computation.
- In the column to the right of dCIN5_ss_t120, the column header dCIN5_SS_full was added.
- In the first row below this header,
=sum(<range of cells containing "ss" for each timepoint>)
was typed out and the enter key was pressed. - In the next two columns to the right, the headers dCIN5_Fstat and dCIN5_p-value were created.
- Recall the number of data points from (13): call that total n.
- In the first cell of the dCIN5_Fstat column,
=((n-5)/5)*(<dCIN5_ss_HO>-<dCIN5_SS_full>)/<dCIN5_SS_full>
was typed in and the enter key was hit.- Instead of the "n" the number from (13) was used. It was also noted that "5" was the number of timepoints.
- The phrase dCIN5_ss_HO was replaced with the cell designation.
- The phrase <dCIN5_SS_full> was replaced with the cell designation.
- This was then copied to the whole column.
- In the first cell below the dCIN5_p-value header,
=FDIST(<dCIN5_Fstat>,5,n-5)
was typed in to replace the phrase <dCIN5_Fstat> with the cell designation and the "n" as in (13) with the number of data points total. This was copied to the whole column. - Before moving on to the next step, a sanity check was preformed to confirm that all the computations were done correctly.
- Cell A1 was clicked on and then the Data tab. The Filter icon was selected.
- The drop-down arrow on dCIN5_p-value column was selected. "Number Filters" was selected. In the window that appeared, criterion was created that filtered the data so that the p value had to be less than 0.05.
- Excel only displayed the rows that correspond to data that met the filtering criterion. A number appeared in the lower left hand corner of the window, it provided the number of rows that met the criterion. The results were checked with partner in order to make sure that the computations were performed correctly.
- Applied filters were removed before the next steps were taken.
Calculate the Bonferroni and p value Correction
Note: Be sure to undo any filters that you have applied before continuing with the next steps.
- 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, (STRAIN)_Bonferroni_p-value.
- Type the equation
=<(STRAIN)_p-value>*6189
, 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 (STRAIN)_Bonferroni_p-value header:
=IF((STRAIN)_Bonferroni_p-value>1,1,(STRAIN)_Bonferroni_p-value)
, where "(STRAIN)_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
- A new worksheet named "dCIN5_ANOVA_B-H" was created.
- The "MasterIndex", "ID", and "Standard Name" columns from the previous worksheet were copied and pasted into the first two columns of the new worksheet.
- For the the next steps Paste special > Paste values was used to get the correct values copied into the new sheet. The unadjusted p values from the ANOVA worksheet where copied and pasted into Column D.
- All of columns A, B, C, and D were selected. Then the selected columns were sorted by ascending values on Column D. this was done by clicking the sort button from A to Z on the toolbar, in the window that appeared, sorted by column D, smallest to largest.
- The header "Rank" was typed into cell E1. A series of numbers in ascending order from 1 to 6189 were created in this column. These were the p value rank, smallest to largest. "1" was typed into cell E2 and "2" into cell E3. Both cells E2 and E3 were selected. The plus sign on the lower right-hand corner of the selection was double-clicked to fill the column with a series of numbers from 1 to 6189.
- then the Benjamini and Hochberg p value correction was calculated. dCIN5_B-H_p-value was typed into cell F1. The formula :
=(D2*6189)/E2
was typed into cell F2 and the enter key was pressed. The equation was copied to the entire column. - "dCIN5_B-H_p-value" was typed into cell G1.
- the formula
=IF(F2>1,1,F2)
was typed into cell G2 and the enter key was pressed. The was copied equation to the entire column. - Columns A through G were selected. Then they were sorted by MasterIndex in Column A in ascending order.
- Column G was then copied and Paste special > Paste values was used to paste the column into the available column that was on the dCIN5_ANOVA sheet.
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.
- 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.
- Viewing and Saving STEM Results
- A new window will open called "All STEM Profiles (1)". Each box corresponds to a model expression profile. Colored profiles have a statistically significant number of genes assigned; they are arranged in order from most to least significant p value. Profiles with the same color belong to the same cluster of profiles. The number in each box is simply an ID number for the profile.
- Click on the button that says "Interface Options...". At the bottom of the Interface Options window that appears below where it says "X-axis scale should be:", click on the radio button that says "Based on real time". Then close the Interface Options window.
- Take a screenshot of this window (on a PC, simultaneously press the
Alt
andPrintScreen
buttons to save the view in the active window to the clipboard) and paste it into a PowerPoint presentation to save your figures.
- Click on each of the SIGNIFICANT profiles (the colored ones) to open a window showing a more detailed plot containing all of the genes in that profile.
- Take a screenshot of each of the individual profile windows and save the images in your PowerPoint presentation.
- At the bottom of each profile window, there are two yellow buttons "Profile Gene Table" and "Profile GO Table". For each of the profiles, click on the "Profile Gene Table" button to see the list of genes belonging to the profile. In the window that appears, click on the "Save Table" button and save the file to your desktop. Make your filename descriptive of the contents, e.g. "wt_profile#_genelist.txt", where you replace the number symbol with the actual profile number.
- Upload these files to the wiki and link to them on your individual journal page. (Note that it will be easier to zip all the files together and upload them as one file).
- For each of the significant profiles, click on the "Profile GO Table" to see the list of Gene Ontology terms belonging to the profile. In the window that appears, click on the "Save Table" button and save the file to your desktop. Make your filename descriptive of the contents, e.g. "wt_profile#_GOlist.txt", where you use "wt", "dGLN3", etc. to indicate the dataset and where you replace the number symbol with the actual profile number. At this point you have saved all of the primary data from the STEM software and it's time to interpret the results!
- Upload these files to the wiki and link to them on your individual journal page. (Note that it will be easier to zip all the files together and upload them as one file).
- A new window will open called "All STEM Profiles (1)". Each box corresponds to a model expression profile. Colored profiles have a statistically significant number of genes assigned; they are arranged in order from most to least significant p value. Profiles with the same color belong to the same cluster of profiles. The number in each box is simply an ID number for the profile.
- Analyzing and Interpreting STEM Results
- Select one of the profiles you saved in the previous step for further intepretation of the data. I suggest that you choose one that has a pattern of up- or down-regulated genes at the cold shock timepoints. Each member of your group should choose a different profile. Answer the following:
- Why did you select this profile? In other words, why was it interesting to you?
- How many genes belong to this profile?
- How many genes were expected to belong to this profile?
- What is the p value for the enrichment of genes in this profile? Bear in mind that we just finished computing p values to determine whether each individual gene had a significant change in gene expression at each time point. This p value determines whether the number of genes that show this particular expression profile across the time points is significantly more than expected.
- Open the GO list file you saved for this profile in Excel. This list shows all of the Gene Ontology terms that are associated with genes that fit this profile. Select the third row and then choose from the menu Data > Filter > Autofilter. Filter on the "p-value" column to show only GO terms that have a p value of < 0.05. How many GO terms are associated with this profile at p < 0.05? The GO list also has a column called "Corrected p-value". This correction is needed because the software has performed thousands of significance tests. Filter on the "Corrected p-value" column to show only GO terms that have a corrected p value of < 0.05. How many GO terms are associated with this profile with a corrected p value < 0.05?
- Select 6 Gene Ontology terms from your filtered list (either p < 0.05 or corrected p < 0.05).
- Each member of the group will be reporting on his or her own cluster in your research presentation. You should take care to choose terms that are the most significant, but that are also not too redundant. For example, "RNA metabolism" and "RNA biosynthesis" are redundant with each other because they mean almost the same thing.
- Note whether the same GO terms are showing up in multiple clusters.
- Look up the definitions for each of the terms at http://geneontology.org. In your research presentation, you will discuss the biological interpretation of these GO terms. In other words, why does the cell react to cold shock by changing the expression of genes associated with these GO terms? Also, what does this have to do with the transcription factor being deleted (for the groups working with deletion strain data)?
- To easily look up the definitions, go to http://geneontology.org.
- Copy and paste the GO ID (e.g. GO:0044848) into the search field on the left of the page.
- In the results page, click on the button that says "Link to detailed information about <term>, in this case "biological phase"".
- The definition will be on the next results page, e.g. here.
- Each member of the group will be reporting on his or her own cluster in your research presentation. You should take care to choose terms that are the most significant, but that are also not too redundant. For example, "RNA metabolism" and "RNA biosynthesis" are redundant with each other because they mean almost the same thing.
- Select one of the profiles you saved in the previous step for further intepretation of the data. I suggest that you choose one that has a pattern of up- or down-regulated genes at the cold shock timepoints. Each member of your group should choose a different profile. Answer the following:
Data and Files
Your data and files section should include:
- Your Excel workbook with all of your calculations.
- Note that you will be working with this workbook for the next week or two, adding computations to it. Save the new versions to the wiki with the same filename. The wiki will store each version of the file so you can always go back to a previous version, if need be.
- Your PowerPoint slide with a summary table of p values, updated with the screenshots from the stem software.
- You will also be adding to the PowerPoint presentation during subsequent steps in the analysis.
- The input .txt file that you used to run stem.
- The zipped together genelist and GOlist files for each of your significant profiles.
Conclusion
- Write a summary paragraph that gives the conclusions from this week's analysis.