fcs.SCE: Read multiple FCS files and create a 'fcs.SCE' object

View source: R/fcs.SCE.R

fcs.SCER Documentation

Read multiple FCS files and create a fcs.SCE object

Description

It reads and creates a fcs.SCE object (based on the SingleCellExperiment class) from FCS files in a specific folder or indicated in a vector. Important note: all files should have an identicar header (i.e., same name and markers order), if not only those common will be read (you can use FlowCT::unify.FCSheaders() for doing that).

Usage

fcs.SCE(
  filelist = NULL,
  directory = getwd(),
  pattern = ".fcs$",
  events = "all",
  dataset = 1,
  num.threads = NULL,
  metadata,
  transformation = "arcsinh",
  transf.cofactor = 500,
  project.name = "noname"
)

Arguments

filelist

A vector with full path of FCS files to be read, commonly generated through base::list.files(). If NULL, this file list will be generated as indicated below.

directory

If filelist = NULL, those files stored in this location will be read. Default = getwd() (current directory).

pattern

Pattern for reading files within directory. Default = "fcs".

events

Numeric vector indicating how many events to read in each FCS file (same behaviour as flowCcre::read.FCS()), those are the number of events for new and unified generated FCS files. Default = "all".

dataset

Specify data segment to be read in the FCS file (same behaviour as flowCcre::read.FCS()). Default = 1.

num.threads

Number of threads for reading the FCS files. For Windows users, you should to install parallelsugar from Nathanvan's GitHub. Defult = NULL, i.e., not parallelization.

metadata

Metadata information for each FCS files included in the analysis. It will be used to assign to each event an specific metadata and it will be added to metadata(fcs.SCE) as reduced_metadata.

transformation

Because FCS data is normally exported in a logarithmic format, it is necessary its transformation for downstream analysis. Default (and the only one) = arcsinh.

transf.cofactor

Cofactor numeric value for that arcsinh transformation. Values can ranged from 15 to 50 (for mass cytometry) and from 150 to 10,000 (for flow cytometry). Default = 500.

project.name

String naming the fcs.SCE generated. Default = "noname".

Value

The fcs.SCE object is comprised with multiple (and downstream customizable) elements

  1. colData(fcs.SCE): A data.frame with metadata information for each event in the read FCS files.

  2. assayNames(fcs.SCE): Two expression matrices with markers as rows and events (cells) as columns. The first matrix (raw) contains the raw expression for each marker, and the second one (transformed), the arcsinh-transformed expression for subsequent analysis.

  3. metadata(fcs.SCE): Additional information about the experiment and following downstream steps: those read FCS files (input_files), reduced_metada with metadata for each FCS file...

Examples

## Not run: 
head(metadata_user)
 #       filename sample_id condition patient_id
 # 1 BM_017294.fcs         1        BM     017294
 # 2 BM_017564.fcs         2        BM     017564
 # 3 BM_017612.fcs         3        BM     017612
 # 4 PB_017294.fcs         4        PB     017294
 # 5 PB_017564.fcs         5        PB     017564
 # 6 PB_017612.fcs         6        PB     017612
fcs <- fcs.SCE(directory = "../data/", which.lines = 1000, 
   metadata = metadata_user, transf.cofactor = 500)

## End(Not run)

jgarces02/FlowCT documentation built on March 28, 2023, 12:42 p.m.