readCytof: Read in a dataset and prepare it for analysis

View source: R/readCytof.R

readCytofR Documentation

Read in a dataset and prepare it for analysis

Description

Read in a dataset and prepare it for analysis

Usage

readCytof(
  file.name,
  beads = c("Bead"),
  dna = c("DNA1", "DNA2"),
  event_length = "Event_length",
  viability = "Live_Dead",
  gaussian = c("Center", "Offset", "Width", "Residual"),
  verbose = TRUE
)

Arguments

file.name

A path to an .fcs file that contains CyTOF data or a flowSet object containing a single sample.

beads

character vector that contains the names of all of the bead channels.

dna

Character vector that contains the names of the DNA markers.

event_length

Character vector of the event length variable.

viability

Character vector of the permeability/viability markers.

gaussian

Character vector that contains the names of the Gaussian Discrimination Parameters.

verbose

Logical value indicating whether or not to print a summary of the technical channels identified in the data.

Details

The function returns a SingleCellExperiment that contains all of the original information from the fcs file. The data are imported using CATALYST and then information is added to the colData that will be used to determine labels for each event and to provide additional information about the events that can be used for exploratory data analysis and to aid the user in labeling the data. The objects are all initialized at this point an values are filled in during later stages of the labeling process. Note that the names from the fcs file are required as arguments to the readCytof. If you are not sure what those names are, there is some code in the example that shows how to import your data into a SingleCellExperiment using prepData from CATALYST and look at the names.

Value

A SingleCellExperiment that contains the information from the CyTOF fcs file, the technical data that will be used to label the data, and other objects that are used to store information through the labeling process. The objects are DataFrame objects that are stored in the colData for the SingleCellExperiment. The objects are:

label

A single variable DataFrame that will contain the event label as determined by cytofQC. At this point, all events are labeled "gdpZero" if Event_length or any of the Gaussian parameters are zero and "cell" otherwise. These labels are changed during later stages.

probs

A DataFrame that contains the "probability" that an event is a certain type. This is initialized as NA at this point and is filled in later on.

tech

A DataFrame that contains the technical variables used to determine the label of each event. The bead, DNA, and viability variables have an arcsinh transform, Event_length is unchanged, and the Gaussian parameters have a log transform using log1p.

scores

Scores are computed to determine how much an event looks like a bead, debris, doublet, or dead cell. These scores are used to select a training dataset for the classification model, but they can be helpful for exploratory data analysis so they are provided in this DataFrame. At this stage they are initialized as NA and values are added in later steps.

initial

Initial classification of each event type is determined using a mixture model and the event type score. The initial object is a DataFrame that will hold this initial classification. A training dataset for the event classification model is selected using this initial classification.

Examples

library(CATALYST)
library(SingleCellExperiment)
data("raw_data", package = "CATALYST")

# Determine at the names of the bead, DNA, and viability channels in the 
# file. Names are 'Beads', 'DNA1', 'DNA2', 'cisPt1', 'cisPt2'.
tech <- prepData(raw_data)
rownames(tech) 

# Determine names of event length and Gaussian parameters
# names are 'Event_length', 'Center', 'Offset', 'Width', 'Residual'
names(int_colData(tech)) 

# read in the data for use with cytofQC
x <- readCytof(raw_data, beads = 'Beads', viability = c('cisPt1','cisPt2'))


jillbo1000/cytofQC documentation built on Aug. 23, 2023, 9:47 p.m.