Skip to main content

t_test_matrix_groups

Function t_test_matrix_groups 

Source
pub fn t_test_matrix_groups<T>(
    matrix: &CsrMatrix<T>,
    group1_indices: &[usize],
    group2_indices: &[usize],
    test_type: TTestType,
) -> Result<Vec<TestResult<f64>>>
where T: FloatOpsTS,
Expand description

Perform t-tests on all genes comparing two groups of cells.

This is an optimized implementation that efficiently computes summary statistics for sparse matrices and performs t-tests for each gene.

§Arguments

  • matrix - Sparse expression matrix (cells × genes)
  • group1_indices - Column indices for the first group of cells
  • group2_indices - Column indices for the second group of cells
  • test_type - Type of t-test to perform (Student’s or Welch’s)

§Returns

Vector of TestResult objects, one per gene, containing t-statistics and p-values.