Apply autofluorescence correction to a set of fluorescence channels.
estimate()function loads a separate FCS file (not part of the input
Experiment) and computes the untransformed median and standard deviation of the blank cells. Then,
apply()subtracts the median from the experiment data.
apply()also adds the
af_stdevmetadata to the corrected channels, representing the median and standard deviation of the measured blank distributions.
The channels to correct.
The filename of a file with “blank” cells (not fluorescent). Used to
Occasionally, you’ll need to specify the experimental conditions that the blank tube was collected under (to apply the operations in the history.) Specify them here.
Create a small experiment:
>>> import cytoflow as flow >>> import_op = flow.ImportOp() >>> import_op.tubes = [flow.Tube(file = "tasbe/rby.fcs")] >>> ex = import_op.apply()
Create and parameterize the operation
>>> af_op = flow.AutofluorescenceOp() >>> af_op.channels = ["Pacific Blue-A", "FITC-A", "PE-Tx-Red-YG-A"] >>> af_op.blank_file = "tasbe/blank.fcs"
Estimate the model parameters
Plot the diagnostic plot
Apply the operation to the experiment
>>> ex2 = af_op.apply(ex)
- experiment (Experiment) – The experiment to which this operation is applied
- subset (str (default = “”)) – An expression that specifies the events used to compute the autofluorescence
Applies the autofluorescence correction to channels in an experiment.
Parameters: experiment (Experiment) – the experiment to which this op is applied Returns: a new experiment with the autofluorescence median subtracted. The corrected channels have the following metadata added to them:
- af_median : Float The median of the non-fluorescent distribution
- af_stdev : Float The standard deviation of the non-fluorescent distribution
Return type: Experiment
Plots a histogram of each channel, and its median in red. Serves as a diagnostic for the autofluorescence correction.
Plot a faceted histogram view of a channel