dot-ggmlr_largest_gene: Highest-expressed gene per cell (op = "largest_gene")

.ggmlr_largest_geneR Documentation

Highest-expressed gene per cell (op = "largest_gene")

Description

For every cell, finds the gene with the largest value and that value's share of the cell's column sum — Seurat's largest_gene / percent.Largest.Gene QC metric (qlcMatrix::colMax(counts, which = TRUE)). Runs on the CPU directly over the sparse dgCMatrix CSC slots (@x, @i, @p) without ever densifying, so it scales to the full counts matrix. This is a memory-bound O(nnz) column argmax/max with no arithmetic to accelerate, so — like ScaleData and the UMAP layout — there is nothing for the GPU to speed up; backend is accepted for a uniform interface but the compute always stays on the CPU.

Usage

.ggmlr_largest_gene(mat, backend = c("vulkan", "cpu"), chunk_size = NULL)

Arguments

mat

A dgCMatrix (preferred; kept sparse) or dense numeric matrix, features x cells (raw counts).

backend

Accepted for interface uniformity; ignored (always CPU).

Value

A ggml_result with metadata$kind = "coldata" and embedding a data.frame of two columns: largest_gene (chr, the feature name, NA for empty cells) and percent.Largest.Gene (dbl, max / colSum * 100, 0 for empty cells), one row per cell.


ggmlR documentation built on July 14, 2026, 1:08 a.m.