Skip to content

Methods and checksMethods

How every result is reached and what it was checked against, app by app.

Methods and checks pages

TMM normalisation factor per sample against a named reference, version 1.0.1

ngs-size-factors-tmm@1.0.1: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.

What this page can and cannot show

Level: Checked against a reference; Robinson and Oshlack's text; rnanorm 2.2.0 agrees; counts at most 1e10; effective size N·f our choice. Reference kind: our own exact-arithmetic script and a hand-worked case.

Checked by this project, not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with the stated reference within the stated tolerance. A reader can follow each method's worked example by hand; that shows the stated method gives the stated answer for one set of inputs, and does not test the code. The other cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed them.

Every version of this method · Every method · What the levels mean

Version 1.0.1

Level: Checked against a reference; Robinson and Oshlack's text; rnanorm 2.2.0 agrees; counts at most 1e10; effective size N·f our choice. Reference kind: our own exact-arithmetic script and a hand-worked case. ngs-size-factors-tmm@1.0.1

Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.

Verification statement: TMM as Robinson and Oshlack 2010's text states it (re-read at source 14 November 2026; the printed display differs at M and w, and the text is implemented), with the record's rounding and average-rank tie rule. Compared with rnanorm 2.2.0, and with a second implementation in Python by a separate agent of the same model family (32 cases, 13 at the edges). Counts at most 1e10.

Robinson and Oshlack 2010's TMM as its text states it: M and A for genes non-zero in the sample and the reference, floor(0.3 n) trimmed from each tail by M and floor(0.05 n) by A, tied values taking their average rank (decided exactly from the counts), and the kept sets intersected, then 2 to the inverse-variance weighted mean of M; the reference's factor is exactly one; unrescaled, with a copy rescaled to geometric mean one and the effective library size.

  • How results are reported: none: full double precision, unrounded
  • Uncertainty: Double-precision arithmetic on the supplied counts; counting noise is not propagated beyond the method's own weights.
  • Reference, as its record states it: rnanorm 2.2.0 TMM, with a 50-digit decimal script of our own
  • Level confirmed by this project's ruling of 14 November 2026

What this page can and cannot show

What was checked

51 cases in 2 files, linked by this exact version.

Run through the tool at build against our own exact-arithmetic script and a hand-worked case: 38 agree within the tolerance the file states, 13 refuse as the case expects, 0 differ, 0 were not run.

  • File 1, 19 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-11
    • Reference: In-house decimal reference (CPython decimal, 50 digits), cross-checked against rnanorm 2.2.0, 3.13.18; licence PSF-2.0 (decimal); rnanorm Apache-2.0
    • Tolerance as the file states it: factors, rescaled factors, effective library sizes and their geometric mean relative 1e-13 against the 50-digit reference; library sizes, gene counts, texts, statuses and codes exact
  • File 2, 32 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-14
    • Reference: second implementation (Python 3.13, mpmath), 2026-11-14; licence BSD-3-Clause
    • Tolerance as the file states it: factors, rescaled factors, effective library sizes and their geometric mean relative 1e-13 against the 50-digit reference; library sizes, gene counts, texts, statuses and codes exact

Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.

What was not checked

edgeR itself (GPL, build-time only, not run here: R is not available) and its reference-sample rule (unread, so the reference is required); the paper's printed equation, which is not implemented.

Definition or model

A closed form: the result follows from the inputs by the equations alone.

Equations

Equation 1

M_g = log2((Y_gk/N_k)/(Y_gr/N_r))
A_g = (1/2) log2((Y_gk/N_k)(Y_gr/N_r)), for genes with Y_gk > 0 and Y_gr > 0
Symbol Meaning and unit
Y_gk count of gene g in sample k
N_k column total of sample k
r the reference sample

Source: Robinson MD, Oshlack A (2010), A scaling normalization method for differential expression analysis of RNA-seq data, Genome Biology 11:R25, doi 10.1186/gb-2010-11-3-r25, section Materials and methods, TMM: the text's M, A, trimming and inverse-variance weights (the printed equation differs at M and w; the text is implemented), version of record, Europe PMC full-text XML; equation images from the publisher's page; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning fe5b4b0b3c1c. Free to read (CC BY), checked 2026-11-11. No erratum found (searched Europe PMC correction list for doi 10.1186/gb-2010-11-3-r25), 2026-11-11.

Equation 2

rank the n genes ascending by M (and, separately, by A)
a run of tied values shares the mean of its ranks, and a gene is kept by M when its rank (or its run's mean rank) r satisfies floor(0.3 n) + 1 <= r <= n - floor(0.3 n), by A when floor(0.05 n) + 1 <= r <= n - floor(0.05 n), so a tied run is kept or trimmed whole
ties are decided exactly from the counts, M_g = M_h when Y_gk Y_hr = Y_hk Y_gr and A_g = A_h when Y_gk Y_gr = Y_hk Y_hr
keep genes kept by both (each tail and the intersection from the paper's text
the rounding and the tie rule our stated convention)
Symbol Meaning and unit
n genes non-zero in both samples

Source: Robinson MD, Oshlack A (2010), A scaling normalization method for differential expression analysis of RNA-seq data, Genome Biology 11:R25, doi 10.1186/gb-2010-11-3-r25, section Materials and methods, TMM: the text's M, A, trimming and inverse-variance weights (the printed equation differs at M and w; the text is implemented), version of record, Europe PMC full-text XML; equation images from the publisher's page; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning fe5b4b0b3c1c. Free to read (CC BY), checked 2026-11-11. No erratum found (searched Europe PMC correction list for doi 10.1186/gb-2010-11-3-r25), 2026-11-11.

Equation 3

f_k = 2^(sum w_g M_g / sum w_g), w_g = [(N_k - Y_gk)/(N_k Y_gk) + (N_r - Y_gr)/(N_r Y_gr)]^-1 over the kept genes
f_r = 1
effective library size N_k f_k, with f unrescaled and the reference at 1: the record's choice (the paper's two-library form multiplies or divides by sqrt(f), and edgeR's factors rescaled to geometric mean one, unread, differ from it by a common factor)
rescaled f_k = f_k / (prod over all samples j, the reference included, of f_j)^(1/m)
order of checks: the kit's checks of each argument (each count at least 0 and at most 1e10, the tool's input bound shared with ngs_expression_normalise, else OUT_OF_RANGE), then DUPLICATE_NAME (genes, then samples), then MATRIX_ABOVE_CAP (samples × genes above 6,000 numeric cells), then per sample in order VALUES_MISALIGNED and, for read counts, NOT_AN_INTEGER, then MISSING_ARGUMENT without a referenceSample and UNKNOWN_SAMPLE for one not sent, then the samples other than the reference in input order, the first refusal met being reported (NO_GENES_LEFT, or ZERO_VARIANCE_GENE, which looks at kept genes only)
Symbol Meaning and unit
f_k normalisation factor of sample k
w_g inverse of the delta-method variance of M_g

Source: Robinson MD, Oshlack A (2010), A scaling normalization method for differential expression analysis of RNA-seq data, Genome Biology 11:R25, doi 10.1186/gb-2010-11-3-r25, section Materials and methods, TMM: the text's M, A, trimming and inverse-variance weights (the printed equation differs at M and w; the text is implemented), version of record, Europe PMC full-text XML; equation images from the publisher's page; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning fe5b4b0b3c1c. Free to read (CC BY), checked 2026-11-11. No erratum found (searched Europe PMC correction list for doi 10.1186/gb-2010-11-3-r25), 2026-11-11.

Conventions

What each mode computes:

  • method = tmm: Robinson and Oshlack's trimmed mean of M values against a named reference sample, from the paper's text

Constants

Constants: none used.

Worked example

Worked example: one case of ngs-size-factors-tmm@1.0.1, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

Inputs

  • method = tmm
  • countKind = read-counts
  • referenceSample = ref
  • genes[0] = g0
  • genes[1] = g1
  • genes[2] = g2
  • genes[3] = g3
  • genes[4] = g4
  • genes[5] = g5
  • genes[6] = g6
  • genes[7] = g7
  • genes[8] = g8
  • genes[9] = g9
  • samples[0].id = ref
  • samples[0].counts.values[0] = 10
  • samples[0].counts.values[1] = 20
  • samples[0].counts.values[2] = 30
  • samples[0].counts.values[3] = 40
  • samples[0].counts.values[4] = 50
  • samples[0].counts.values[5] = 60
  • samples[0].counts.values[6] = 70
  • samples[0].counts.values[7] = 80
  • samples[0].counts.values[8] = 90
  • samples[0].counts.values[9] = 100
  • samples[0].counts.unit = 1
  • samples[1].id = double
  • samples[1].counts.values[0] = 20
  • samples[1].counts.values[1] = 40
  • samples[1].counts.values[2] = 60
  • samples[1].counts.values[3] = 80
  • samples[1].counts.values[4] = 100
  • samples[1].counts.values[5] = 120
  • samples[1].counts.values[6] = 140
  • samples[1].counts.values[7] = 160
  • samples[1].counts.values[8] = 180
  • samples[1].counts.values[9] = 200
  • samples[1].counts.unit = 1

Steps

  1. f = 1, from samples[0].counts, samples[1].counts; by equation 3; gives result.samples[1].normalisationFactor.

The working, as the case writes it:

ref f = 1 (the reference)
double f = 1 (10 genes kept). Robinson and Oshlack 2010's printed equation disagrees with its text at M (a ratio of two logs) and at w (the variance, not its inverse)
no correction is listed (read 11 November 2026)
the text is implemented.

Answer

  • result.samples[1].normalisationFactor = 1

Where these values came from: our own exact-arithmetic script and a hand-worked case; Worked by hand by Drybench on 11 November 2026 (ruling 7). This is not an independent check.

At build the tool returned this answer within the tolerance the file states: factors, rescaled factors, effective library sizes and their geometric mean relative 1e-13 against the 50-digit reference; library sizes, gene counts, texts, statuses and codes exact.

Who worked this case: not recorded.

What it refuses, and its input ranges

  • NO_GENES_LEFT: no gene is non-zero in both the sample and the reference, or none is left after trimming, so no weighted mean of M exists Next: Choose a reference sample that shares expressed genes with every sample, or send more genes.
  • ZERO_VARIANCE_GENE: a kept gene is the whole library in both the sample and the reference, so its variance is zero and its weight unbounded Next: Send more genes, so that no single gene is a sample's whole library.
  • VALUES_MISALIGNED (invalid input): a sample's counts do not have one value per gene
  • MATRIX_ABOVE_CAP (invalid input): the counts are more numeric cells than the tool's cap; a smaller gene subset changes the factors
  • UNKNOWN_SAMPLE (invalid input): referenceSample names no sample sent

Changes

No correction is logged for ngs-size-factors-tmm@1.0.1.

Tools that use it

Cite this version

TMM normalisation factor per sample against a named reference. Drybench; ngs-size-factors-tmm@1.0.1; https://www.drybench.com/methods/m/ngs-size-factors-tmm/1.0.1 (accessed [date]).