Skip to contents

Compute Clone-to-Clone Distances from Cell Embedding and Clone Assignments

Usage

clone_disance(
  embedding,
  cell_clone_prob,
  outpath,
  graph_k = 10,
  overwrite = FALSE,
  exact = FALSE,
  ...
)

Arguments

embedding

A numeric matrix of cell embeddings (cells × dimensions).

cell_clone_prob

A numeric matrix of clone membership probabilities (cells × clones).

outpath

File path to save and load intermediate graph and distance results.

graph_k

Integer. Number of neighbors to use in the SNN graph (default: 10).

overwrite

Logical. Whether to overwrite previously saved graphs and results (default: FALSE).

exact

Logical. If `TRUE`, computes exact OT-based clone distances; otherwise, uses approximate NN (default: FALSE).

...

Additional arguments passed to `graph_clone_ot()` or `graph_clone_nn()`.

Value

A data frame with columns `group1`, `group2`, and `dis`, representing pairwise clone distances.

Details

Constructs a cell-cell shared nearest neighbor (SNN) graph from an embedding and uses it to estimate pairwise distances between clones. Users can choose between exact OT-based distances or fast approximate k-nearest neighbor methods.