compMat_to_fcs: Write a compensation matrix into a fcs file

View source: R/compMat_to_FCS.R

compMat_to_fcsR Documentation

Write a compensation matrix into a fcs file

Description

When a compensation matrix is made in flowjo it only exists in the workspace. It is applied like a mask on the fcs file. In case the workspace is lost or gets corrupted, the compensation matrix is lost. To avoid that one may want to hard-code the matrix into the fcs-file. This function takes a csv file of a compensation matrix as exported from flowjo and writes it into the SPILL-keyword of a fcs file. Moreover, a full compensation matrix is generated: You may have noticed that a compensation matrix purely generated in flowjo is not complete - spillover into channels can only be assigned for existing compensation controls. This is different to a matrix generated by BDs DIVA software where spillover into all channels can be assigned, no matter if for respective channel a compensation control was recorded. E.g. for a live/dead-channel we are generally only interested in spillover into the channel, not which spillover comes out of it, as dead cells are not of interest in most cases.

Usage

compMat_to_fcs(
  fcs_file_path,
  compMat_file_path,
  max_match_dist = 1,
  skip_check = F
)

Arguments

fcs_file_path,

character, file path to the fcs file

compMat_file_path

character, file path to the csv file of the compensation matrix

max_match_dist

numeric, maximum string distance for matching channel names using utils::adist

skip_check

logical, whether to ask for confirmation by the user if channel names were matched correctly

Value

no return but an fcs file with an updated compensation matrix (SPILL keyword) on disk

Examples

## Not run: 
compMat_to_fcs(fcs_file_path = "myfolder/my_file.fcs",
compMat_file_path = "myfolder/compmat_export_from_flowjo.csv")

## End(Not run)

Close-your-eyes/fcexpr documentation built on Sept. 29, 2023, 12:27 a.m.