processFlowjoExportDir: Function to batch process .csv files (containing the...

View source: R/processFlowjoExportDir.R

processFlowjoExportDirR Documentation

Function to batch process .csv files (containing the substring specified by 'csvstring') exported from flowjo within the directory specified by 'dir'. Directory must contain 'platesetupfile' (a tab-delimited .txt file) that contains column named IDvar (default to 'Sample') that should contain 96well ID's that are matched to the $FIL keyword in the .fcs file exported from the Attune. Outputs a tab-delimited .txt file with file name specified by 'fileout'. 2023-06-09 added fcsheader option to denote whether exported csv file contains FCS headers. if FALSE then will parse IDvar based removing csvstring from file name. Also modified flowjodf to allow input of IDvar argument.#' Process a directory of FlowJo Export files

Description

This function reads a directory of FlowJo Export csv files, asserts that there are matching files for all annotations, combines all the csv files into a single data frame, joins the combined data frame with a plate setup file (annotations), and writes the output to a text file. Warning: below generated roxygen documentation generated by chatgpt without checking

Usage

processFlowjoExportDir(
  dir,
  csvstring = "_P1.csv",
  fileout = "P1_combodf.txt",
  platesetupfile = "platesetup.txt",
  IDvar = "Sample",
  fcsheader = TRUE
)

Arguments

dir

A character string representing the directory that contains the FlowJo Export csv files.

csvstring

A character string representing the pattern to match in the csv file names (default = '_P1.csv').

fileout

A character string representing the output filename (default = 'P1_combodf.txt').

platesetupfile

A character string representing the plate setup file name (default = 'platesetup.txt').

IDvar

A character string representing the unique identifier variable/column name in the plate setup file (default = 'Sample').

fcsheader

A logical indicating whether the csv files have Flow Cytometry Standard (FCS) headers (default = TRUE).

Value

A data frame that contains the combined data of all csv files and annotations from the plate setup file. The output data frame is also written as a tab-delimited text file in the provided directory.

Examples

## Not run: 
  processFlowjoExportDir(dir = "path/to/your/directory", csvstring = '_P1.csv',
                         fileout = 'P1_combodf.txt', platesetupfile = 'platesetup.txt',
                         IDvar = 'Sample', fcsheader = TRUE)

## End(Not run)

chris-hsiung/bears01 documentation built on April 9, 2024, 2:01 a.m.