Expand description
Input/output for expression matrices, design and contrast matrices, and
result tables. The delimited-text reader (read_matrix) lives behind the
cli feature – it is the only consumer of the csv crate; everything else
here (the design/contrast aligners and every table writer, including
write_fit) is std-only and always compiled.
Structs§
- Labeled
Matrix - A labelled numeric matrix:
dataisrows x cols, withrow_namesandcol_namestaken from the first column and header row respectively. - Write
FitOptions - Options for
write_fit, mirroring the arguments of limma’swrite.fit.
Functions§
- align_
contrasts - Reorder the rows of a contrast matrix to match
coef_order(the design’s coefficient names). Returns then_coef x n_contrastsmatrix. - align_
design - Reorder the rows of
designso they line up withsample_order(the expression-matrix column names), matching on row name. Returns the alignedn_samples x n_coefdesign matrix. - read_
matrix - Read a labelled matrix from a delimited text file, choosing the delimiter
from the file extension:
.tsv/.tabare read tab-separated, everything else (.csv,.txt, no extension) comma-separated. The first row is a header whose first cell is an ignored corner label; the first column of each subsequent row is the row name. Empty /NA/NaNcells parse tof64::NAN. Useread_matrix_with_delimiterto force a delimiter. - read_
matrix_ with_ delimiter - Read a labelled matrix from a delimited text file using an explicit
delimiterbyte (e.g.b','orb'\t'). The first row is a header whose first cell is an ignored corner label; the first column of each subsequent row is the row name. Empty /NA/NaNcells parse tof64::NAN. - write_
fit - Write an eBayes-processed
MArrayLMfit to a delimited file, port of limma’swrite.fit. The fit must already carry moderatedtand p-values (run [crate::ebayes] or [crate::treat] first). Columns are emitted in limma’s order —AveExpr, then per-coefficientCoef,t,P.value, optionalP.value.adj, thenF/F.p.value(when present) and optionalF.p.value.adj, then optionalResultsfrom adecideTestsmatrix. With a single coefficient the per-coefficient columns carry no.<name>suffix, matching R’sdrop(). - write_
fit_ dump - Dump the full per-gene fit statistics in original gene order, one CSV row per gene per coefficient. Used for numerical parity checks against R limma.
- write_
test_ results - Write a
decideTestsoutcome matrix (genes x contrasts) of -1/0/1, in original gene order. Header isidfollowed by the contrast names. - write_
top_ table - Write a single-contrast top table.
- write_
top_ table_ f - Write a multi-contrast (F-statistic) top table.