This non-parameter filter selects a number of events from the primary flowFrame.

sampleFilter(size, filterId="defaultSampleFilter")

Arguments

filterId

An optional parameter that sets the filterId of this filter. The object can later be identified by this name.

size

The number of events to select.

Value

Returns a sampleFilter object for use in filtering flowFrames or other flow cytometry objects.

Details

Selects a number of events without replacement from a flowFrame.

Slots

size

Object of class "numeric". Then number of events that are to be selected.

filterId

A character vector that identifies this filter.

Extends

Class "concreteFilter", directly.

Class "filter", by class concreteFilter, distance 2.

Objects from the Class

Objects can be created by calls of the form new("sampleFilter", ...) or using the constructor sampleFilter. The latter is the recommended way.

Methods

%in%

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.

show

signature(object = "sampleFilter"): Print information about the gate.

See also

flowFrame, filter for evaluation of sampleFilters and split and Subsetfor splitting and subsetting of flow cytometry data sets based on that.

Examples

## 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
## Filtering using sampleFilters fres <- filter(dat, sf) fres
#> A filterResult produced by the filter named 'mySampleFilter'
summary(fres)
#> mySampleFilter+: 500 of 10000 events (5.00%)
## The result of sample filtering is a logical subset Subset(dat, fres)
#> 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 #>