readFCS: FCS File Parser

View source: R/fcs.R

readFCSR Documentation

FCS File Parser

Description

Parse data from Flow Cytometry Standard (FCS) compliant files.

Usage

readFCS(
  fileName,
  options = list(header = list(start = list(at = 0, n = 6), space = list(at = 6, n =
    4), text_beg = list(at = 10, n = 8), text_end = list(at = 18, n = 8), data_beg =
    list(at = 26, n = 8), data_end = list(at = 34, n = 8)), apply_scale = TRUE, dataset =
    1, force_header = FALSE, text_only = FALSE, text_check = FALSE, text_empty = FALSE,
    text_trim = "none"),
  display_progress = TRUE,
  ...
)

Arguments

fileName

path to file.

options

list of options used to parse FCS file. It should contain (otherwise, it will be filled with the default values listed below):
- header, a list whose members define the "at" offset from header$start$at and the "n" number of bytes to extract:
– start: where to start reading current FCS dataset. Default is list(at = 0, n = 6),
– space: where to retrieve space. Default is list(at = 6, n = 4),
– text_beg: where to retrieve file text segment beginning. Default is list(at = 10, n = 8),
– text_end: where to retrieve file text segment end. Default is list(at = 18, n = 8),
– data_beg: where to retrieve file data segment beginning. Default is list(at = 26, n = 8),
– data_end: where to retrieve file data segment end. Default is list(at = 34, n = 8),
- apply_scale, whether to apply data scaling. It only applies when fcs file is stored as DATATYPE "I". Default is TRUE.
- dataset, (coerced to) an ordered vector of unique indices of desired dataset(s) to extract. Default is 1 to extract only the first dataset, whereas NULL allows to extract all available datasets.
- force_header, whether to force the use of header to determine the position of data segment. Default is FALSE, for using positions found in "$BEGINDATA" and "$ENDDATA" keywords.
- text_only, whether to only extract text segment. Default is FALSE.
- text_check, whether to check text segment is compliant with FCS specifications. Default is FALSE.
- text_empty, whether to allow empty values when parsing text segment. Default is FALSE.
- text_trim, remove whitespace in keywords names. Default is "none". Allowed are "both", "left", "right" and "none".

display_progress

whether to display a progress bar. Default is TRUE.

...

other arguments to be passed.

Details

'options' may be tweaked according to file type, instrument and software used to generate it.
Default 'options' should allow to read most files.
'options' members with the exception of 'header' may be passed thanks to '...'.

Value

a list whose elements are lists for each dataset stored within the file.
each sub-list contains:
- header, list of header information corresponding to 'options'
- delimiter, unique character used to separate keyword-value pairs
- text, list of keywords values,
- data, data.frame of values.

Source

Data File Standard for Flow Cytometry, version FCS 3.1 from Spidlen J. et al. available at \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/cyto.a.20825")}.


IFC documentation built on Sept. 14, 2023, 1:08 a.m.