This package will help you to analyze the output of the Fluidigm digital real time qPCR machine to inspect gene expression. You can do this with a simple workflow, that will be explained in detail further down this document.

Setup

library(fluidgr)
library(magrittr)
library(dplyr)
library(stringr)

Simple Workflow

Record the path to your fluidigm CSV data and the name of your reference normalizers.

path_to_data <- system.file("extdata", "sample-fluidigm-run.csv",
                            package = "fluidgr",
                            mustWork = TRUE)

normalizers <- c("normalizer1",
                 "normalizer2",
                 "normalizer3")

Parse them, normalize them and scale them in a magrittr pipe.

fluidigm_data <- 
  path_to_data %>%
  read_fluidigm() %>%
  normalize() %>%
  scale_fluidigm()

And your data are ready to be saved on disk or plotted with ggplot2.

In the next paragraphs you'll find this same workflow explained in details.

Load your data into R

You can start by loading the output of the Fluidigm digital real time qPCR machine into R. This output is in a standard CSV format with a 10 lines header and triple column names, you can find an example of such file here.

Access the path to that sample CSV file in R with:

path_to_data <- system.file("extdata", "sample-fluidigm-run.csv",
                            package = "fluidgr",
                            mustWork = TRUE)

And load it with the funciton read_fluidigm(). Use simplify = TRUE if you want to keep only the columns that are strictly necessary.

dat <- read_fluidigm(path = path_to_data,
                     simplify = TRUE)

Tidy your Data

After you have parsed the data, you can modify them as you wish using dplyr.

Remove samples

For example, you might want to remove selected samples:

Our example dataset contains samples that are dilution used for calibration curves.

dat$sample_name %>% unique()

Those samples, all have the word "Mix" in their name, and can be removed with:

dat <- 
  dat %>%
  filter(!sample_name %>% str_detect("Mix"))

One sample "H2O" is a negative control, it also can be removed:

dat <- 
  dat %>%
  filter(sample_name != "H20")

Check measurements per sample

You can check that each sample has been measured the same number of times:

dat$sample_name %>% table()
dat$sample_name %>% table() %>% unique()

Check for duplicated targets

Also, one of the target is a duplicated normalizer. You can remove it with:

dat$target_name %>% unique()

dat <- 
  dat %>%
  filter(target_name != "normalizer1bis")

Load data manually

You can load the digital qPCR gene expression data manually with your favourite functions, and store them as a tibble or a data.frame in R.

For the analysis downstream, three columns are essential:

Normalize

You must provide the names of the normalizers exactly as they are stored in the target_name column. In this case the name of the normalizers is: normalizer1, normalizer2 and normalizer3.

normalizers <- c("normalizer1",
                 "normalizer2",
                 "normalizer3")

norm_dat <- 
  dat %>% 
  normalize(normalizers = normalizers) 

The normalize() function takes the data parsed by read_fluidigm() as object and returns the same data with two additional columns:

Expression values are normalized with the formula:

$$expression = 2^{-(C_T - C_Tnorm)}$$

Where, for each well, $C_T$ is the recorded threshold cycle (ct_value) and $C_Tnorm$ is the geometric mean of the normalizers C~T~ values.

This formula is a simplification of the common $2^{ - \Delta \Delta Ct}$ formula that skips calibration.

This is how your data should look after normalization:

norm_dat %>% head() %>% knitr::kable()

Session Info

devtools::session_info()


othomantegazza/fluidgr documentation built on May 24, 2019, 8:54 a.m.