Skip to contents

Tumor subclone identification with spatial regularization

Usage

FindClone(
  obj,
  ref,
  ref.id = NULL,
  tumor = NULL,
  tumor.id = NULL,
  lambda = NULL,
  K = NULL,
  max_iter = 500,
  min_iter = 30,
  epsilon = 5e-04,
  seed = 12345678
)

Arguments

obj

a highSpaClone object

ref

Character vector of reference (normal) labels.

ref.id

Optional character vector of reference cell IDs.

tumor

Optional character vector of tumor labels; if NULL, all non-reference cells are used.

tumor.id

Optional vector of tumor cell IDs; if both tumor and tumor.id are NULL, all non-reference cells are used.

lambda

Numeric; spatial regularization strength passed to run_iter().

K

Integer; number of subclones (clusters). If NULL, it should be set by the caller.

max_iter

Integer; maximum number of iterations.

min_iter

Integer; minimum iterations before early stop.

epsilon

Numeric; convergence threshold on relative objective change.

seed

Integer; random seed.

Value

The input obj with:

  • @cnv.data: optimized CNV matrix (tumor cells × bins).

  • @cluster: data.frame(cell.id, x, y, cell.label) where cell.label"Clone 1", …, "Clone K".

Convergence and stopping

Same as FindTumor(): early stop on relative improvement < epsilon after min_iter, stop on objective increase, or stop at max_iter.

Examples

if (FALSE) { # \dontrun{
obj <- FindClone(
  obj,
  ref = c("B cells", "T cells"),
  K = 3,
  lambda = 1,
  max_iter = 500,
  min_iter = 30
)
table(obj@cluster$cluster)
} # }