Description Usage Arguments Details Value See Also Examples
This function replaces flowStats::rangeGate()
which never seemed to
work for me. It does not perform all the functions of the original
but will return a mores sensible rectangleGate
object more
often than flowStats::rangeGate()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
fs |
A |
stain |
A |
from, to |
Starting and ending values to search for the break |
cutoff |
Peaks and valleys smaller than this fraction of the range will be ignored, default value of 0.05 |
adjust |
Adjustment to bandwidth used by |
half.range |
If |
sd |
In the case of a single population, this is the multiplier for the standard deviation to estimate the upper edge of the negative population, default value of 2.5 |
positive |
If |
method |
Either |
plot |
If |
legend |
If |
filterId |
The name assigned to the filter ( |
... |
Other arguments to the original function are accepted
such as |
This is a replacement function for flowStats::rangeGate that may be more robust than the original function.
This function seeks the most likely breakpoint between two populations to differentiate between the positive and negative population. The "negative" population is assumed to have a lower values and would be located on the left of a histogram.
The default method (method = "minimum"
) attempts to identify the
lowest minimum between the regions of greatest density or peaks on
a densityplot. The search can be limited to values between from
and
to
. If more than four high density regions exist or if only a
single high density region is detected, the breakpoint will be
determined from the properties of the leftmost population where this
population is assumed to follow a normal distribution. This approach
also can be specified directly by method = "left"
as described
below.
With method = "left"
, the maximum of the left most (minimum)
population is determined from a kernel density estimate. If
half.range = TRUE
, the left half of the population will be used to
determine the Gaussian distribution in order to estimate the standard
deviation of the population. With method = "left"
, the value returned
is the position of the peak + sd
times the standard deviation of the
distribution.
A diagnostic plot will be generated with base graphics if plot = TRUE
.
In this case, the default argument legend = TRUE
will add
an informative legend to the plot showing the data and breakpoint. The
plotting option can be useful to iteratively adjust the search parameters
such as adjust
, from
, to
and sd
.
An object of class flowCore::rectangleGate
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Read and clean up synchronized cell data
fs <- readSet(system.file("extdata", "synch", package = "flowExtra"))
fs <- Subset(fs, linearGate(fs, "FL2.A", "FL2.H"))
# breakpoint by default (method = "minimum")
rangeGate2(fs[[8]], "FL2.A", plot = TRUE)
# breakpoint by left population (method = "left")
rangeGate2(fs[[8]], "FL2.A", method = "left", plot = TRUE)
# puzzling choice with original rangeGate() function
flowStats::rangeGate(fs[[8]], "FL2.A", plot = TRUE)
# example of multiple possible breakpoints
rangeGate2(fs[[2]], "FL2.A", plot = TRUE)
# adjust by limiting search range with 'to'
rangeGate2(fs[[2]], "FL2.A", plot = TRUE, to = 275)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.