prepare.gating.set.list.4.compass: Prepare flow data for COMPASS

Description Usage Arguments Details Value Examples

View source: R/PrepareGatingSetList4Compass.R

Description

This function accepts GatingSets and/or reads in multiple FlowJo workspace xml files and their associated FCS files. It then combines them all into a single GatingSetList, extracting the user-provided keywords and checking that the batches are combine-able along the way. GatingSets should already have keywords. The final GatingSetList is saved to a user-provided output directory by default. You can then use it directly with COMPASS or modify it further.

Usage

1
2
3
4
5
prepare.gating.set.list.4.compass(xmlFiles = NULL, fcsFiles = NULL,
  gsDirs = NULL, gsList = list(), outDir = NULL,
  sampleGroups = NULL, keywords2import = c(),
  keyword4samples2exclude = NULL, samples2exclude = NULL,
  returnGSList = FALSE)

Arguments

xmlFiles

character vector (xmlFiles AND/OR gsDirs AND/OR gsList is required)

fcsFiles

(Optional) character vector. Only needed if fcs and xml files exist in different directories.

gsDirs

character vector (xmlFiles AND/OR gsDirs AND/OR gsList is required)

gsList

list of GatingSet objects (xmlFiles AND/OR gsDirs AND/OR gsList is required)

outDir

directory in which to save the final GatingSetList

sampleGroups

(Optional) numeric vector. Specify this if the flowJo sample group is not 3 for all batches.

keywords2import

(Optional) character vector. List of keywords to import from FlowJo workspace and into pData.

keyword4samples2exclude

(Optional) keyword used to identify samples for exclusion

samples2exclude

(Optional) character vector. When making GatingSetList, excludes samples whose keyword4samples2exclude column matches patterns in this vector (using 'grepl').

returnGSList

(Optional) Return the GatingSetList instead of saving it. Default FALSE

Details

Note 1: All the batches need to have the same gating tree, so this function will drop unshared nodes and channels from the batches to be merged. TODO: make option to turn off default Note 2: Marker names and channel names must all be the same across the batches.

Value

Nothing, or GatingSetList if requested

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
prepare.gating.set.list.4.compass(xmlFiles=c("/home/Batch1Files/Batch1FlowJoWorkspace.xml",
                                             "/home/Batch2Files/Batch2FlowJoWorkspace.xml",
                                             "/home/Batch3Files/Batch3FlowJoWorkspace.xml",
                                             "/home/Batch4Files/Batch4FlowJoWorkspace.xml"),
                                  outDir="/home/GatingSetListOutDir",
                                  keywords2import=c("Barcode", "Antigen", "PATIENT ID"),
                                  keyword4samples2exclude="Barcode",
                                  samples2exclude=c('1234567890', '1234567891', '1234567892', '1234567893', '1234567894'))
                                  
## End(Not run)
TODO: Write tests. - When keyword4samples2exclude and gsList and/or gsDirs are provided. - When keyword4samples2exclude and xmlFiles are provided

seshadrilab/COMPASSHelpers documentation built on May 6, 2019, 6:04 p.m.