Learn R Programming

dpcR (version 0.1.2-1)

create_dpcr: Create dpcR object

Description

Quick creation of adpcr andddpcr objects.

Usage

create_dpcr(data, n, threshold = NULL, breaks = NULL, type, adpcr = TRUE)

Arguments

data
a "numeric" vector or matrix of data from dPCR experiments. Data frames will be converted to matrices.
n
"integer" equal to number of partitions.
threshold
"numeric" value giving the threshold above which droplet is counted as positive. Ignored if adpcr is TRUE.
breaks
"numeric" vector giving the number of intervals into which data should be cut. Ignored if adpcr is FALSE.
type
Object of class "character" defining type of data. Could be "nm" (number of molecules per partition), "tp" (total number of positive wells in panel), "fluo" (fluorescence) or "ct"
adpcr
logical. If TRUE, function creates adpcr object. If FALSE, function creates ddpcr object.

Value

  • An adpcr or ddpcr object.

Details

This function assists in creation of objects used by other functions of the package. Its in build capabilities include checking the correctness of arguments.

A warning is prompted whenever any of arguments is converted to other type.

Examples

Run this code
# Droplet digital PCR example
sample_runs <- matrix(rpois(60, lambda = 1.5), ncol = 2)
ddpcr1 <- create_dpcr(sample_runs[,1], n = 30L, 
threshold = 1, type = "nm", adpcr = FALSE)
ddpcr2 <- create_dpcr(sample_runs[,2], n = 30L, 
threshold = 1, type = "nm", adpcr = FALSE)
plot_vic_fam(ddpcr1, ddpcr2)

# Array digital PCR example
sample_adpcr <- create_dpcr(rpois(765, lambda = 0.8), n = 765L, 
			    type = "nm", adpcr = TRUE)
plot_panel(sample_adpcr, 45, 17)

Run the code above in your browser using DataLab