infinity_setup: Prepare the infinity setup Rds

View source: R/infinity_setup.R

infinity_setupR Documentation

Prepare the infinity setup Rds

Description

Run this command after you have pregated the infinity files to make an infinity setup tibble that you can then pmap into infinityFlow so that each sample gets correctly imputed. Note that for now, this version is insisting on an intermediary results folder - although the bug where not specifying intermediaries appended the files has been resolved, it's safest to just run this with the intermediaries saved and then delete them later if you don't need them.

Usage

infinity_setup(
  pregated_dir,
  infinity_targets,
  infinity_isotypes,
  create_output_dir = TRUE,
  create_intermed_dir = TRUE
)

Arguments

pregated_dir

A path to the directory that contains your pregated .fcs files for infinity imputation.

infinity_targets

A character vector with the identity of each infinity marker, file-by-file. Note that this needs to be in the order that R will read it into the system, which is often well A10, A11, A12, A1, A2... when acquiring fortessa data. If you aren't sure what the order will be, call (list.files) on one of the individual pregated sample folders and see what order they come out in.

infinity_isotypes

A character vector specifying the name of each isotype target for each infinity target. The isotype string must be found in one of the entries in infinity_targets. Often, just pass "FMO" to this and all background correction will be done against the FMO sample.

create_output_dir

Boolean. Should an infinityOutput directory be created and populated with the same subfolder structure as the pregated directory?

create_intermed_dir

Boolean. Should an infinityIntermed directory be created and populated with the same subfolder structure as the pregated directory?

Value

an infinitySetup tibble that should be saved to a .Rds and then fed into an imputation pipeline as a set of args through pwalk.

Examples

# Note - commented because R-CMD-BUILD can't create the output folders in a
# safe way.
# infinitySetup <- infinity_setup(pregated_dir = system.file("extdata",
#                                                     "pregated",
#                                                     package = "flowHelpers"),
#                                 infinity_targets = c("Marker1",
#                                                      "Marker2"),
#                                 infinity_isotypes = "FMO",
#                                 create_output_dir = FALSE,
#                                 create_intermed_dir = FALSE)


NKInstinct/flowHelpers documentation built on March 17, 2023, 1:42 a.m.