Skip to main content

Crate rsomics_sc_combat

Crate rsomics_sc_combat 

Source

Structs§

CountMatrix
Single-cell counts in 10x MatrixMarket layout: genes on rows, cells on columns, coordinate triplets. Counts are f64 because ComBat runs on the log-normalized float matrix scanpy feeds it.
Entry

Functions§

combat
Parametric ComBat (Johnson, Li & Rabinovic 2007) with batch as the only model term. Operates in place on a gene-major dense matrix and overwrites it with the corrected values, mirroring scanpy’s _combat.
open_mtx
open_output
parse_mtx
Parse a 10x MatrixMarket coordinate file (real/integer/pattern, general).
read_barcodes
Read the 10x barcodes file (barcodes.tsv[.gz]), one per cell.
read_batch_labels
Read a barcode → batch-label TSV. Two columns (barcode, label); a header line barcode<TAB>colname is honored when key names that second column, otherwise the first data row sets the schema. Returns the per-cell batch index aligned to barcodes, plus the ordered distinct labels.
run
End-to-end: read the 10x matrix and barcodes from dir, read batch labels, run ComBat, write the corrected dense matrix.
write_dense_gene_major
Write the dense matrix in MatrixMarket array real general layout, one value per line in column-major order, from a gene-major buffer.