scale_gate {flowWorkspace} | R Documentation

## Simplified geometric scaling of gates associated with nodes

### Description

Simplified geometric scaling of gates associated with nodes

### Usage

    ## S3 method for class 'GatingHierarchy'
    scale_gate(obj, y, scale = NULL, ...)

    ## S3 method for class 'GatingSet'
    scale_gate(obj, y, scale = NULL, ...)

### Arguments

`obj` | A `GatingHierarchy` or `GatingSet` object
`y` | A character specifying the node whose gate should be modified
`scale` | Either a numeric scalar (for uniform scaling in all dimensions) or numeric vector specifying the factor by which each dimension of the gate should be expanded (absolute value > 1) or contracted (absolute value < 1). Negative values will result in a reflection in that dimension.
`...` | not used

### Details

This method allows uniform or non-uniform geometric scaling of filter types defined by simple geometric gates (`quadGate`, `rectangleGate`, `ellipsoidGate`, and `polygonGate`) Note that these methods are for manually altering the geometric definition of a gate. To easily transform the definition of a gate with an accompanyging scale transformation applied to its underlying data, see ?ggcyto::rescale_gate.

The `scale` argument passed to `scale_gate` should be either a scalar or a vector of the same length as the number of dimensions of the gate. If it is scalar, all dimensions will be multiplicatively scaled uniformly by the scalar factor provided. If it is a vector, each dimension will be scaled by its corresponding entry in the vector.

The scaling behavior of `scale_gate` depends on the type of gate passed to it. For `rectangleGate` and `quadGate` objects, this amounts to simply scaling the values of the 1-dimensional boundaries. For `polygonGate` objects, the values of `scale` will be used to determine scale factors in the direction of each of the 2 dimensions of the gate (`scale_gate` is not yet defined for higher-dimensional `polytopeGate` objects). Important: For `ellipsoidGate` objects, `scale` determines scale factors for the major and minor axes of the ellipse, in that order. Scaling by a negative factor will result in a reflection in the corresponding dimension.

### See Also

transform_gate `flowCore::scale_gate`

### Examples

    ## Not run:
    # Scales both dimensions by a factor of 5
    scale_gate(gs, node, 5)

    # Shrinks the gate in the first dimension by factor of 1/2
    # and expands it in the other dimension by factor of 3
    scale_gate(gs, node, c(0.5,3))

    ## End(Not run)

[Package flowWorkspace version 3.32.0 Index]