Skip to contents

Compare explicit marker gates with an equal-size activity population

Usage

factor_gate_alignment(
  fit,
  measurements,
  factor,
  positive = character(),
  negative = character(),
  thresholds,
  direction = c("high", "low")
)

Arguments

fit

Native fit or representation.

measurements

Named sample-by-marker matrix.

factor

One factor ID.

positive, negative

Marker IDs requiring values above or at/below thresholds.

thresholds

Explicit named authoritative marker thresholds.

direction

"high" (default) compares the gate with the same number of highest-activity samples; "low" uses the lowest-activity samples, for factors expected to mark marker-negative populations.

Value

Overlap counts/scores, mean activities and selected IDs. Empty gates have unavailable scores. Activity ties are broken by sample ID, so when the cutoff falls inside a block of tied activities the overlap depends on the IDs: n_tied_at_cutoff counts the samples tied with the last selected one, overlap_min and overlap_max give the range of overlaps over all ways to break the tie, and status is "available_tied_at_cutoff" when that range is wider than a single value.

Author

Mikhael Manurung; conceptual ImmGen-T Figure 7 gate workflow.