Skip to contents

Performs NCA metric learning for single-cell data. Maximizes the leave-one-out classification probability using a stochastic nearest neighbors approach.

Usage

runNCA(
  high_varGenes,
  expression_profile,
  sample_information,
  max_iter = 100,
  learn_rate = 0.01,
  seed = 1,
  verbose = TRUE
)

Arguments

high_varGenes

Character vector of high-variance genes

expression_profile

Numeric matrix (genes x cells)

sample_information

Named vector of cell type labels

max_iter

Maximum iterations (default: 100)

learn_rate

Learning rate (default: 0.01)

seed

Random seed (default: 1)

verbose

Print progress messages (default: TRUE)

Value

List containing:

  • expression_profile_trans: Transformed matrix (genes x cells)

  • expression_profile_origin: Original matrix

  • trans_matrix: Learned transformation matrix

  • sample_information: Input cell labels

Examples

if (FALSE) { # \dontrun{
# Example usage:
nca_result <- runNCA(
  high_varGenes = hvgs,
  expression_profile = expr_matrix,
  sample_information = cell_labels
)
} # }