Learn R Programming

ddpcr (version 1.15.2)

subset.ddpcr_plate: Subsetting a ddPCR plate

Description

Select specific wells or samples from a ddPCR plate.

Usage

# S3 method for ddpcr_plate
subset(x, wells, samples, targets_ch1, targets_ch2, ...)

Value

Plate with data only from the specified wells/samples.

Arguments

x

The ddPCR plate to subset from.

wells

Vector or range notation of wells to select (see Range Notation section for more information).

samples

Vector of sample names to select.

targets_ch1

Vector of target names in channel 1 to select.

targets_ch2

Vector of target names in channel 2 to select.

...

Ignored

Range notation

The most basic way to select wells is to provide a vector of wells such as c("B03", "C12"). When selecting wells, a special range notation is supported to make it easier to select many wells: use a colon (:) to specify a range of wells, and use a comma (,) to add another well or range. When specifying a range, all wells in the rectangular area between the two wells are selected. For example, B04:D06 is equivalent to B04, B05, A05, C04, C05, C06, D04, D05, D06. You can combine multiple ranges in one selection; see the Examples section below. Note that this notation is only supported for the wells parameter, but not for the samples parameter.

Details

Keeps only data from the selected wells. If sample names are provided instead of well IDs, then any well corresponding to any of the sample names will be kept. Either well IDs or sample names must be provided, but not both.

Examples

Run this code
plate <- new_plate(sample_data_dir())
plate %>% wells_used
plate %>% subset("C01") %>% wells_used
plate %>% subset(c("C01", "F05")) %>% wells_used
plate %>% subset("C01, F05") %>% wells_used
plate %>% subset("C01:F05") %>% wells_used
plate %>% subset("C01:F05, A01") %>% wells_used
plate %>% subset("A01:C03") %>% wells_used
plate %>% subset("A01:C05") %>% wells_used
plate %>% subset("A01, A05:F05") %>% wells_used
plate %>% subset("A01, A05:C05, F05") %>% wells_used
plate %>% subset("A01:A05, C01:C05, F05") %>% wells_used
plate %>% subset(samples = "Dean") %>% wells_used
plate %>% subset(samples = c("Dean", "Mike")) %>% wells_used

Run the code above in your browser using DataLab