denseRegions {beadarray} | R Documentation

## Find Dense Regions of Points (as used in diffuse defect analysis).

### Description

Given a list of beads, this function finds dense regions of beads on the list.

### Usage

    denseRegions(IDs, neighbours, ignore = NULL, sig = 0.0001, invasions = 10)

### Arguments

`IDs` | Vector - IDs of beads to find dense regions of.
`neighbours` | A Neighbours matrix - obtained from `generateNeighbours`.
`ignore` | Vector - IDs of beads to be ignored during this process.
`sig` | Significance of the Binomial test performed within each kernel.
`invasions` | Integer - No of invasions used to generate the kernel.

### Details

This function, given a list of bead IDs, finds regions where these marked beads are denser.

To do this, we use a "sliding kernel" technique. For each bead, we find the "kernel", a local neighbourhood of beads, obtained via invasion along links defined in the neighbours matrix. We count the number of beads in the kernel, and we also count how many of these are beads are marked. Now we test the density of this region with a binomial test.

Assuming that we expect the marked beads to be evenly distributed across the array, then the number of marked beads in the kernel should have distibution Bin(n,p) under the null hypothesis, where n is the total number of beads in the kernel, and p is the proportion of marked beads on the entire array. We test this hypothesis at a level defined by `sig`, and on rejection of the null hypothesis we label the kernel's central bead as being part of a dense region. This is performed for the kernel about each bead.

If `ignore` is specified, then these beads will be completely removed before analysis. Any links attached to a removed bead are severed.

### Value

Vector - IDs of beads in dense regions.

### Author(s)

Jonathan Cairns

### See Also

`generateNeighbours`, `BASHDiffuse`

### Examples

    data(BLData)
    E <- generateE(BLData,1)
    E <- generateE(BLData,1, invasions = 10) #reduced no of invasions to increase speed.
    E <- generateE(BLData,1, bgfilter = "none") #residuals (median)

[Package beadarray version 1.10.0 Index]