Eyoung20 journal week 8

From LMU BioDB 2019
Revision as of 14:05, 17 October 2019 by Eyoung20 (talk | contribs) (started page with copying and pasting method and adding template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

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.

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