Smooth expression along chromosomes (windowed running mean) with optional chunking/parallelism.
Source:R/utilities.R
smooth_expr.RdSmooth 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 sizechunk_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 whenparallel=TRUE. IfNULL, usesparallel::detectCores()-1. The effective cores are capped bymax_coresand the number of chunks (defaultNULL).- max_cores
Integer. Upper bound on cores even if more are available (default
4).