Learn R Programming

scMetaTraj (version 0.1.1)

scMetaTraj_trend_multi: Compute trends and switchpoints for multiple modules along mPT

Description

Compute trends and switchpoints for multiple modules along mPT

Usage

scMetaTraj_trend_multi(
  score_mat,
  mPT,
  modules,
  n_bins = 30,
  smooth = TRUE,
  span = 0.3
)

Value

A list with:

  • trend_long: long-format data.frame for plotting

  • switchpoints: data.frame of module-wise switchpoints

Arguments

score_mat

Matrix/data.frame (cells x modules). Row order must match mPT.

mPT

Numeric vector (length = n_cells).

modules

Character vector of module names (columns of score_mat).

n_bins

Integer. Number of mPT bins.

smooth

Logical. Whether to loess smooth.

span

Numeric. Loess span.