Learn R Programming

dpcR (version 0.1.2-1)

test_panel: Dispersion Test for Spatial Point Pattern in Array dPCR Based on Quadrat Counts

Description

The function test_panel is a convenient wrapper around quadrat.test function. Under optimal conditions, the point pattern of dPCR events (e.g., positive droplet & negative droplets). This function can be used to analyze if the pattern on a planar chip is random. Arrays with non-random patterns should be checked for integrity.

Usage

test_panel(X, nx_a, ny_a, nx = 5, ny = 5, 
           alternative = c("two.sided", "regular", "clustered"),
           method = c("Chisq", "MonteCarlo"), conditional = TRUE, nsim = 1999)

Arguments

X
Object of the adpcr class containing data from one or more panels.
nx_a
Number of columns in a plate.
ny_a
Number of rows in a plate.
nx
Numbers of quadrats in the x direction.
ny
Numbers of quadrats in the y direction.
alternative
Character string (partially matched) specifying the alternative hypothesis.
method
Character string (partially matched) specifying the test to use: either method="Chisq" for the chi-squared test (the default), or method="MonteCarlo" for a Monte Carlo test.
conditional
Logical. Should the Monte Carlo test be conducted conditionally upon the observed number of points of the pattern? Ignored if method="Chisq".
nsim
The number of simulated samples to generate when method="MonteCarlo".

Value

  • An list of objects of class "htest" with the length equal to the number of plates (minimum 1).

Details

This function quick-to-use version of quadrat.test function. It works directly on the objects of adpcr. test_panel performs a test of Complete Spatial Randomness for each plate.

References

http://www.spatstat.org/

See Also

quadrat.test.

Examples

Run this code
many_panels <- sim_adpcr(m = 400, n = 765, times = 1000, pos_sums = FALSE, 
                   n_panels = 5)
test_panel(many_panels, nx_a = 45, ny_a = 17)

#test only one plate
test_panel(extract_dpcr(many_panels, 3), nx_a = 45, ny_a = 17)

#do test_panel manually
require(spatstat)
ppp_data <- adpcr2ppp(many_panels, nx_a = 45, ny_a = 17)
lapply(ppp_data, function(single_panel) quadrat.test(single_panel))

Run the code above in your browser using DataLab