tof_transform: Transform raw high-dimensional cytometry data.

View source: R/preprocessing.R

tof_transformR Documentation

Transform raw high-dimensional cytometry data.

Description

This function transforms a 'tof_tbl' of raw ion counts, reads, or fluorescence intensity units directly measured on a cytometer using a user-provided function.

Usage

tof_transform(
  tof_tibble = NULL,
  channel_cols = where(tof_is_numeric),
  transform_fun
)

Arguments

tof_tibble

A 'tof_tbl' or a 'tibble'.

channel_cols

Unquoted column names representing columns that contain single-cell protein measurements. Supports tidyselect helpers. If nothing is specified, the default is to transform all numeric columns.

transform_fun

A vectorized function to apply to each protein value for variance stabilization.

Value

A 'tof_tbl' with identical dimensions to the input 'tof_tibble', with all columns specified in channel_cols transformed using 'transform_fun'.

Examples


# read in an example .fcs file from tidytof's internal datasets
input_file <- dir(tidytof_example_data("aml"), full.names = TRUE)[[1]]
tof_tibble <- tof_read_data(input_file)

# preprocess all numeric columns with default behavior
# arcsinh transformation with a cofactor of 5
tof_preprocess(tof_tibble)

# preprocess all numeric columns using the log base 10 tranformation
tof_preprocess(tof_tibble, transform_fun = log10)


keyes-timothy/tidytof documentation built on Aug. 28, 2024, 8:37 a.m.