MCPcopy Index your code
hub / github.com/SingleRust/SingleRust / compute_highly_variable_genes

Function compute_highly_variable_genes

src/memory/processing/hvg/mod.rs:156–168  ·  view source on GitHub ↗

Compute highly variable genes using the specified method and parameters. This is the main entry point for HVG detection. It analyzes the mean-variance relationship in the expression data to identify genes with biological variability above technical noise. ## Algorithm Overview 1. **Calculate Statistics**: Compute mean and variance for each gene 2. **Model Relationship**: Fit mean-variance relat

(
    adata: &IMAnnData,
    params: Option<HVGParams>,
)

Source from the content-addressed store, hash-verified

154/// compute_highly_variable_genes(&adata, Some(params))?;
155/// ```
156pub fn compute_highly_variable_genes(
157 adata: &IMAnnData,
158 params: Option<HVGParams>,
159) -> anyhow::Result<()> {
160 let params = params.unwrap_or_default();
161 let x = adata.x();
162
163 match params.flavor {
164 FlavorType::Seurat => compute_seurat_hvg(adata, &x, params),
165 FlavorType::CellRanger => compute_cell_ranger_hvg(adata, &x, params),
166 FlavorType::SVR => compute_svr_hvg(adata, &x, params),
167 }
168}
169
170/// Post-process dispersion statistics for Seurat method to handle edge cases.
171///

Callers

nothing calls this directly

Calls 3

compute_seurat_hvgFunction · 0.85
compute_cell_ranger_hvgFunction · 0.85
compute_svr_hvgFunction · 0.85

Tested by

no test coverage detected