# BIOL368/F14:Chloe Jones Week 13

Here is the calculations that I did so you can compare your calculations with mine. Overton_MicroarrayData_20141119_CJ_downloaded_20141202_editedKD.xlsx *— Kam D. Dahlquist 18:54, 2 December 2014 (EST)*

## Contents

### Calculating fold change

- Here is the Overton_MicroarrayData_20141119.xlsx used for this analysis of MRSA with Ranalexin.
- Start from the sheet called "SAR_only"

__Step 1.__Rename the columns with the item isolated, biological replicate, and dye used. For each array data file there will be 2 columns: signal and background.__Step 2.__Minus the background from the signal for each data file. Then take the answers from each replicate and divide it by its corresponding dye (i.e. Cy5 Ranalexin(B1)/Cy3 MRSA252 (B1)). NOw, the fold change is calculated.__Step 3.__Take the log2 of each fold change.

=LOG(number, base) for example, =LOG(A1,2) takes the log2 of the number in cell A1.

__Step 4.__Homogenize the data so the samples orientation always reads ranalexin/control, do this by multiplying where the control was labeled with Cy5 by (-1).

=(-1)*A1 would multiply the number in cell A1 by negative 1.

__Step 5.__New Worksheet. Input the ID, index, the log fold changes of the non-dye-swapped samples and the fold changes of the dye-swapped samples that have been flipped into new worksheet.Paste specials>values.__Step 6.__Some cells contain error (i.e #NUM!, #DIV/0!), get rid of these errors by find/replace method. Record number of replacements.- NUM!:
**535** - DIV/0:
**16**

- NUM!:

### Scaling and Centering the Data

*To scale and center the data (between chip normalization) perform the following operations:*

__Step 1.__New worksheet, name it "scaled_centered".__Step 2.__Previous worksheet, copy the log fold changes and input in new "scaled_centered". worksheet.__Step 3.__Insert two rows of headers between the top row of headers__Step 4.__Label A2 cell "Average" and A3 cell "StdDev."__Step 5.__Average log ration for each chip (column of data). Cell B2 type equation below. Instead of highlighting till the bottom, press the top and the scroll down to bottom>Shift/click>Ctrl/enter.

=AVERAGE(B4:B5483)

__Step 6.__Compute Standard deviation for each chip (column of data). Cell B3 type equation below.

=STDEV(B4:B5483)

__Step 7.__Utilize Excel.Copy equations from cells B2 and B3. Excel will make the equations match the column numbers. Now the standard deviation and average is computed for the log ratios of each chip. Scaling and centering based on these values.__Step 8.__Copy the headers and and place them to the right of the existing dataset. They should be headers with blank columns underneath. Change the names of the headers so they now read <previous name>_scaled_centered.__Step 9.__Cell N4 type equation below. B4 is getting average (Cell B2) subtracted and then divided by standard deviation (cell B3). Dollar symbols make sure that each cell in a column is getting subtracted and divided by the same thing. This is important because if you were to copy the whole column with no dollar signs it would move to correlate to that particular row and column.

=(B4-B$2)/B$3

__Step 10.__Copy and paste the scaling and centered equation above for the "_scaled_centered" column headers." Use the information of the right that correlate with the name minus the "scaled-centered" part.

### Perform statistical analysis on the ratios

*We are going to perform this step on the scaled and centered data you produced in the previous step.*

__Step 1.__New worksheet title it "statistics".__Step 2.__Copy the first two columns ("ID" and "Index") from the "scaling_centering" worksheet. Paste in new worksheet.__Step 3.__Copy the "_scaled_centered" columns from the scaling_centering" worksheet. Paste in new worksheet with paste special>value.__Step 4.__Remove rows 2 and 3 ("Average" and "StDev" ), now you have gene IDs right below the headers.__Step 5.__Go to the next empty new column on the right. Input headers "Avg_LogFC_A", "Avg_LogFC_B", and "Avg_LogFC_C"into it individual column.__Step 6.__Compute average fold changes for for the*technical*replicates for each sample(A, B, and C). Use equation below, type into I2 and use for column I.

=AVERAGE(C2:D2)

__Step 7.__Follow same equation for samples B and C, paste into appropriate columns.__Step 8.__Compute average of biological replicates. Use header "Avg_LogFC_all", input into next available empty column. Type =average first cell and then parenthesis and click the three averages that were just calculated. Essentially an average of an average.__Step 9.__New column next to "Avg_LogFC_all" column, input header "Tstat". This column will tell us if scaled and centered average log ratios are significantly different than 0 aka no change. Use equation below. (Number of replicates=3). Calculate for whole column.

=AVERAGE(I2:K2)/(STDEV(I2:K2)/SQRT(number of replicates))

__Step 10.__Empty column to the right, input header "Pvalue".Use equation below. (degree of freedom=number of replicates minus one)

=TDIST(ABS(M2),degrees of freedom,2)

__Step 11.__New worksheet title it "forGenMAPP".__Step 12.__Copy all information from "statistics" worksheet, into new worksheet. Paste special>values__Step 13.__Change columns C through L (all the fold changes) into 2 decimal places. Right click>Format>Numbers>2. Change columns M and N to four decimal places.__Step 14.__Input column right to "ID" column. Label header "SystemCode", fill column with "N".__Step 15.__Save file as a Text (Tab-delimited) (*.txt)" from the file type drop-down menu. Will show warnings. Upload .xls and .txt files to wiki page with unique name.

- Here is the Overton_MicroarrayData_20141119.txt used for this analysis of MRSA with Ranalexin. The text version that will be used for GenMAPP.

### Sanity Check: Number of genes significantly changed

*Before we move on to the GenMAPP/MAPPFinder analysis, we want to perform a sanity check to make sure that we performed our data analysis correctly. We are going to find out the number of genes that are significantly changed at various p value cut-offs and also compare our data analysis with the published results.*

__Step 1.__Go to "forGenMAPP" worksheet. On A1 cell right click filter>filter by selected cells value__Step 2.__Click on drop down menu on "Pvalue" column. Text filters>custom filters. Set criteria for P-value:- How many genes have p value < 0.05?
**140** - What about p < 0.01?
**31** - What about p < 0.001?
**3** - What about p < 0.0001?
**1**

- How many genes have p value < 0.05?

** We have just performed 5480 T tests for significance. Another way to state what we are seeing with p < 0.05 is that we would expect to see this magnitude of a gene expression change in about 5% of our T tests, or 274 times. If have more than 274 genes that pass this cut off, we know that some genes are significantly changed. However, we don't know *which* ones.*

- "Avg_LogFC_all" column tells the size of gene expression change, positive values correlates to increases relative to control. Negative values correlate to decreases relative to the control.
__Step 3.__- "Pvalue" filter at p < 0.05, filter the "Avg_LogFC_all" column to show all genes with an average log fold change greater than zero. There are
**71**. - "Pvalue" filter at p < 0.05, filter the "Avg_LogFC_all" column to show all genes with an average log fold change less than zero. There are
**69**. - What about an average log fold change of > 0.25 and p < 0.05? There are
**55**. - What about an average log fold change of < -0.25 and p < 0.05?There are
**54**.More realistic. *For the GenMAPP analysis below, we will use the fold change cut-off of greater than 0.25 or less than -0.25 and the p value cut off of p < 0.05 for our analysis because we want to include several hundred genes in our analysis.*

- "Pvalue" filter at p < 0.05, filter the "Avg_LogFC_all" column to show all genes with an average log fold change greater than zero. There are

- What criteria did your paper use to determine a significant gene expression change? How does it compare to our method?
- In my paper the genes were analyzed using a software called GeneSpring v7. ImaGene V5.5 was used to normalize the data which then allowed for the calculation of each gene. To identify difference in response the ranalexin treatment the data was filtered to detect genes that had a greater than two-fold expression difference with a t-test p-value < 0.05. The method used in the paper was very similar to the method for this assignment. Both methods utilized a T-test with certain parameters one being haivng a P-value of less that 0.05, however the fold expression had to be more in the paper to obtain significance (i.e. two fold in comparison to .25)

### Sanity Check: Compare individual genes with known data

- Look in your paper for genes that are specifically mentioned. What are their fold changes and p values in the paper? Are they significantly changed in your analysis?
- They discussed individual genes, but in terms of mentioning the p-value it was only discussed for modules. They provided a table with modules and what genes were present, however they provided the false discovery adjusted p-value rather than just the p-value. The false discovery p-value relates to the number of false discoveries in that test. I am not as familiar with the FDR, but I know that it is more conserved than a P-value. They mention the p value and fold expression in terms of the 93 upregulated and 105 downregulated genes (>two-fold expression difference,p < 0.05). The paper mention certain genes such as VraR (SAR1974, 2.45 fold, RanaUP), SAR1689 (GreA, 4.00-fold), and SAR0625 (SarA, 4.36-fold). SAR1374 (msrR, 2.24-fold). When I compared my dataset to the fold changes calculated in the paper I saw significant differences. Most of my fold changes don’t exceed a decimal.

### Electronic Lab Notebook

- Chloe Jones Week 2
- Chloe Jones Week 3
- Chloe Jones Week 4
- Chloe Jones Week 5
- Chloe Jones Week 6
- Chloe Jones Week 7
- Chloe Jones Week 8
- Chloe Jones Week 9
- Chloe Jones Week 10
- Chloe Jones Week 11
- Chloe Jones Week 12
- Chloe Jones Week 13
- Chloe Jones Week 15

### Weekly Assignments

- Week 1 Assignment
- Week 2 Assignment
- Week 3 Assignment
- Week 4 Assignment
- Week 5 Assignment
- Week 6 Assignment
- Week 7 Assignment
- Week 8 Assignment
- Week 9 Assignment
- Week 10 Assignment
- Week 11 Assignment
- Week 12 Assignment
- Week 13 Assignment
- Week 15 Assignment

### Class Journals

- Class Journal Week 1
- Class Journal Week 2
- Class Journal Week 3
- Class Journal Week 4
- Class Journal Week 5
- Class Journal Week 6
- Class Journal Week 7
- Class Journal Week 8
- Class Journal Week 9
- Class Journal Week 10
- Class Journal Week 11
- Class Journal Week 12
- Class Journal Week 13
- Class Journal Week 15

Chloe Jones 03:46, 15 October 2014 (EDT)Chloe Jones