Git Product home page Git Product logo

ddpcrclust's Introduction

ddPCRclust

A package for automated quantification of multiplexed ddPCR data.

This R package was designed to automatically quantify the events of a multiplexed ddPCR reaction. During a ddPCR run, each marker gene is fluorescently labeled with a combination of FAM and/or HEX fluorophore, giving it a unique footprint in the two-dimensional space represented by the intensities for each color channel. The position of each droplet within this space reveals, how many and, more importantly, which marker genes it contains. Thus, droplets that belong to the same marker cluster together. However, correctly identifying and labelling these clusters is not trivial, since one droplet can contain more than one marker. To accurately quantify the droplet count for each marker, it is crucial to both identify the clusters and label them correctly, based on their position.

Example B1 Example G1

For robustness, ddPCRclust incorporates adapted versions of three established, independent clustering algorithms: the flowDensity algorithm, published in 2012 by M. Jafar Taghiyar and Mehrnoush Malek, the clustering algorithm SamSPECTRAL, a version of spectral clustering adapted to flow cytometry data and the flowPeaks package, developed by Yongchao Ge and Stuart C. Sealfon. The results are combined into a cluster ensemble. This enhances the precision and the agreement between the three approaches provides a measure of confidence for clustering results.

Result B1 Example G1

Installation

The package can be installed from Bioconductor (recommended).

## try http:// if https:// URLs are not supported
source("https://bioconductor.org/biocLite.R")
biocLite("ddPCRclust")

Alternatively, you can also install this package like any other package from GitHub using devtools or by downloading the archive.
Disclaimer: This method currently only works, when the GNU Scientific Library (GSL) is installed on your machine, because one of the dependencies (flowPeaks) needs it in order to compile.

library(devtools)
install_github("bgbrink/ddPCRclust")

Usage

This package was written in close cooperation with the BC Cancer Agency in Vancouver, Canada. Please read their recently published manuscript for details on the background and how to produce the necessary data.

The raw data should be csv files. Each file represents a two-dimensional data frame. Each row within the data frame represents a single droplet, each column the respective intensities per colour channel:

Ch1 Amplitude Ch2 Amplitude
2360.098 6119.26953
2396.3916 1415.31665
2445.838 6740.79639
2451.63867 1381.74683
2492.55884 1478.19617
2519.6355 7082.25049

Since one experiment most likely consists of many different files, naming them apropriately is important in order to keep things organized. We chose to use a unique identifier in each filename of the form "^[[:upper:]][[:digit:]][[:digit:]]$" (A01, A02, A03, B01, B02, ...), which is usually included automatically by the ddPCR machine. A set of eight example files is included in this package.

In order to use all functions of this package, it is also necessary to create a template with more information about this experiment. The template has to be a csv file with a header, which contains information about each of the raw data files according to their unique identifier, as explained above. A template for the eight example files is also included in this package.

> Name of your experiment, channel1=HEX, channel2=FAM, annotations(date, experimentor, etc)

Well Sample type No of markers Marker 1 Marker 2 Marker 3 Marker 4
B01 Blood 4 a b c d
G01 FFPE 4 a b c d
F02 Blood 3 a c d
D03 FFPE 3 a c d
A04 FFPE 4 a b c d
G07 Cell line 3 a c d
G08 Cell line 3 a c d
E09 FFPE 2 c d

Example Files

We provide eight examplary ddPCR files under ddPCRclust/inst/extdata/

Run the algorithm using the provided examples with the following command:

# Read files
exampleFiles <- list.files(paste0(find.package('ddPCRclust'), '/extdata'), full.names = TRUE)
files <- readFiles(exampleFiles[3])
# To read all example files uncomment the following line
# files <- readFiles(exampleFiles[1:8])

# Read template
template <- readTemplate(exampleFiles[9])

# Run ddPCRclust
result <- ddPCRclust(files, template)

# Plot the results
library(ggplot2)
p <- ggplot(data = result$B01$data, mapping = aes(x = Ch2.Amplitude, y = Ch1.Amplitude))
p <- p + geom_point(aes(color = factor(Cluster)), size = .5, na.rm = TRUE) +
  ggtitle('B01 example')+theme_bw() + theme(legend.position='none')

All functions are documented. You can find additional information using the help function of R: ?ddPCRclust

Reference

Brink, Benedikt G., et al. "ddPCRclust: An R package and Shiny app for automated analysis of multiplexed ddPCR data." Bioinformatics (2018).

https://www.ncbi.nlm.nih.gov/pubmed/29534153

License

ddPCRclust is licensed under the Artistic License 2.0.

ddpcrclust's People

Contributors

bgbrink avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ddpcrclust's Issues

Error when using template

Hello! I've created my template according to the example, but when I try

    result <- ddPCRclust(experiment1files , experiment1template)

I get the following error:

Error in [.data.frame(template$template, which(template$template[, 1] == :
undefined columns selected

My R is version 3.6.

My template is as follows:

image

And my data is as follows:
image

Empties in 3rd class

When the programs classifies a samples with only empty droplets, it classifies it in the '3rd marker'-class and not in the 'empties', despite the fluorescent signal being quite low. Off course, visual inspection will intercept this problem, but can this be tackled in an other way?

Nondescript Error during ddPCRclust step

Hi Benedikt,

I am receiving the below error when trying to run the main step:

results2 = ddPCRclust(files, template) Error in [.data.frame(template$template, which(template$template[, 1] == : undefined columns selected

My files and template files were accepted during the import step with no errors noted (after the fix from the other issue). I'll attach the updated template here again and an example file from the upload in case there is some problem with those. I ran the commands on the example data provided with no problems so I think the install worked properly.

Thanks for any assistance!

Todd
template_2.txt
20190328_Triplex_flavo_test_H02_Amplitude.txt

Template format example

Hello,

Really excited to start using this package for some of our multiplexed ddPCR data. Did have a quick question regarding acceptable template format.

I'm receiving the below error when I try to import my template:
> template = readTemplate(file_list[9]) Error in readTemplate(file_list[9]) : Invalid Template file! This file starts with: ,Well,Samp

I know that the package comes supplied with a template example but I am unsure how to view this in Excel or some other format where I can model/check my template file against. Would a csv file "template for the template" be able to be provided on this github page? This might be helpful for other users as I felt my file matched what was specified in the vignette but clearly I was wrong. I also attached the template file I am attempting to import (attached as a .txt as github does not support .csv).
Combined Probe Experiments.txt

Thanks again for producing this package and looking forward to working with it!

Todd Testerman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.