GEx qPCR analysis - bcfgothenburg/HT23 GitHub Wiki

Course: HT23 Gene expression analysis using R (SC00034)


Background

PCR is typically used to measure the amount of gene transcripts or double-stranded DNA in a sample and is used for both diagnostic and basic research. In these exercises we will assess efficiency and quantify gene expression of a target gene c-myc, normalized by a control GAPDH in kidney samples relative to the brain samples. We will use the ΔΔCT method to get the relative quantification and we will also compare the expression between groups.

Based on Analysis of real-time qPCR data

Good Luck!

Relative quantification using the ΔΔCT method

In this exercise we are going to analyze the expression of c-myc. The example data contains the CT values of two genes from 12 different samples.

  1. Open the qPCR template from canvas in RStudio.

  2. Install and load the package pcr from CRAN with the code

install.packages("pcr") 
  1. Load the installed package with the function library()

  2. Locate and save the filepath to a variable for the raw ct data using the system.file() function

fl <- system.file("extdata", "ct1.csv", package = "pcr") 
  1. Read in the data
ct1 <- readr::read_csv(fl) # or use ct1<-read.csv(fl) 
  1. Add a grouping variable for the brain and kidney samples (required for the following analyze).
group_var <- rep(c("brain", "kidney"), each = 6) 
  1. Use the pcr_analyze function from the pcr package to calculate the relative expression. Type ?pcr_analyze in the console for more info. The input includes the CT value of c-myc in kidney and brain samples, which will be normalized to the control GAPDH.
 pcr_analyze(ct1,
             group_var = group_var,
             reference_gene = "GAPDH",
             reference_group = "brain") 

Q1. Look at the result table. What is the relative expression of c-myc in the kidney relative to the brain? What assumption about the PCR efficiency have been made for these calculations? Add the answers to your report.

PCR efficiency

In this exercise we are going to look at the efficiency of the PCR reaction. Many calculations assume a 2-fold increase (100% efficiency) each cycle, but is it really 100%?

First calculate it using the built in function and after that manually using the lm() function in R. Is there any difference?

  1. Use the pcr_assess function from pcr package. Type ?pcr_assess in the console for more info.

  2. Locate and save the file path to a variable using the system.file() function

fl <- system.file("extdata", "ct3.csv", package = "pcr")
  1. Read in the data to an object

  2. Make a vector of RNA amounts for the standard curve, 3 each of the following values 1, .5, .2, .1, .05, .02, .01.

  3. Calculate amplification efficiency using the standard curve option.

  4. As you remember from the lectures the value of the amplification efficiency is given by E=10^(−1/slope) - 1.

Q2. What is the slope and the efficiency for c_myc? Include the values in your report.

  1. Now use the lm() function in R and calculate the slope and the efficiency for c_myc using the amount vector you created in step 4 above i.e lm(ct3$c_myc ~ log10(amount)). Hint you can use either the coefs() or the summary() function on your lm object to extract the coefficients.

PCR efficiency visually

Here we are going to look at the efficiency of the PCR reaction visually, using the same dataset as in Exercise 2. Again we use the pcr_assess function from pcr package, but this time with the method = "efficiency" and plot = TRUE options. A plot is produced that shows the average and standard deviation of ΔCT at difference input amounts.

  1. Run the pcr_assess function above but change method and the plot option.

  2. If you like you can pass ggplot2 options to make the graph look better (ie labs and theme), try it out!

  3. What does the axis represent?

Q3. Look at the slope of the trend line. What does the slope indicate? What are the values of the slope and R2? Include the values in your report.

Calculate standard amounts and error when not 100% PCR efficiency

When using the ct3 dataset we saw that the slope and intercept deviated from the 100% PCR efficiency slope we learned at the lectures. Now we are going to recalculate Exercise 1 with the slope and intercept we got in exercise 2.

  1. Save the output of exercise 2 to an object and use str() to see how you extract the slopes and intercept. Save them to slope and intersect, respectively.

  2. Redo exercise 1 with the extra options method = "relative_curve" , to use the real values for the PCR efficiency and not the assumed 100% efficiency. Hint use ?pcr_analyze to figure out how.

Q4. Does the result differ from Exercise 1? If so how?

Testing for statistical significance

Here we will be testing for statistical significance between conditions using the pcr_test function from the pcr package. Type ?pcr_test in the console for more info.

In this exercise the ct4 data set consisting of 48 samples will be used. It has two gene columns ref and target. The samples came from two groups as indicated in the grouping variable. The arguments reference_gene and reference_control are used to construct the comparison in a similar way they when the relative expression was calculated.

  1. Locate and save the filepath to ct4.csv from the pcr package using the system.file() function

  2. Make grouping variable for the statistical tests between groups control and treatment, 12 of each.

  3. Run an initial analysis using the pcr_analyze function from the pcr package to find out the relative expression for the controls and treated samples, respectively. What is the relative expression of the controls and treated samples?

  4. Now run the analyses with firstly the options t.test and secondly wilcox.test and note the difference in your report.

**Q5. Name the main reason to use a Wilcoxon test instead of a T-test. (Hint: What is one of the assumptions of the t-test?) **

  1. When using the t.test what does the estimate represent (Hint: type ?t.test and look for estimate under the value section).

  2. If you haven’t already done it, save your script for future use. Also check if you have enough comments that will help you understand the code later.



Developed by Björn Andersson, 2019.

⚠️ **GitHub.com Fallback** ⚠️