View source: R/flowJoWorkspace_Methods.R
parseWorkspace | R Documentation |
Function to parse a flowJo Workspace, generate a GatingHierarchy
or GatingSet
object, and associated flowCore gates. The data are not loaded or acted upon until an explicit call to recompute()
is made on the GatingHierarchy
objects in the GatingSet
.
parseWorkspace(obj, ...)
## S4 method for signature 'flowjo_workspace'
parseWorkspace(obj, ...)
flowjo_to_gatingset(
ws,
name = NULL,
subset = list(),
execute = TRUE,
path = "",
cytoset = NULL,
backend_dir = tempdir(),
backend = get_default_backend(),
includeGates = TRUE,
additional.keys = "$TOT",
additional.sampleID = FALSE,
keywords = character(),
keywords.source = "XML",
keyword.ignore.case = FALSE,
extend_val = 0,
extend_to = -4000,
channel.ignore.case = FALSE,
leaf.bool = TRUE,
include_empty_tree = FALSE,
skip_faulty_gate = FALSE,
compensation = NULL,
transform = TRUE,
fcs_file_extension = ".fcs",
greedy_match = FALSE,
mc.cores = 1,
...
)
obj |
flowjo_workspace |
... |
Additional arguments to be passed to FCS parser |
ws |
A |
name |
|
subset |
|
execute |
|
path |
either a |
cytoset |
a |
includeGates |
|
additional.keys |
|
additional.sampleID |
|
keywords |
|
keywords.source |
|
keyword.ignore.case |
a |
extend_val |
|
extend_to |
|
channel.ignore.case |
a |
leaf.bool |
a |
include_empty_tree |
a |
skip_faulty_gate |
a |
compensation |
a |
transform |
|
fcs_file_extension |
default is ".fcs" |
greedy_match |
|
mc.cores |
|
h5_dir |
the path to write h5 data |
A flowjo_workspace is generated with a call to open_flowjo_xml()
, passing the name of the xml workspace file. This returns a flowjo_workspace
, which can be parsed using the flowjo_to_gatingset()
method. The function can be called non-interactively by passing the index or name of the group of samples to be imported via flowjo_to_gatingset(obj,name=x)
, where x
is either the numeric index, or the name.
The subset
argument allows one to select a set of files from the chosen sample group. The routine will take the intersection of the files in the sample group, the files specified in subset
and the files available on disk, and import them.
a GatingSet
, which is a wrapper around a list of GatingHierarchy
objects, each representing a single sample in the workspace. The GatingHierarchy
objects contain graphNEL
trees that represent the gating hierarchy of each sample. Each node in the GatingHierarchy
has associated data, including the population counts from flowJo, the parent population counts, the flowCore
gates generated from the flowJo workspace gate definitions. Data are not yet loaded or acted upon at this stage. To execute the gating of each data file, a call to execute()
must be made on each GatingHierarchy
object in the GatingSet
. This is done automatically by default, and there is no more reason to set this argument to FALSE.
fj_ws_get_sample_groups
,GatingSet
## Not run:
#f is a xml file name of a flowJo workspace
ws <- open_flowjo_xml(f)
#parse the second group
gs <- flowjo_to_gatingset(ws, name = 2); #assume that the fcs files are under the same folder as workspace
gs <- flowjo_to_gatingset(ws, name = 4
, path = dataDir #specify the FCS path
, subset = "CytoTrol_CytoTrol_1.fcs") #subset the parsing by FCS filename
gs <- flowjo_to_gatingset(ws, path = dataDir, name = 4
, keywords = c("PATIENT ID", "SAMPLE ID", "$TOT", "EXPERIMENT NAME") #tell the parser to extract keywords as pData
, keywords.source = "XML" # keywords are extracted from xml workspace (alternatively can be set to "FCS")
, additional.keys = c("PATIENT ID") #use additional keywords together with FCS filename to uniquely identify samples
, execute = F) # parse workspace without the actual gating (can save time if just want to get the info from xml)
#subset by pData (extracted from keywords)
gs <- flowjo_to_gatingset(ws, path = dataDir, name = 4
, subset = `TUBE NAME` %in% c("CytoTrol_1", "CytoTrol_2")
, keywords = "TUBE NAME")
#overide the default compensation defined in xml with the customized compenstations
gs <- flowjo_to_gatingset(ws, name = 2, compensation = comps); #comp is either a compensation object or a list of compensation objects
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.