Difference between revisions of "Eyoung20 journal week 8"

From LMU BioDB 2019
Jump to navigation Jump to search
(added headers)
(Acknowledgements: added signature)
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
==purpose==
+
==Purpose==
==methods==
+
The objective of this assignment is to gain comfort with statistically analyzing large sets of data, and to practice the skill of keeping an up to date laboratory research notebook. Another object is to become comfortable with converting data to  run through various softwares and databases.
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.
+
==Methods==
 +
=== Experimental Design and Getting Ready ===
 +
This Group includes [[User:Imacarae|Ivy]], [[User:Dmadere|Delisa]], [[User:Msamdars|Mihir]], and [[User:eyoung20|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.
 +
 
 +
 
 +
<!--
 +
* The first thing you will do is to delete the data columns of the strains that you are not analyzing so that your file contains only the strain's data that you will be working with (to make a smaller and less confusing file).
 +
* Next you will replace cells that have "NA" in them (which indicates missing data) with an empty cell.
 +
** Use the keyboard shortcut Control+F to open the "Find" dialog box and select the "Replace" tab.
 +
** Type "NA" in the Search field and don't type anything in the "Replace" field.
 +
** Click the button "Replace all" and '''record the number of replacements made in your electronic lab notebook.'''
 +
** Save early and often throughout this protocol.  We are working with a large spreadsheet and glitches do occur.
 +
-->
 +
 
 +
===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,  <code>=AVERAGE(</code> 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, <code>=SUMSQ(</code> 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, <code>=SUMSQ(<range of cells for logFC_t15>)-COUNTA(<range of cells for logFC_t15>)*<AvgLogFC_t15>^2</code> was inserted and the enter key was pressed.
 +
#* The <code>COUNTA</code> 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.
 +
# 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, <code>=sum(<range of cells containing "ss" for each timepoint>)</code> 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, <code>=((n-5)/5)*(<dCIN5_ss_HO>-<dCIN5_SS_full>)/<dCIN5_SS_full></code>  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, <code>=FDIST(<dCIN5_Fstat>,5,n-5)</code>  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 [https://xkcd.com/882/ multiple testing problem].  Label the next two columns to the right with the same label, (STRAIN)_Bonferroni_p-value.
 +
# Type the equation <code>=<(STRAIN)_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 (STRAIN)_Bonferroni_p-value header: <code>=IF((STRAIN)_Bonferroni_p-value>1,1,(STRAIN)_Bonferroni_p-value)</code>, 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 : <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 ===
 +
A more extensive sanity check was preformed to make sure that the data was analyzed correctly. The sanity check was to determine the number of genes that were significantly changed at various p value cut-offs.
 +
* The dCIN5_ANOVA worksheet was opened.
 +
* Row 1 was selected and the menu item Data > Filter > Autofilter was selected. Little drop-down arrows appeared at the top of each column.  This enabled the data to be filtered according to criteria that was set.
 +
* The drop-down arrow  was clicked for the unadjusted p value. A criterion that would filter the data so that the p value had to be less than 0.05 was set.
 +
** '''''How many genes had p < 0.05? and what is the percentage (out of 6189)?''''': 2290/6189 37.00% 
 +
** '''''How many genes had p < 0.01? and what is the percentage (out of 6189)?''''': 1380/6189 22.29%
 +
** '''''How many genes had p < 0.001? and what is the percentage (out of 6189)?''''': 691/6189 11.16%
 +
** '''''How many genes had p < 0.0001? and what is the percentage (out of 6189)?''''':358/6189 5.78%
 +
* That action performed 6189 hypothesis tests.  The same method was then used to determine the percentages of relevant data that was present as determined by the The Bonferroni correction and The Benjamini-Hochberg correction.
 +
** '''''How many genes are p < 0.05 for the Bonferroni-corrected p value? and what is the percentage (out of 6189)?''''': 151/6189 2.44%
 +
** '''''How many genes are p < 0.05 for the Benjamini and Hochberg-corrected p value? and what is the percentage (out of 6189)?''''':1458/6189 2.35%
 +
* 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 there was to be confidence in the data, small p value cut-off were needed to be used. If less confidence about a gene expression change was ok and it was desired to include more genes in the analysis,  a larger p value cut-off could have been used. 
 +
* '''''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?'''''
 +
***Unadjusted p-value: 6.376*10^-8
 +
***Bonferroni-corrected p-value: 0.0003
 +
***B-H Corrected p-value: 2.192*10^-5
 +
**'''''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 "dCIN5_AvgLogFC_(TIME)" in step 3 of the ANOVA analysis. '''''
 +
*** 18.5887
 +
**'''''Does ''NSR1'' change expression due to cold shock in this experiment?'''''
 +
***Yes ''NSR1'' does change expression due to cold shock in this experiment as seen in the low p-values in the unadjusted, Bonferroni-corrected, and B-H-corrected p values.
 +
* '''''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?'''''
 +
***Unadjusted p-value: 0.0212
 +
***Bonferroni-corrected p-value: 1
 +
***B-H Corrected p-value: 0.0756
 +
** '''''What is its average Log fold change at each of the timepoints in the experiment?'''''
 +
*** 13.41 
 +
**'''''Does your favorite gene change expression due to cold shock in this experiment?'''''
 +
*** Based on the unadjusted p-value the answer would be yes because it has a p-value less than 0.05, however the Bonferroni-corrected, and B-H-corrected p values are greater than 0.05, so most likely it does not change expression due to cold shock in this experiment.
 +
 
 +
=== Clustering and GO Term Enrichment with stem (part 2)===
 +
 
 +
# ''' prepared microarray data file for loading into STEM.'''
 +
#* Inserted a new worksheet into the Excel workbook, and it was named "dCIN5_stem".
 +
#* Selected all of the data from "dCIN5_ANOVA" worksheet and Pasted special > paste values into "dCIN5_stem" worksheet.
 +
#** the leftmost column had the column header "Master_Index".  The column was renamed "SPOT".  Column B was named "ID".  Then was renamed "Gene Symbol". The column named "Standard_Name" was deleted.
 +
#** The data was filtered on the B-H corrected p value to be > 0.05.
 +
#*** After the data was filtered, all of the rows (except for the header row) were selected and deleted by right-clicking and choosing "Delete Row" from the context menu. The filter was removed.  This ensured that only the genes with a "significant" change in expression were clustered and not the noise.
 +
#**  All of the data columns '''''EXCEPT''''' for the Average Log Fold change columns for each timepoint were deleted (for example, dCIN5_AvgLogFC_t15, etc.).
 +
#** Renamed the data columns with just the time and units (for example, 15m, 30m, etc.).
 +
#** The progress was saved.  Then ''Save As'' was used to save this spreadsheet as Text (Tab-delimited) (*.txt). Okayed the warnings and the file was closed.
 +
# '''Then the STEM software was downloaded and extracted.'''  [http://www.cs.cmu.edu/~jernst/stem/ Click here to go to the STEM web site].
 +
#*  The [http://www.sb.cs.cmu.edu/stem/stem.zip download link] was clicked and the file <code>stem.zip</code> was downloaded to the desktop.
 +
#* The file was unzipped.  In Seaver 120, the file icon was right clicked on and  the menu item ''7-zip > Extract Here was selected''.
 +
#* A folder called <code>stem</code> was created due to those actions.
 +
#** Gene Ontology and yeast GO annotations were download and placed them in the folder.
 +
#** This link was clicked [https://lmu.box.com/s/t8i5s1z1munrcfxzzs7nv7q2edsktxgl "gene_ontology.obo"] and downloaded.
 +
#** This link was clicked [https://lmu.box.com/s/zlr1s8fjogfssa1wl59d5shyybtm1d49 "gene_association.sgd.gz"] and downloaded.
 +
#*Inside the folder,  <code>stem.jar</code> was double-clicked to launch the STEM program.
 +
# '''Running STEM'''
 +
## In section 1 (Expression Data Info) of the the main STEM interface window, the ''Browse...'' button was selected to navigate and The file was selected.
 +
##* The radio button was clicked ''No normalization/add 0''.
 +
##* The box next to ''Spot IDs included in the data file'' was selected.
 +
## In section 2 (Gene Info) of the main STEM interface window, the default selection for the three drop-down menu selections for Gene Annotation Source , Cross Reference Source, and Gene Location Source were left as "User provided".
 +
##  The "Browse..." button to the right of the "Gene Annotation File" item was selected.  The "stem" folder was opened and  the file "gene_association.sgd.gz" was selected and Opened.
 +
## In section 3 (Options) of the main STEM interface window,  the Clustering Method was confirmed to say "STEM Clustering Method" and the defaults for Maximum Number of Model Profiles or Maximum Unit Change in Model Profiles between Time Points were not changed.
 +
## In section 4 (Execute) the yellow Execute button was clicked to run STEM.
 +
## The Error for #DIV/0! appeared on the screen.
 +
## The excel file was reopened,  The Find/Replace dialog was opened. #DIV/0! was searched for, nothing was placed in the replace field. "Replace all" was clicked and all the #DIV/0! errors were removed. The file was reserved and the Stem was run again.
 +
## The STEM attempted to run the data for 2 hours with no success.
 +
 
 +
== Data and Files ==
 +
[[media:BIOL367_F19_microarray-data_dCIN5_ERY.xlsx|dCIN5_ANOVA spread sheet]]
 +
 
 +
[[media:BIOL367_F19_microarray-data_dCIN5_ERY.txt|dCIN5_STEM txt file]]
 +
 
 +
[[media:BIOL367 F19 sample p-value slide ERY.pptx|dCIN5 p-value slide]]
 +
 
 +
[[media: Stem_ERY.zip|zipped  genelist and GOlist ]]
 +
 
 +
== Conclusion ==
 +
From this weeks analysis we can conclude that 37.00% of the genes have an unadjusted  p<0.05, 22.29% p<0.01, 11.16% p<0.001, 5.78% p<0.0001.
 +
2.44%  of the genes have a B&H p<0.05 and 2.35% a Bonferroni p<0.05.
  
Create a new worksheet, naming it either "(STRAIN)_ANOVA" as appropriate. For example, you might call yours "wt_ANOVA" or "dHAP4_ANOVA"
 
Copy the first three columns containing the "MasterIndex", "ID", and "Standard Name" from the "Master_Sheet" worksheet for your strain and paste it into your new worksheet. Copy the columns containing the data for your strain and paste it into your new worksheet.
 
At the top of the first column to the right of your data, create five column headers of the form (STRAIN)_AvgLogFC_(TIME) where STRAIN is your strain designation and (TIME) is 15, 30, etc.
 
In the cell below the (STRAIN)_AvgLogFC_t15 header, type =AVERAGE(
 
Then highlight all the data in row 2 associated with t15, 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.
 
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.
 
Repeat steps (4) through (8) with the t30, t60, t90, and the t120 data.
 
Now in the first empty column to the right of the (STRAIN)_AvgLogFC_t120 calculation, create the column header (STRAIN)_ss_HO.
 
In the first cell below this header, type =SUMSQ(
 
Highlight all the LogFC data in row 2 (but not the AvgLogFC), press the closing paren key (shift 0),and press the "enter" key.
 
In the next empty column to the right of (STRAIN)_ss_HO, create the column headers (STRAIN)_ss_(TIME) as in (3).
 
Make a note of how many data points you have at each time point for your strain. For most of the strains, it will be 4, but for dHAP4 t90 or t120, it will be "3", and for the wild type it will be "4" or "5". Count carefully. Also, make a note of the total number of data points. Again, for most strains, this will be 20, but for example, dHAP4, this number will be 18, and for wt it should be 23 (double-check).
 
In the first cell below the header (STRAIN)_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.
 
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.
 
In the first column to the right of (STRAIN)_ss_t120, create the column header (STRAIN)_SS_full.
 
In the first row below this header, type =sum(<range of cells containing "ss" for each timepoint>) and hit enter.
 
In the next two columns to the right, create the headers (STRAIN)_Fstat and (STRAIN)_p-value.
 
Recall the number of data points from (13): call that total n.
 
In the first cell of the (STRAIN)_Fstat column, type =((n-5)/5)*(<(STRAIN)_ss_HO>-<(STRAIN)_SS_full>)/<(STRAIN)_SS_full> and hit enter.
 
Don't actually type the n but instead use the number from (13). Also note that "5" is the number of timepoints.
 
Replace the phrase (STRAIN)_ss_HO with the cell designation.
 
Replace the phrase <(STRAIN)_SS_full> with the cell designation.
 
Copy to the whole column.
 
In the first cell below the (STRAIN)_p-value header, type =FDIST(<(STRAIN)_Fstat>,5,n-5) replacing the phrase <(STRAIN)_Fstat> with the cell designation and the "n" as in (13) with the number of data points total. . Copy to the whole column.
 
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 (STRAIN)_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.
 
Calculate the Bonferroni and p value Correction
 
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
 
Insert a new worksheet named "(STRAIN)_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 (STRAIN)_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.
 
Type "STRAIN_B-H_p-value" into cell G1.
 
Type the following formula into cell G2: =IF(F2>1,1,F2) 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.
 
You must finish up to this point for the interim deadline of Tuesday, October 22, 12:01am Pacific time, so that the instructor can check your calculations before class.
 
==Data and files==
 
 
==Acknowledgements==
 
==Acknowledgements==
 +
I would like to acknowledge my home work partners s [[User:Imacarae|Ivy]], [[User:Dmadere|Delisa]], and [[User:Msamdars|Mihir]] with there help with checking our work and helping to answer questions about the procedure.
 +
I would like to acknowledge that the methods were taken from [[week 8]] and then adapted to fit the actual lab methods preformed.
 +
I would like to acknowledge [[user:kdahlquist|Dr. Dahlquist]] for her instruction on the topic and the procedure.
 +
"Except for what is noted above, this individual journal entry was completed by me and not copied from another source."
 +
[[User:Eyoung20|Eyoung20]] ([[User talk:Eyoung20|talk]]) 00:08, 24 October 2019 (PDT)
 +
 
==references==
 
==references==
 
+
LMU BioDB 2019. (2019). Week 8. Retrieved October 23, 2019, from https://xmlpipedb.cs.lmu.edu/biodb/fall2019/index.php/Week_8
  
 
{{Template:eyoung20}}
 
{{Template:eyoung20}}

Latest revision as of 23:08, 23 October 2019

Purpose

The objective of this assignment is to gain comfort with statistically analyzing large sets of data, and to practice the skill of keeping an up to date laboratory research notebook. Another object is to become comfortable with converting data to run through various softwares and databases.

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.

  1. A new worksheet was created, "named dCIN5_ANOVA".
  2. 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.
  3. 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.
  4. In the cell below the dCIN5_AvgLogFC_t15 header, =AVERAGE( was entered.
  5. 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.
  6. The cell then contained the average of the log fold change data from the first gene at t=15 minutes.
  7. 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.
  8. The steps (4) through (8) were repeated with the t30, t60, t90, and the t120 data.
  9. In the empty column to the right of the dCIN5_AvgLogFC_t120 calculation, the column header dCIN5_ss_HO was created.
  10. In the first cell below this header, =SUMSQ( was entered.
  11. 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.
  12. In the empty column to the right of dCIN5_ss_HO, the column headers dCIN5_ss_(TIME) as in (3) were created.
  13. 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.
  14. 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.
  15. 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.
  16. In the column to the right of dCIN5_ss_t120, the column header dCIN5_SS_full was added.
  17. 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.
  18. In the next two columns to the right, the headers dCIN5_Fstat and dCIN5_p-value were created.
  19. Recall the number of data points from (13): call that total n.
  20. 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.
  21. 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.
  22. 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.

  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, (STRAIN)_Bonferroni_p-value.
  2. 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.
  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 (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

  1. A new worksheet named "dCIN5_ANOVA_B-H" was created.
  2. The "MasterIndex", "ID", and "Standard Name" columns from the previous worksheet were copied and pasted into the first two columns of the new worksheet.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. "dCIN5_B-H_p-value" was typed into cell G1.
  8. 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.
  9. Columns A through G were selected. Then they were sorted by MasterIndex in Column A in ascending order.
  10. 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

A more extensive sanity check was preformed to make sure that the data was analyzed correctly. The sanity check was to determine the number of genes that were significantly changed at various p value cut-offs.
  • The dCIN5_ANOVA worksheet was opened.
  • Row 1 was selected and the menu item Data > Filter > Autofilter was selected. Little drop-down arrows appeared at the top of each column. This enabled the data to be filtered according to criteria that was set.
  • The drop-down arrow was clicked for the unadjusted p value. A criterion that would filter the data so that the p value had to be less than 0.05 was set.
    • How many genes had p < 0.05? and what is the percentage (out of 6189)?: 2290/6189 37.00%
    • How many genes had p < 0.01? and what is the percentage (out of 6189)?: 1380/6189 22.29%
    • How many genes had p < 0.001? and what is the percentage (out of 6189)?: 691/6189 11.16%
    • How many genes had p < 0.0001? and what is the percentage (out of 6189)?:358/6189 5.78%
  • That action performed 6189 hypothesis tests. The same method was then used to determine the percentages of relevant data that was present as determined by the The Bonferroni correction and The Benjamini-Hochberg correction.
    • How many genes are p < 0.05 for the Bonferroni-corrected p value? and what is the percentage (out of 6189)?: 151/6189 2.44%
    • How many genes are p < 0.05 for the Benjamini and Hochberg-corrected p value? and what is the percentage (out of 6189)?:1458/6189 2.35%
  • 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 there was to be confidence in the data, small p value cut-off were needed to be used. If less confidence about a gene expression change was ok and it was desired to include more genes in the analysis, a larger p value cut-off could have been used.
  • 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?
      • Unadjusted p-value: 6.376*10^-8
      • Bonferroni-corrected p-value: 0.0003
      • B-H Corrected p-value: 2.192*10^-5
    • 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 "dCIN5_AvgLogFC_(TIME)" in step 3 of the ANOVA analysis.
      • 18.5887
    • Does NSR1 change expression due to cold shock in this experiment?
      • Yes NSR1 does change expression due to cold shock in this experiment as seen in the low p-values in the unadjusted, Bonferroni-corrected, and B-H-corrected p values.
  • 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?
      • Unadjusted p-value: 0.0212
      • Bonferroni-corrected p-value: 1
      • B-H Corrected p-value: 0.0756
    • What is its average Log fold change at each of the timepoints in the experiment?
      • 13.41
    • Does your favorite gene change expression due to cold shock in this experiment?
      • Based on the unadjusted p-value the answer would be yes because it has a p-value less than 0.05, however the Bonferroni-corrected, and B-H-corrected p values are greater than 0.05, so most likely it does not change expression due to cold shock in this experiment.

Clustering and GO Term Enrichment with stem (part 2)

  1. prepared microarray data file for loading into STEM.
    • Inserted a new worksheet into the Excel workbook, and it was named "dCIN5_stem".
    • Selected all of the data from "dCIN5_ANOVA" worksheet and Pasted special > paste values into "dCIN5_stem" worksheet.
      • the leftmost column had the column header "Master_Index". The column was renamed "SPOT". Column B was named "ID". Then was renamed "Gene Symbol". The column named "Standard_Name" was deleted.
      • The data was filtered on the B-H corrected p value to be > 0.05.
        • After the data was filtered, all of the rows (except for the header row) were selected and deleted by right-clicking and choosing "Delete Row" from the context menu. The filter was removed. This ensured that only the genes with a "significant" change in expression were clustered and not the noise.
      • All of the data columns EXCEPT for the Average Log Fold change columns for each timepoint were deleted (for example, dCIN5_AvgLogFC_t15, etc.).
      • Renamed the data columns with just the time and units (for example, 15m, 30m, etc.).
      • The progress was saved. Then Save As was used to save this spreadsheet as Text (Tab-delimited) (*.txt). Okayed the warnings and the file was closed.
  2. Then the STEM software was downloaded and extracted. Click here to go to the STEM web site.
    • The download link was clicked and the file stem.zip was downloaded to the desktop.
    • The file was unzipped. In Seaver 120, the file icon was right clicked on and the menu item 7-zip > Extract Here was selected.
    • A folder called stem was created due to those actions.
    • Inside the folder, stem.jar was double-clicked to launch the STEM program.
  3. Running STEM
    1. In section 1 (Expression Data Info) of the the main STEM interface window, the Browse... button was selected to navigate and The file was selected.
      • The radio button was clicked No normalization/add 0.
      • The box next to Spot IDs included in the data file was selected.
    2. In section 2 (Gene Info) of the main STEM interface window, the default selection for the three drop-down menu selections for Gene Annotation Source , Cross Reference Source, and Gene Location Source were left as "User provided".
    3. The "Browse..." button to the right of the "Gene Annotation File" item was selected. The "stem" folder was opened and the file "gene_association.sgd.gz" was selected and Opened.
    4. In section 3 (Options) of the main STEM interface window, the Clustering Method was confirmed to say "STEM Clustering Method" and the defaults for Maximum Number of Model Profiles or Maximum Unit Change in Model Profiles between Time Points were not changed.
    5. In section 4 (Execute) the yellow Execute button was clicked to run STEM.
    6. The Error for #DIV/0! appeared on the screen.
    7. The excel file was reopened, The Find/Replace dialog was opened. #DIV/0! was searched for, nothing was placed in the replace field. "Replace all" was clicked and all the #DIV/0! errors were removed. The file was reserved and the Stem was run again.
    8. The STEM attempted to run the data for 2 hours with no success.

Data and Files

dCIN5_ANOVA spread sheet

dCIN5_STEM txt file

dCIN5 p-value slide

zipped genelist and GOlist

Conclusion

From this weeks analysis we can conclude that 37.00% of the genes have an unadjusted p<0.05, 22.29% p<0.01, 11.16% p<0.001, 5.78% p<0.0001. 2.44% of the genes have a B&H p<0.05 and 2.35% a Bonferroni p<0.05.

Acknowledgements

I would like to acknowledge my home work partners s Ivy, Delisa, and Mihir with there help with checking our work and helping to answer questions about the procedure. I would like to acknowledge that the methods were taken from week 8 and then adapted to fit the actual lab methods preformed. I would like to acknowledge Dr. Dahlquist for her instruction on the topic and the procedure. "Except for what is noted above, this individual journal entry was completed by me and not copied from another source." Eyoung20 (talk) 00:08, 24 October 2019 (PDT)

references

LMU BioDB 2019. (2019). Week 8. Retrieved October 23, 2019, from https://xmlpipedb.cs.lmu.edu/biodb/fall2019/index.php/Week_8

Eyoung20 user page

Assignment pages Individual Journal Class Journal
week 1 Eyoung20 journal week 1 Class Journal Week 1
week 2 Eyoung20 journal week 2 Class Journal Week 2
week 3 ASP1/YDR321W Week 3 Class Journal Week 3
week 4 Eyoung20 journal week 4 Class Journal Week 4
week 5 Ancient mtDNA Week 5 Class Journal Week 5
week 6 Eyoung20 journal week 6 Class Journal Week 6
week 7 Eyoung20 journal week 7 Class Journal Week 7
week 8 Eyoung20 journal week 8 Class Journal Week 8
week 9 Eyoung20 journal week 9 Class Journal Week 9
week 10 Eyoung20 journal week 10 Class Journal Week 10
week 11 Eyoung20 journal week 11 FunGals
week 12/13 Knguye66 Eyoung20 Week 12/13 FunGals
week 15 Knguye66 Eyoung20 Week 15 FunGals