sampleFilter-class.RdThis non-parameter filter selects a number of events from the primary
flowFrame.
sampleFilter(size, filterId="defaultSampleFilter")
| filterId | An optional parameter that sets the |
|---|---|
| size | The number of events to select. |
Returns a sampleFilter object for use in filtering
flowFrames or other flow cytometry objects.
Selects a number of events without replacement from a flowFrame.
sizeObject of class "numeric". Then number of
events that are to be selected.
filterIdA character vector that identifies this
filter.
Class "concreteFilter", directly.
Class "filter", by class concreteFilter,
distance 2.
Objects can be created by calls of the form new("sampleFilter",
...) or using the constructor sampleFilter. The latter is the
recommended way.
signature(x = "flowFrame", table =
"sampleFilter"): The workhorse used to evaluate the gate on
data. This is usually not called directly by the user, but
internally by calls to the filter methods.
signature(object = "sampleFilter"): Print
information about the gate.
flowFrame, filter for evaluation of
sampleFilters and split and Subsetfor
splitting and subsetting of flow cytometry data sets based on that.
## Loading example data dat <- read.FCS(system.file("extdata","0877408774.B08", package="flowCore")) #Create the filter sf <- sampleFilter(filterId="mySampleFilter", size=500) sf#> sample filter 'mySampleFilter' returning objects with 500 rows#> A filterResult produced by the filter named 'mySampleFilter'summary(fres)#> mySampleFilter+: 500 of 10000 events (5.00%)#> flowFrame object '0877408774.B08' #> with 500 cells and 8 observables: #> name desc range minRange maxRange #> $P1 FSC-H FSC-H 1024 0.000000 1023 #> $P2 SSC-H SSC-H 1024 0.000000 1023 #> $P3 FL1-H <NA> 1024 1.009044 10000 #> $P4 FL2-H <NA> 1024 1.009044 10000 #> $P5 FL3-H <NA> 1024 1.009044 10000 #> $P6 FL1-A <NA> 1024 0.000000 1023 #> $P7 FL4-H <NA> 1024 1.009044 10000 #> $P8 Time Time (51.20 sec.) 1024 0.000000 1023 #> 164 keywords are stored in the 'description' slot## We can also split, in which case we get those events in and those ## not in the gate as separate populations split(dat, fres)#> $`mySampleFilter+` #> flowFrame object '0877408774.B08 (mySampleFilter+)' #> with 500 cells and 8 observables: #> name desc range minRange maxRange #> $P1 FSC-H FSC-H 1024 0.000000 1023 #> $P2 SSC-H SSC-H 1024 0.000000 1023 #> $P3 FL1-H <NA> 1024 1.009044 10000 #> $P4 FL2-H <NA> 1024 1.009044 10000 #> $P5 FL3-H <NA> 1024 1.009044 10000 #> $P6 FL1-A <NA> 1024 0.000000 1023 #> $P7 FL4-H <NA> 1024 1.009044 10000 #> $P8 Time Time (51.20 sec.) 1024 0.000000 1023 #> 164 keywords are stored in the 'description' slot #> #> $`mySampleFilter-` #> flowFrame object '0877408774.B08 (mySampleFilter-)' #> with 9500 cells and 8 observables: #> name desc range minRange maxRange #> $P1 FSC-H FSC-H 1024 0.000000 1023 #> $P2 SSC-H SSC-H 1024 0.000000 1023 #> $P3 FL1-H <NA> 1024 1.009044 10000 #> $P4 FL2-H <NA> 1024 1.009044 10000 #> $P5 FL3-H <NA> 1024 1.009044 10000 #> $P6 FL1-A <NA> 1024 0.000000 1023 #> $P7 FL4-H <NA> 1024 1.009044 10000 #> $P8 Time Time (51.20 sec.) 1024 0.000000 1023 #> 164 keywords are stored in the 'description' slot #>