cqc_write_fcs: Write out tidied flow data ('cqc_cf_list') back to fcs or h5

Description Usage Arguments Examples

View source: R/cqc_io.R

Description

Write out tidied flow data (cqc_cf_list) back to fcs or h5

Usage

1
2
3
4
5
6
7
8
9
cqc_write_fcs(x, out, verbose = TRUE, ...)

cqc_write_cytoframe(
  x,
  out,
  verbose = TRUE,
  backend = get_default_backend(),
  ...
)

Arguments

x

cqc_cf_list

out

the output directory that the FCS or cytoframe on-disk formats will be written

verbose

whether to print each sample name during the writing process

...

other arguments passed down to 'write.FCS'

backend

either "h5" or "tile" (only relevant for cqc_write_cytoframe)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Read in FCS files with inconsistencies
fcs_files <- list.files(system.file("extdata", "GvHD_QC", package = "cytoqc"), full.names = TRUE)
qc_cf_list <- cqc_load_fcs(fcs_files)

# Check for marker inconsitencies
groups <- cqc_check(qc_cf_list, type = "marker")

# Attempt to fix them automatically
match_result <- cqc_match(groups, ref = c("CD14 PerCP", "CD15 FITC", "CD33 APC", "CD45 PE", "FSC-Height", "SSC-Height", "Time"))

# Add a manual match that automatic matching could not find
match_result <- cqc_match_update(match_result, map = c("PTPRC PE" = "CD45 PE"))

# Apply the fix to the original cytoframes
cqc_fix(match_result)

# There is still one sample in its own group, because it is missing the Time channel entirely
# One approach is to simply drop this group.
groups <- cqc_check(qc_cf_list, type = "marker")
groups <- cqc_drop_groups(groups, 1)

qc_data <- cqc_get_data(groups)

# Write out fcs files
tmp_fcs_dir <- tempfile()
cqc_write_fcs(qc_data, tmp_fcs_dir)

# Write out h5 files
tmp_h5_dir <- tempfile()
cqc_write_cytoframe(qc_data, tmp_h5_dir)

RGLab/cytoqc documentation built on Nov. 25, 2020, 11:27 p.m.