Gene-expression matrices
An expression matrix can place genes in rows and samples in columns, or the reverse.
Loading video…
An expression matrix can place genes in rows and samples in columns, as biological heatmaps often do, or samples in rows and genes in columns, as machine-learning libraries often expect. State which axis represents genes and which represents samples before interpreting or transposing values. Read counts or intensities need quality control and normalization before cross-sample comparisons; normalization does not erase every batch effect. Thousands of genes with few samples make accidental patterns easy to find. Keep sample metadata and gene identifiers unambiguous.
Worked example
For eight samples and 2,000 genes, a samples-by-genes array has shape (8, 2000); the transposed genes-by-samples heatmap has shape (2000, 8). Compare treatment groups only after checking library size, missingness and collection batch.