COMPASSContainerFromGatingSet {COMPASS} | R Documentation

## Create a COMPASS Container from a GatingSet

### Description

This code expects a `GatingSet` or `GatingSetList`. It expects a regular expression for the node name (i.e. '/4\+$' would match '/4+' in a node name with the plus sign at the end of the string. Alternatively, you can supply a partial path. The user must supply the 'individual_id', which has the default value suitable for the data we commonly see. 'sample_id' is the 'rownames' of 'pData' of 'GatingSet'. Sometimes the child node names don't match the marker names exactly. This function will try to make some guesses about how to match these up. The `filter.fun` parameter is a function that does some regular expression string substitution to try and clean up the node names by removing various symobls that are often added to gates, {+/-}. The user can provide their own function to do string cleanup. Counts are extracted as well as metadata and single cell data, and these are fed into the `COMPASSContainer` constructor.

### Usage

    COMPASSContainerFromGatingSet(gs = NULL, node = NULL, filter.fun = NULL,
      individual_id = "PTID", mp = NULL, matchmethod = c("Levenshtein",
      "regex"), markers = NA, swap = FALSE, countFilterThreshold = 5000)

### Arguments

`gs` | a `GatingSet` or `GatingSetList`
`node` | a `regular expression` to match a single node in the gating tree. If more than one node is matched, an error is thrown.
`filter.fun` | a `function` that does string substitution to clean up node names, i.e. turns a 'CD4+' into a 'CD4' to try and match against the `parameters` slot of the `flowFrames` in `gs`
`individual_id` | a `character` identifying the subject id column in the `gs` metadata
`mp` | a `list` mapping node names to markers. This function tries to guess, but may fail. The user can override the guesswork.
`matchmethod` | a `character` either 'regex' or 'Levenshtein' for matching nodes to markers.
`markers` | a `character` vector of marker names to include.
`swap` | a `logical` default FALSE. Set to TRUE if the marker and channel names are swapped.
`countFilterThreshold` | `numeric` threshold. if the number of parent cells is less than this threshold, we remove that file. Default is 5000.

### Details

There is likely not sufficient error checking.

### See Also

`COMPASSContainer`

### Examples

    ## Not run:
    ## gs is a GatingSet from flowWorkspace
    COMPASSContainerFromGatingSet(gs, "4+")

    ## End(Not run)

[Package COMPASS version 1.18.1 Index]