Difference between revisions of "New Wiki Page"
From LMU BioDB 2013
Kevinmcgee (Talk | contribs) |
Kevinmcgee (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | =5/19/2015= | ||
+ | ==Modified t test for each timepoint== | ||
+ | #Inserted a new worksheet into excel called "dgln3_ttest" | ||
+ | #*Copied over everything from "Master Sheet" | ||
+ | #*Removed all data not having to do with dgln3 | ||
+ | #Recalculated average log Fold changes for each timepoint | ||
+ | #*t15: =AVERAGE(D2:G2) | ||
+ | #*t30: =AVERAGE(H2:K2) | ||
+ | #*t60: =AVERAGE(L2:O2) | ||
+ | #*t90: =AVERAGE(P2:S2) | ||
+ | #*t120:=AVERAGE(T2:W2) | ||
+ | |||
+ | #Created new column headings in AC1 named with the pattern dgln3_Tstat_t15 | ||
+ | #*Entered the equation into the second cell below the column heading: | ||
+ | =AVERAGE(''range of cells'')/(STDEV(''range of cells'')/SQRT(''number of replicates'')) | ||
+ | #*Actually inputted | ||
+ | #**t15: =AVERAGE(D2:G2)/(STDEV(D2:G2)/SQRT(4)) | ||
+ | #**t30: =AVERAGE(H2:K2)/(STDEV(H2:K2)/SQRT(4)) | ||
+ | #**t60: =AVERAGE(L2:O2)/(STDEV(L2:O2)/SQRT(4)) | ||
+ | #**t90: =AVERAGE(P2:S2)/(STDEV(P2:S2)/SQRT(4)) | ||
+ | #**t120:==AVERAGE(T2:W2)/(STDEV(T2:W2)/SQRT(4)) | ||
+ | #*Created a new column headings in AH1 and named them with the pattern dgln3_Pval_<tx> where you use the appropriate text within the <> and where x is the time. For example, "dHAP4_Pval_t15". In the cell below the label, enter the equation: | ||
+ | =TDIST(ABS(''cell containing T statistic''),''degrees of freedom'',2) | ||
+ | #*Actually Inputted | ||
+ | #**t15=TDIST(ABS(AC2), 3, 2) | ||
+ | #**t30=TDIST(ABS(AD2), 3, 2) | ||
+ | #**t60=TDIST(ABS(AE2), 3, 2) | ||
+ | #**t90=TDIST(ABS(AF2), 3, 2) | ||
+ | #**t120=TDIST(ABS(AG2), 3, 2) | ||
+ | The number of degrees of freedom is the number of replicates minus one. Copy the equation and paste it into all rows in that column. | ||
+ | * As with the ANOVA, we encounter the multiple testing problem here as well. | ||
+ | |||
+ | ==== Bonferroni Correction ==== | ||
+ | |||
+ | * We need to perform the Bonferroni correction to each p value similar to what we did for the within-strain ANOVA. | ||
+ | |||
+ | ==== Benjamini & Hochberg Correction ==== | ||
+ | |||
+ | * We need to perform the Benjamini & Hochberg correction to each p value similar to what we did for the within-strain ANOVA. | ||
+ | |||
+ | ==== Sanity Check ==== | ||
+ | |||
+ | * We will also perform the "sanity check" as follows: | ||
+ | ** '''''Determine how many genes have a p value < 0.05 at each timepoint.''''' | ||
+ | ** '''''Keeping the "Pval" filter at p < 0.05, How many have an average log fold change of > 0.25 and p < 0.05 at each timepoint? How many have an average log fold change of < -0.25 and p < 0.05 at each timepoint? (These log fold change cut-offs represent about a 20% fold change in expression.)''''' | ||
+ | ** How many genes have B&H corrected p < 0.05? | ||
+ | ** How many genes have a Bonferroni corrected p < 0.05? | ||
+ | ** Use this [[Media: BIOL398-04_S15_sample_p-value_slide.pptx | sample PowerPoint slide]] to see how your table should be formatted. | ||
+ | |||
+ | === Between-strain ANOVA === | ||
+ | |||
+ | The detailed description of how this is done can be found on [[Dahlquist:Modified_ANOVA_and_p_value_Corrections_for_Microarray_Data#Comparing_Significant_Changes_in_Expression_Between_Two_Strains | this page.]] A brief version of the protocol appears below. | ||
+ | |||
+ | * All two strain comparisons were performed in MATLAB using the script [[Media:Two_strain_compare_corrected_20140813_3pm.zip | Two_strain_compare_corrected_20140813_3pm.zip (within a zip file)]]: | ||
+ | ** Download the zipped script file, extract it to the folder that contains your Excel file with the worksheet named "Master_Sheet". (The script and Excel file must be in the same folder to work.) | ||
+ | ** Launch MATLAB version 2014b. | ||
+ | ** In MATLAB, you will need to navigate to the folder containing the script and the Excel file. | ||
+ | *** Near the top of the page, you will see a a field that contains the path to the working directory. Just to the left of it, there is an icon that looks like a folder opening with a green down arrow. Click on this icon to open a dialog box where you can choose your folder containing the script and Excel file. | ||
+ | *** Once you have selected your folder, the left-hand pane should display the contents of that folder. To open the MATLAB script, you can double-click on it from that pane. The code for the script will appear in the center pane. | ||
+ | * You will need to make a few edits to the code, depending on which strain comparison you want to make. | ||
+ | ** For the first block of code, the user must input the name of the Excel file (<code>*.xls</code>) to be imported as the variable "filename", the sheet from which the data will be imported as the variable "sheetname", and the two strains that will be compared as the variables "strain1" and "strain2". | ||
+ | *** Note that we saved our Excel file above as <code>*.xlsx</code>, not <code>*.xls</code>. We may have to go back and "Save as..." <code>*.xls</code>, in order for the MATLAB script to work. | ||
+ | *** Also note that this script will not work for any comparison involving dSWI4 because it has been hard-coded to expect 5 timepoints instead of 4. | ||
+ | |||
+ | %% User must input filename, sheetname, and strains for comparison | ||
+ | filename = 'GCAT_and_Ontario_Final_Normalized_Data.xls'; % Name of input file | ||
+ | sheetname = 'Master_Sheet'; % Name of sheet in input file containing data to analyze | ||
+ | % % If one of the two strains you are working on is the wildtype, keep that | ||
+ | % % wildtype as strain 1. | ||
+ | strain1 = 'wt'; %Here should be wt, dCIN5, dGLN3, dHAP4, dHMO1, dZAP1, or Spar | ||
+ | % % Select strain 2 to be one of the other strains you would like to | ||
+ | % % compare with the first strain. | ||
+ | strain2 = 'dZAP1'; %Here should be wt, dCIN5, dGLN3, dHAP4, dHMO1, dZAP1, or Spar | ||
+ | |||
+ | * The user does not have to modify any of the code from here on. | ||
+ | * The next two lines of code ask the user whether or not they would like to see plots for each gene with an unadjusted p-value < 0.05. If the user does want to see these plots, they enter "1". If they would not like to see these plots, the user enters "0". When prompted, enter a "1" to see the plots displayed. | ||
+ | |||
+ | disp('Do you want to view plots for each gene with an unadjusted p-value < 0.05?') | ||
+ | graph = input('If yes, enter "1". If no, enter "0". '); | ||
+ | |||
+ | == Step 7-8: Clustering and GO Term Enrichment with stem == | ||
+ | |||
+ | # '''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 "MasterIndex". Rename this column to "SPOT". Column B should be named "ID". Rename this column to "Gene Symbol". Delete the column named "StandardName". | ||
+ | #** 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.''' [http://www.cs.cmu.edu/~jernst/stem/ Click here to go to the STEM web site]. | ||
+ | #* Click on the [http://www.andrew.cmu.edu/user/zivbj/stemreg.html download link], register, and download the <code>stem.zip</code> 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 <code>stem</code>. Inside the folder, double-click on the <code>stem.cmd</code> or the <code>stem.jar</code> 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: <code>cd Desktop\stem</code> and press "Enter". | ||
+ | #*** To launch the program then type: <code>java -mx512M -jar stem.jar -d defaults.txt</code> and press "Enter". This will launch the program with less memory allocated to it.--> | ||
+ | # '''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, select ''Saccharomyces cerevisiae (SGD)'', from the drop-down menu for Gene Annotation Source. Select ''No cross references'', from the Cross Reference Source drop-down menu. Select ''No Gene Locations'' from the Gene Location Source drop-down menu. | ||
+ | ## 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. | ||
+ | # '''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 <code>Alt</code> and <code>PrintScreen</code> 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 [http://lionshare.lmu.edu LionShare] and e-mail a link to Dr. Dahlquist. (It will be easier to [[BIOL398-04/S15:Help#Compressing_Files_with_7-Zip | 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 [http://lionshare.lmu.edu LionShare] and e-mail a link to Dr. Dahlquist. (It will be easier to [[BIOL398-04/S15:Help#Compressing_Files_with_7-Zip | zip all the files together]] and upload them as one file). | ||
+ | # '''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 early (first three) timepoints. You and your partner will choose the '''''same''''' profile so that you can compare your results between the two strains. 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 10 Gene Ontology terms from your filtered list (either p < 0.05 or corrected p < 0.05). | ||
+ | ##** Since you and your partner are going to compare the results from each strain for the same cluster, you can either: | ||
+ | ##*** Choose the same 10 terms that are in common between strains. | ||
+ | ##*** Choose 10 terms that are different between the strains (5 or so from each). | ||
+ | ##*** Choose some that are the same and some that are different. | ||
+ | ##**'''''Look up the definitions for each of the terms at [http://geneontology.org http://geneontology.org]. For your final lab report, 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 HAP4 being deleted?''''' | ||
+ | ##** To easily look up the definitions, go to [http://geneontology.org http://geneontology.org]. | ||
+ | ##** Copy and paste the GO ID (e.g. GO:0044848) into the search field at the upper left of the page called "Search GO Data". | ||
+ | ##** In the [http://amigo.geneontology.org/amigo/medial_search?q=GO%3A0044848 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. [http://amigo.geneontology.org/amigo/term/GO:0044848 here]. | ||
+ | |||
=5/18/2015= | =5/18/2015= | ||
==Microarray Data analysis Workflow== | ==Microarray Data analysis Workflow== |
Revision as of 17:13, 19 May 2015
Contents |
5/19/2015
Modified t test for each timepoint
- Inserted a new worksheet into excel called "dgln3_ttest"
- Copied over everything from "Master Sheet"
- Removed all data not having to do with dgln3
- Recalculated average log Fold changes for each timepoint
- t15: =AVERAGE(D2:G2)
- t30: =AVERAGE(H2:K2)
- t60: =AVERAGE(L2:O2)
- t90: =AVERAGE(P2:S2)
- t120:=AVERAGE(T2:W2)
- Created new column headings in AC1 named with the pattern dgln3_Tstat_t15
- Entered the equation into the second cell below the column heading:
=AVERAGE(range of cells)/(STDEV(range of cells)/SQRT(number of replicates))
- Actually inputted
- t15: =AVERAGE(D2:G2)/(STDEV(D2:G2)/SQRT(4))
- t30: =AVERAGE(H2:K2)/(STDEV(H2:K2)/SQRT(4))
- t60: =AVERAGE(L2:O2)/(STDEV(L2:O2)/SQRT(4))
- t90: =AVERAGE(P2:S2)/(STDEV(P2:S2)/SQRT(4))
- t120:==AVERAGE(T2:W2)/(STDEV(T2:W2)/SQRT(4))
- Created a new column headings in AH1 and named them with the pattern dgln3_Pval_<tx> where you use the appropriate text within the <> and where x is the time. For example, "dHAP4_Pval_t15". In the cell below the label, enter the equation:
- Actually inputted
=TDIST(ABS(cell containing T statistic),degrees of freedom,2)
- Actually Inputted
- t15=TDIST(ABS(AC2), 3, 2)
- t30=TDIST(ABS(AD2), 3, 2)
- t60=TDIST(ABS(AE2), 3, 2)
- t90=TDIST(ABS(AF2), 3, 2)
- t120=TDIST(ABS(AG2), 3, 2)
- Actually Inputted
The number of degrees of freedom is the number of replicates minus one. Copy the equation and paste it into all rows in that column.
- As with the ANOVA, we encounter the multiple testing problem here as well.
Bonferroni Correction
- We need to perform the Bonferroni correction to each p value similar to what we did for the within-strain ANOVA.
Benjamini & Hochberg Correction
- We need to perform the Benjamini & Hochberg correction to each p value similar to what we did for the within-strain ANOVA.
Sanity Check
- We will also perform the "sanity check" as follows:
- Determine how many genes have a p value < 0.05 at each timepoint.
- Keeping the "Pval" filter at p < 0.05, How many have an average log fold change of > 0.25 and p < 0.05 at each timepoint? How many have an average log fold change of < -0.25 and p < 0.05 at each timepoint? (These log fold change cut-offs represent about a 20% fold change in expression.)
- How many genes have B&H corrected p < 0.05?
- How many genes have a Bonferroni corrected p < 0.05?
- Use this sample PowerPoint slide to see how your table should be formatted.
Between-strain ANOVA
The detailed description of how this is done can be found on this page. A brief version of the protocol appears below.
- All two strain comparisons were performed in MATLAB using the script Two_strain_compare_corrected_20140813_3pm.zip (within a zip file):
- Download the zipped script file, extract it to the folder that contains your Excel file with the worksheet named "Master_Sheet". (The script and Excel file must be in the same folder to work.)
- Launch MATLAB version 2014b.
- In MATLAB, you will need to navigate to the folder containing the script and the Excel file.
- Near the top of the page, you will see a a field that contains the path to the working directory. Just to the left of it, there is an icon that looks like a folder opening with a green down arrow. Click on this icon to open a dialog box where you can choose your folder containing the script and Excel file.
- Once you have selected your folder, the left-hand pane should display the contents of that folder. To open the MATLAB script, you can double-click on it from that pane. The code for the script will appear in the center pane.
- You will need to make a few edits to the code, depending on which strain comparison you want to make.
- For the first block of code, the user must input the name of the Excel file (
*.xls
) to be imported as the variable "filename", the sheet from which the data will be imported as the variable "sheetname", and the two strains that will be compared as the variables "strain1" and "strain2".- Note that we saved our Excel file above as
*.xlsx
, not*.xls
. We may have to go back and "Save as..."*.xls
, in order for the MATLAB script to work. - Also note that this script will not work for any comparison involving dSWI4 because it has been hard-coded to expect 5 timepoints instead of 4.
- Note that we saved our Excel file above as
- For the first block of code, the user must input the name of the Excel file (
%% User must input filename, sheetname, and strains for comparison filename = 'GCAT_and_Ontario_Final_Normalized_Data.xls'; % Name of input file sheetname = 'Master_Sheet'; % Name of sheet in input file containing data to analyze % % If one of the two strains you are working on is the wildtype, keep that % % wildtype as strain 1. strain1 = 'wt'; %Here should be wt, dCIN5, dGLN3, dHAP4, dHMO1, dZAP1, or Spar % % Select strain 2 to be one of the other strains you would like to % % compare with the first strain. strain2 = 'dZAP1'; %Here should be wt, dCIN5, dGLN3, dHAP4, dHMO1, dZAP1, or Spar
- The user does not have to modify any of the code from here on.
- The next two lines of code ask the user whether or not they would like to see plots for each gene with an unadjusted p-value < 0.05. If the user does want to see these plots, they enter "1". If they would not like to see these plots, the user enters "0". When prompted, enter a "1" to see the plots displayed.
disp('Do you want to view plots for each gene with an unadjusted p-value < 0.05?') graph = input('If yes, enter "1". If no, enter "0". ');
Step 7-8: Clustering and GO Term Enrichment with stem
- 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 "MasterIndex". Rename this column to "SPOT". Column B should be named "ID". Rename this column to "Gene Symbol". Delete the column named "StandardName".
- 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, 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 thestem.cmd
or thestem.jar
to launch the STEM program.
- Click on the download link, register, 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, select Saccharomyces cerevisiae (SGD), from the drop-down menu for Gene Annotation Source. Select No cross references, from the Cross Reference Source drop-down menu. Select No Gene Locations from the Gene Location Source drop-down menu.
- 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 LionShare and e-mail a link to Dr. Dahlquist. (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 LionShare and e-mail a link to Dr. Dahlquist. (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 early (first three) timepoints. You and your partner will choose the same profile so that you can compare your results between the two strains. 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 10 Gene Ontology terms from your filtered list (either p < 0.05 or corrected p < 0.05).
- Since you and your partner are going to compare the results from each strain for the same cluster, you can either:
- Choose the same 10 terms that are in common between strains.
- Choose 10 terms that are different between the strains (5 or so from each).
- Choose some that are the same and some that are different.
- Look up the definitions for each of the terms at http://geneontology.org. For your final lab report, 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 HAP4 being deleted?
- 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 at the upper left of the page called "Search GO Data".
- 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.
- Since you and your partner are going to compare the results from each strain for the same cluster, you can either:
- 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 early (first three) timepoints. You and your partner will choose the same profile so that you can compare your results between the two strains. Answer the following:
5/18/2015
Microarray Data analysis Workflow
- Set browser to send downloads to Desktop
- Followed the Protocal found on OpenWetWare:
Installing R 3.1.0 and the limma package
The following protocol was developed to normalize GCAT and Ontario DNA microarray chip data from the Dahlquist lab using the R Statistical Software and the limma package (part of the Bioconductor Project).
- The normalization procedure has been verified to work with version 3.1.0 of R released in April 2014 (link to download site) and and version 3.20.1 of the limma package ( direct link to download zipped file) on the Windows 7 platform.
- Note that using other versions of R or the limma package might give different results.
- Note also that using the 32-bit versus the 64-bit versions of R 3.1.0 will give different results for the normalization out in the 10-13 or 10-14 decimal place. The Dahlquist Lab is standardizing on using the 64-bit version of R.
- To install R for the first time, download and run the installer from the link above, accepting the default installation.
- To use the limma package, unzip the file and place the contents into a folder called "limma" in the library directory of the R program. If you accept the default location, that will be C:\Program Files\R\R-3.1.0\library (this will be different on the computers in S120 since you do not have administrator rights).
Running the Normalization Scripts
- Create a folder on your Desktop to store your files for the microarray analysis procedure.
- Download the zipped file that contains the
.gpr
files and save it to this folder (or move it if it saved in a different folder).- Unzip this file using 7-zip. Right-click on the file and select the menu item, "7-zip > Extract Here".
- Download the GCAT_Targets.csv file and Ontario_Targets_wt-dCIN5-dGLN3-dHAP4-dHMO1-dSWI4-dZAP1-Spar_20150514.csv files and save them to this folder (or move them if they saved to a different folder).
- Download the Ontario_Chip_Within-Array_Normalization_modified_20150514.R script and save (or move) it to this folder.
- Download the Within-Array_Normalization_GCAT_and_Merged_Ontario-GCAT_Between-Chip_Normalization_modified_20150514.R script and save (or move) it to this folder.
Within Array Normalization for the Ontario Chips
- Launch R x64 3.1.0 (make sure you are using the 64-bit version).
- Change the directory to the folder containing the targets file and the GPR files for the Ontario chips by selecting the menu item File > Change dir... and clicking on the appropriate directory. You will need to click on the + sign to drill down to the right directory. Once you have selected it, click OK.
- In R, select the menu item File > Source R code..., and select the Ontario_Chip_Within-Array_Normalization_modified_20150514.R script.
- You will be prompted by an Open dialog for the Ontario targets file. Select the file Ontario_Targets_wt-dCIN5-dGLN3-dHAP4-dHMO1-dSWI4-dZAP1-Spar_20150514.csv and click Open.
- Wait while R processes your files.
Within Array Normalization for the GCAT Chips and Between Array Normalization for All Chips
- These instructions assume that you have just completed the Within Array Normalization for the Ontario Chips in the section above.
- In R, select the menu item File > Source R code..., and select the Within-Array_Normalization_GCAT_and_Merged_Ontario-GCAT_Between-Chip_Normalization_modified_20150514.R script.
- You will be prompted by an Open dialog for the GCAT targets file. Select the file GCAT_Targets.csv and click Open.
- Wait while R processes your files.
- When the processing has finished, you will find two files called GCAT_and_Ontario_Within_Array_Normalization.csv and GCAT_and_Ontario_Final_Normalized_Data.csv in the same folder.
- Save these files to LionShare and/or to a flash drive.
Visualizing the Normalized Data
Create MA Plots and Box Plots for the GCAT Chips
Input the following code, line by line, into the main R window. Press the enter key after each block of code.
GCAT.GeneList<-RGG$genes$ID
lg<-log2((RGG$R-RGG$Rb)/(RGG$G-RGG$Gb))
- If you get a message saying "NaNs produced" this is OK, proceed to the next step.
r0<-length(lg[1,]) rx<-tapply(lg[,1],as.factor(GCAT.GeneList),mean) r1<-length(rx) MM<-matrix(nrow=r1,ncol=r0)
for(i in 1:r0) {MM[,i]<-tapply(lg[,i],as.factor(GCAT.GeneList),mean)}
MC<-matrix(nrow=r1,ncol=r0)
for(i in 1:r0) {MC[,i]<-dw[i]*MM[,i]}
MCD<-as.data.frame(MC) colnames(MCD)<-chips rownames(MCD)<-gcatID
la<-(1/2*log2((RGG$R-RGG$Rb)*(RGG$G-RGG$Gb)))
- If you get these Warning messages, it's OK:
- 1: In (RGG$R - RGG$Rb) * (RGG$G - RGG$Gb) :
- NAs produced by integer overflow
- 2: NaNs produced
r2<-length(la[1,]) ri<-tapply(la[,1],as.factor(GCAT.GeneList),mean) r3<-length(ri) AG<-matrix(nrow=r3,ncol=r2)
for(i in 1:r2) {AG[,i]<-tapply(la[,i],as.factor(GCAT.GeneList),mean)}
par(mfrow=c(3,3))
for(i in 1:r2) {plot(AG[,i],MC[,i],main=chips[i],xlab='A',ylab='M',ylim=c(-5,5),xlim=c(0,15))} browser()
- Maximize the window in which the graphs have appeared. Save the graphs as a JPEG (File>Save As>JPEG>100% quality...). Once the graphs have been saved, close the window. To continue with the rest of the code, press Enter.
- To make sure that you save the clearest image, do not scroll in the window because a grey bar will appear if you do so.
- The next set of code is for the generation of the GCAT boxplots for the wild-type data.
x0<-tapply(MAG$A[,1],as.factor(MAG$genes$ID),mean) y0<-length(MAG$A[1,]) x1<-length(x0) AAG<-matrix(nrow=x1,ncol=y0)
for(i in 1:y0) {AAG[,i]<-tapply(MAG$A[,i],as.factor(MAG$genes$ID),mean)}
par(mfrow=c(3,3))
for(i in 1:y0) {plot(AAG[,i],MG2[,i],main=chips[i],xlab='A',ylab='M',ylim=c(-5,5),xlim=c(0,15))} browser()
- Maximize the window in which the graphs have appeared. Save the graphs as a JPEG (File>Save As>JPEG>100% quality...). Once the graphs have been saved, close the window. To continue with the rest of the code, press Enter.
par(mfrow=c(1,3))
boxplot(MCD,main="Before Normalization",ylab='Log Fold Change',ylim=c(-5,5),xaxt='n')
axis(1,at=xy.coords(chips)$x,tick=TRUE,labels=FALSE)
text(xy.coords(chips)$x-1,par('usr')[3]-0.6,labels=chips,srt=45,cex=0.9,xpd=TRUE)
boxplot(MG2,main='After Within Array Normalization',ylab='Log Fold Change',ylim=c(-5,5),xaxt='n')
axis(1,at=xy.coords(chips)$x,labels=FALSE)
text(xy.coords(chips)$x-1,par('usr')[3]-0.6,labels=chips,srt=45,cex=0.9,xpd=TRUE)
boxplot(MAD[,Gtop$MasterList],main='After Between Array Normalization',ylab='Log Fold Change',ylim=c(-5,5),xaxt='n')
axis(1, at=xy.coords(chips)$x,labels=FALSE)
text(xy.coords(chips)$x-1,par('usr')[3]-0.6,labels=chips,srt=45,cex=0.9,xpd=TRUE)
- Maximize the window in which the plots have appeared. You may not want to actually maximize them because you might lose the labels on the x axis, but make them as large as you can. Save the plots as a JPEG (File>Save As>JPEG>100% quality...). Once the graphs have been saved, close the window.
Create MA Plots and Box Plots for the Ontario Chips
Input the following code, line by line, into the main R window. Press the enter key after each block of code.
Ontario.GeneList<-RGO$genes$Name
lr<-log2((RGO$R-RGO$Rb)/(RGO$G-RGO$Gb))
- Warning message: "NaNs produced" is OK.
z0<-length(lr[1,]) v0<-tapply(lr[,1],as.factor(Ontario.GeneList),mean) z1<-length(v0) MT<-matrix(nrow=z1,ncol=z0)
for(i in 1:z0) {MT[,i]<-tapply(lr[,i],as.factor(Ontario.GeneList),mean)}
MI<-matrix(nrow=z1,ncol=z0)
for(i in 1:z0) {MI[,i]<-ds[i]*MT[,i]}
MID<-as.data.frame(MI) colnames(MID)<-headers rownames(MID)<-ontID
ln<-(1/2*log2((RGO$R-RGO$Rb)*(RGO$G-RGO$Gb)))
- Warning messages are OK:
- 1: In (RGO$R - RGO$Rb) * (RGO$G - RGO$Gb) :
- NAs produced by integer overflow
- 2: NaNs produced
z2<-length(ln[1,]) zi<-tapply(ln[,1],as.factor(Ontario.GeneList),mean) z3<-length(zi) AO<-matrix(nrow=z3,ncol=z2)
for(i in 1:z0) {AO[,i]<-tapply(ln[,i],as.factor(Ontario.GeneList),mean)}
strains<-c('wt','dCIN5','dGLN3','dHAP4','dHMO1','dSWI4','dZAP1','Spar')
- After entering the call browser() below, maximize the window in which the graphs have appeared. Save the graphs as a JPEG (File>Save As>JPEG>100% quality...). Once the graphs have been saved, close the window and press Enter for the next set of graphs to appear.
- The last graph to appear will be the spar graphs.
- The graphs generated from this code are the before Ontario chips
- Be sure to save the 9 graphs before moving on to the next step
for (i in 1:length(strains)) { st<-strains[i] lt<-which(Otargets$Strain %in% st) if (st=='wt') { par(mfrow=c(3,5)) } else { par(mfrow=c(4,5)) } for (i in lt) { plot(AO[,i],MI[,i],main=headers[i],xlab="A",ylab="M",ylim=c(-5,5),xlim=c(0,15)) } browser() }
- To continue generating plots, press enter.
j0<-tapply(MAO$A[,1],as.factor(MAO$genes[,5]),mean) k0<-length(MAO$A[1,]) j1<-length(j0) AAO<-matrix(nrow=j1,ncol=k0)
for(i in 1:k0) {AAO[,i]<-tapply(MAO$A[,i],as.factor(MAO$genes[,5]),mean)}
- Remember, that after entering the call readline('Press Enter to continue'), maximize the window in which the graphs have appeared. Save the graphs as a JPEG (File>Save As>JPEG>100% quality...). Once the graphs have been saved, close the window and press Enter for the next set of graphs to appear.
- Again, the last graphs to appear will be the spar graphs.
- These graphs that are produced are for the after Ontario chips
- Again, be sure to save 9 graphs before moving on to the next part of the code.
for (i in 1:length(strains)) { st<-strains[i] lt<-which(Otargets$Strain %in% st) if (st=='wt') { par(mfrow=c(3,5)) } else { par(mfrow=c(4,5)) } for (i in lt) { plot(AAO[,i],MD2[,i],main=headers[i],xlab="A",ylab="M",ylim=c(-5,5),xlim=c(0,15)) } browser() }
- To continue generating plots, press enter.
for (i in 1:length(strains)) { par(mfrow=c(1,3)) st<-strains[i] lt<-which(Otargets$Strain %in% st) if (st=='wt') { xcoord<-xy.coords(lt)$x-1 fsize<-0.9 } else { xcoord<-xy.coords(lt)$x-1.7 fsize<-0.8 } boxplot(MID[,lt],main='Before Normalization',ylab='Log Fold Change',ylim=c(-5,5),xaxt='n') axis(1,at=xy.coords(lt)$x,labels=FALSE) text(xcoord,par('usr')[3]-0.65,labels=headers[lt],srt=45,cex=fsize,xpd=TRUE) boxplot(MD2[,lt],main='After Within Array Normalization',ylab='Log Fold Change',ylim=c(-5,5),xaxt='n') axis(1,at=xy.coords(lt)$x,labels=FALSE) text(xcoord,par('usr')[3]-0.65,labels=headers[lt],srt=45,cex=fsize,xpd=TRUE) ft<-Otargets$MasterList[which(Otargets$Strain %in% st)] boxplot(MAD[,ft],main='After Between Array Normalization',ylab='Log Fold Change',ylim=c(-5,5),xaxt='n') axis(1,at=xy.coords(lt)$x,labels=FALSE) text(xcoord,par('usr')[3]-0.65,labels=headers[lt],srt=45,cex=fsize,xpd=TRUE) browser() }
- To continue generating the box plots, press enter.
- You will have to save 9 plots before you have completed the procedure. The last box plot is for spar.
- Warnings are OK.
- Zip the files of the plots together and upload to LionShare and/or save to a flash drive.
Statistical Analysis
- Added the standard name and the master index for all the terms.
- Saved Compiled_Normalized_Data sheet and made a new sheet called Rounded_Normalized_Data
- ran computation
=ROUND(Compiled_Normalized_Data!D2,4)
for all data.
- Created Master Sheet, which has all knew data free of any computational functions
- Copied and pasted numbers with special paste: values
- In Master Sheet:
- Replaced #VALUE with a blank cell. There were 477 replacements
- Created a new worksheet and named it"(dgln3_ANOVA)
- Copied all of the data from the "Master_Sheet" worksheet for your strain and pasted it into the new worksheet.
- At the top of the first column to the right of Spar_LogFC_t120-4 (FD), five column headers were created of the form dgln3_AvgLogFC_(TIME) where (TIME) is 15, 30, 60, 90, 120.
- In the cell below the dgln3_AvgLogFC_t15 header, I typed
=AVERAGE(
- highlighted all the data in row 2 associated with dgln3_LogFC_t15 (AU2:AX2), press the closing paren key (shift 0),and press the "enter" key.
- This cell now contains the average of the log fold change data from the first gene at t=15 minutes.
- Clicked on this cell and position your cursor at the bottom right corner. Double clicked, and the formula was copied to the entire column of 6188 other genes.
- Repeated steps (4) through (8) with the t30, t60, t90, and the t120 data.
- Create the column header dgln3_ss_HO in cell FJ1.
- In FJ2, I typed =SUMSQ(AU2:BN2)
- In FK1, create the column headers dgln3_ss_(TIME) as in (3).
- Make a note of how many data points you have at each time point for your strain.
- 15:4
- 30:4
- 60:4
- 90:4
- 120:4
- In FK2, type
=SUMSQ(<range of cells for logFC_t15>)-<number of data points>*<AvgLogFC_t15>^2
and hit enter.- The phrase <range of cells for logFC_t15> should be replaced by the data range associated with t15.
- The phrase <number of data points> should be replaced by the number of data points for that timepoint (either 3, 4, or 5).
- 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.
- Actual Computation:=SUMSQ(AU2:AX2)-4*FE2^2
- Upon completion of this single computation, copy the formula throughout the column.
- Repeated this computation for the t30 through t120 data points.
- In FP1, create the column header dgln3_SS_full.
- In the first row below this header, type
=sum(<range of cells containing "ss" for each timepoint>)
and hit enter.- Actual Computation: =SUM(FK2:FO2)
- In the next two columns to the right, create the headers dgln3_Fstat and dgln3_p-value.
- Recall the number of data points from (13): call that total n.
- In the first cell of the dgln3_Fstat column, type
=((n-5)/5)*(dgln3_ss_HO-dgln3_SS_full)/dgln3_SS_full
and hit enter.- =((20-5)/5)*(FJ2-FP2)/FP2
- Copy to the whole column.
- In the first cell below the dgln3_p-value header, type
=FDIST(<(dgln3)_Fstat>,5,n-5)
Calculate the Bonferroni and p value Correction
- Labeled FS1 and FT1 dgln3_Bonferroni_p-value.
- Type the equation
=<dgln3_p-value>*6189
, Upon completion of this single computation, copy the formula throughout the column. - Replaced any corrected p value that is greater than 1 by the number 1 by typing the following formula into FT2
=IF(r2>1,1,r2)
. Copy the formula throughout the column.
Calculate the Benjamini & Hochberg p value Correction
- Insert a new worksheet named "dgln3_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.
- Copied unadjusted p values from ANOVA worksheet and pasted it into Column D.
- 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, sorted by column C, smallest to largest.
- Typeed the header "Rank" in cell E1. Stretched this down to 6190.
- Calculated the Benjamini and Hochberg p value correction. Typed dgln3_B-H_p-value in cell F1. Typed the following formula in cell F2:
=(D2*6189)/E2
and copied that equation to the entire column. - Typed "dgln3_B-H_p-value" into cell G1.
- Typed the following formula into cell G2:
=IF(F2>1,1,F2)
Copied that equation to the entire column. - Selected columns A through G. Sorted 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.
- Upload the .xlsx file that you have just created to LionShare. Send Dr. Dahlquist an e-mail with the link to the file (e-mail kdahlquist at lmu dot edu).
Sanity Check
- 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 dgln3_p-value. 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.
- p<0.05=1856 (
- p<0.01=1007
- p<0.001=398
- p<0.0001=121
- Bonderroni = 20
- B&H = 889