sub.samples: Reduce the nummber of events of a 'fcs.SCE' object

sub.samplesR Documentation

Reduce the nummber of events of a fcs.SCE object

Description

It generates reduce randomly the number of events of a fcs.SCE object (it computes this reduction for each FCS file separatelly inside this object). It can generate a new reduced fcs.SCE object or a simple index position for removing events.

Usage

sub.samples(fcs.SCE, subsampling = 1000, index = F, unbalanced = NULL)

Arguments

fcs.SCE

A fcs.SCE object generated through FlowCT::fcs.SCE().

subsampling

Number of events to keep (in each FCS file contained within the fcs.SCE object). If indicated value is between 0 and 1, it will considered as a percentage to keep instead an absolute number. Default = 1000.

index

Logical indicating if returning an fcs.SCE object or a index vector. Default = FALSE.

unbalanced

If indicated, subsampling will be applied in a "unbalanced" way, i.e., only in the specified element in a given column. Its format is a vector containing the column name to reduce and the element within that column to be subsampled. It is very IMPORTANT keep in mind this subsampling is only for visualization purposes, not for downstream statistical analysis. Default = NULL.

Examples

## Not run: 
# option 1, simple subsampling
fcs_red <- sub.samples(data = fcs, subsampling = 1000)

# option 2, return the subsampling index
keep_red <- sub.samples(data = fcs, subsampling = 1000, index = T)
fcs_red <- fcs[,keep_red]

# option 3, unbalanced subsampling (in percentaje way)
fcs_red <- sub.samples(data = fcs, subsampling = 0.3, unbalanced = c("condition", "not_progressed")

## End(Not run)

jgarces02/FlowCT documentation built on March 28, 2023, 12:42 p.m.