Learn R Programming

scMetaTraj (version 0.1.1)

scMetaTraj_trend_by_cluster: Compute module trends along mPT stratified by metabolic cluster

Description

Compute module trends along mPT stratified by metabolic cluster

Usage

scMetaTraj_trend_by_cluster(
  score_mat,
  mPT,
  cluster,
  modules,
  n_bins = 30,
  smooth = TRUE,
  span = 0.3,
  min_cells = 50
)

Value

Long-format data.frame with columns: cluster, module, mPT_bin, score, score_smooth, n_cells

Arguments

score_mat

Matrix/data.frame (cells x modules).

mPT

Numeric vector.

cluster

Factor/character vector of cluster labels.

modules

Character vector of module names.

n_bins

Integer. Number of bins.

smooth

Logical. Whether to loess smooth.

span

Numeric. Loess span.

min_cells

Integer. Minimum cells per cluster to compute trends.