Skip to contents

Smooth expression along chromosomes (windowed running mean) with optional chunking/parallelism.

Usage

smooth_expr(
  obj,
  window_size = 101,
  step = 50,
  exclude_chromosomes = c("chrX", "chrY", "chrM"),
  smooth_with_ends = FALSE,
  use_chunk = TRUE,
  chunk_size = 5000,
  parallel = FALSE,
  n_cores = NULL,
  max_cores = 4
)

Arguments

obj

highSpaClone object.

window_size

Integer. Size of the running-mean window (in genes) used within each chromosome (default: 101).

step

Integer. Number of genes in a bin (default: 50).

exclude_chromosomes

Chromosomes that are excluded from analysis (default: c('chrX', 'chrY', 'chrM')).

smooth_with_ends

Logical. Whether to apply an end-aware smoother (default: FALSE).

use_chunk

Logical. If TRUE, split cells into chunks of size chunk_size

chunk_size

Integer. Number of cells per chunk when use_chunk=TRUE.

parallel

Logical. If TRUE, process chunks in parallel.

n_cores

Integer or NULL. Number of CPU cores to use when parallel=TRUE. If NULL, uses parallel::detectCores()-1. The effective cores are capped by max_cores and the number of chunks (default NULL).

max_cores

Integer. Upper bound on cores even if more are available (default 4).

Value

Return highSpaClone object containing smoothed gene expression data