Skip to content

Methods and checksMethods

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

Methods and checks pages

Cells to profile per sample so that every sample holds enough cells of a rare type, version 1.0.2

singlecell-cells-required@1.0.2: 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

Its calculation passed Drybench's full check: source read, a separately written implementation, edge and refusal cases, and an outside comparison where one exists. It stays below the top level because no measured prediction error is available for the model.

Level: Calculation fully checked; model error not measured; Binomial sampling model; independent, unbiased capture assumed; no measured prediction error. Reference kind: a reference program this project wrote itself, mpmath (arithmetic: mpf powers and products), 1.3.0, direct summation of the binomial terms in mpmath 1.3.0 at 400 decimal digits; no special function; the search compares at that precision; not an outside program; a reference program this project wrote itself, second implementation (Python 3.13, mpmath), 2026-11-14, mpmath sums at 60 significant digits, rounded once to a double; the search compares at that precision; not an outside program; values written by our own engine, the record's stated order of checks (1.0.2), worked by hand; the second implementation (Python 3.13, mpmath) as cross-check, 2026-11-24: a regression check, not a reference.

Tested 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 a separately written implementation within the stated tolerance; no measured prediction error is available for its model. 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.2

Level: Calculation fully checked; model error not measured; Binomial sampling model; independent, unbiased capture assumed; no measured prediction error. Reference kind: a reference program this project wrote itself, mpmath (arithmetic: mpf powers and products), 1.3.0, direct summation of the binomial terms in mpmath 1.3.0 at 400 decimal digits; no special function; the search compares at that precision; not an outside program; a reference program this project wrote itself, second implementation (Python 3.13, mpmath), 2026-11-14, mpmath sums at 60 significant digits, rounded once to a double; the search compares at that precision; not an outside program; values written by our own engine, the record's stated order of checks (1.0.2), worked by hand; the second implementation (Python 3.13, mpmath) as cross-check, 2026-11-24: a regression check, not a reference. singlecell-cells-required@1.0.2

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.

The smallest number of profiled cells per sample at which the sampling model's probability that every sample holds at least k cells of the type reaches a target the caller states. The probability does not fall as N grows, so the largest N the method takes is tried first and the interval from k to it is then halved. The probability at the N returned is given beside it. The count is of cells profiled after quality control; the cells to load depend on a recovery the method does not model.

  • How results are reported: none: full double precision
  • Uncertainty: A sampling model with no measured prediction error: no read source compares the cells of a type recovered in an experiment with the number this model expects.
  • Iterates: bisection, at most 24 iterations, between N = k and N = the largest number of cells per sample the method takes
  • Reference, as its record states it: An integer search over the binomial sum at 400 digits (mpmath arithmetic), with the probabilities at the answer checked against SciPy 1.17.0 (fixture -1); in the raising run, a second implementation at 60 digits checked against SciPy 1.18.1 (fixture -2)
  • Computes through: singlecell-sampling-probability@1.0.1
  • Level confirmed by this project's ruling of 24 November 2026

What this page can and cannot show

What was checked

68 cases in 3 files, linked by this exact version.

Run through the tool at build against a reference program this project wrote itself, mpmath (arithmetic: mpf powers and products), 1.3.0, direct summation of the binomial terms in mpmath 1.3.0 at 400 decimal digits; no special function; the search compares at that precision; not an outside program; a reference program this project wrote itself, second implementation (Python 3.13, mpmath), 2026-11-14, mpmath sums at 60 significant digits, rounded once to a double; the search compares at that precision; not an outside program; values written by our own engine, the record's stated order of checks (1.0.2), worked by hand; the second implementation (Python 3.13, mpmath) as cross-check, 2026-11-24: a regression check, not a reference: 54 agree within the tolerance the file states, 14 refuse as the case expects, 0 differ, 0 were not run.

  • File 1, 23 cases

    • Where the expected values came from: an outside program, mpmath (arithmetic: mpf powers and products) 1.3.0
    • Recorded on: 2026-11-12
    • Reference: mpmath (arithmetic: mpf powers and products), 1.3.0; licence BSD-3-Clause
    • Tolerance as the file states it: the two probabilities relative 1e-9, with a floor of 1e-209 below 1e-200; the cells per sample, the total cells, statuses, codes and units exact
  • File 2, 44 cases

    • Where the expected values came from: an outside program, second implementation (Python 3.13, mpmath) 2026-11-14
    • 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: the two probabilities relative 1e-9, with a floor of 1e-209 below 1e-200; the cells per sample, the total cells, statuses, codes and units exact
  • File 3, 1 case

    • Where the expected values came from: values written by our own engine, 1.0.2: a regression check, not a reference
    • Recorded on: 2026-11-24
    • Reference: the record's stated order of checks (1.0.2), worked by hand; the second implementation (Python 3.13, mpmath) as cross-check, 2026-11-24; licence BSD-3-Clause
    • Tolerance as the file states it: statuses and codes exact (no number is expected)

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

Everything singlecell-sampling-probability leaves unchecked; the cells to load, which need a recovery fraction the method does not take; a target within rounding of a probability the model attains, where the count returned can differ by one: the engine's probability is within one part in ten thousand million of the model's at the targets the method takes, and the cases keep their targets clear of that.

Definition or model

A model of nature: it describes how a system behaves, and can be wrong about it.

Prediction error: none available.

Equations

N* = min { N : P(N) ≥ p }, with P(N) = (F_NB(N − k
k, f))^s
the search runs from N = k to N = 10,000,000 cells per sample (the method's largest N) by at most 24 halvings (2^24 is above 10^7)
TARGET_NOT_REACHED when P(10^7) is below p
the target p is in [0.5, 0.999999], both ends inside, tested on the converted double
a frequency in % is divided by 100 and its range (0, 1] is tested on the converted double, not the stated decimal, so 100.00000000000001 % is accepted as 1
order of checks: the kit's checks of each argument, then the method's ranges in the order minimumCells, samples (COUNT_ABOVE_RANGE), targetProbability (TARGET_OUTSIDE_RANGE), then the search
Symbol Meaning and unit
f the frequency of the cell type among the profiled cells, a fraction above 0 and at most 1 (argument frequency)
k the fewest cells of the type wanted in a sample (argument minimumCells)
s the number of samples, each profiled separately (argument samples)
p the target probability that every sample holds at least k cells of the type (argument targetProbability)
P(N) the model's probability at N cells per sample, by singlecell-sampling-probability; returned at N* as probabilityAllSamples, with the one-sample value as probabilityPerSample
N* the smallest number of cells per sample reaching the target, returned as cellsPerSample; s·N* is returned as totalCells

Source: Schmid KT, Höllbacher B, Cruceanu C, Böttcher A, Lickert H, Binder EB, Theis FJ, Heinig M, scPower accelerates and optimizes the design of multi-sample single cell transcriptomic studies, Nat Commun 12:6625 (2021), section Results, Power analysis framework for scRNA-seq experimental design; Methods, Frequency of the rarest cell type, version of record (Nature Communications) as deposited in PMC; Europe PMC's JATS XML, not the publisher's copy; read in full on 2026-11-12 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning b13358e0aa10. Free to read (CC BY 4.0), checked 2026-11-12. No erratum found (searched publisher, crossref, europe-pmc, retraction-watch), 2026-11-12.

Constants

Constants: none used.

Worked example

Worked example: one case of singlecell-cells-required@1.0.2, 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

  • frequency = 0.5
  • minimumCells = 1
  • samples = 1
  • targetProbability = 0.9

Steps

  1. oneFewer = 0.875, from frequency, minimumCells, samples; by the equation above.
  2. perSample = 0.9375, from frequency, minimumCells, samples; by the equation above; gives probabilityPerSample.
  3. allSamples = 0.9375, from perSample, samples; by the equation above; gives probabilityAllSamples.
  4. cells = 4, from oneFewer, allSamples, targetProbability; by the equation above; gives cellsPerSample.
  5. total = 4, from cells, samples; by the equation above; gives totalCells.

The working, as the case writes it:

with k = 1 and one sample, P(N) = 1 − (1 − 0.5)^N: P(3) = 0.875, below the target 0.9, and P(4) = 0.9375, at or above it, so N* = 4 and the total is 4 cells (worked by hand by Drybench on 12 November 2026
not an independent check)

Answer

  • probabilityPerSample = 0.9375
  • probabilityAllSamples = 0.9375
  • cellsPerSample = 4
  • totalCells = 4

Where these values came from: an outside program, mpmath (arithmetic: mpf powers and products) 1.3.0; stored reference values (an integer search over mpmath 1.3.0 arithmetic at 400 digits).

At build the tool returned this answer within the tolerance the file states: the two probabilities relative 1e-9, with a floor of 1e-209 below 1e-200; the cells per sample, the total cells, statuses, codes and units exact.

Who worked this case: not recorded.

What it refuses, and its input ranges

  • COUNT_ABOVE_RANGE: the number of cells per sample, the fewest cells wanted or the number of samples is above the range the method was checked over Next: Give a count inside the method's range; where the counts are as intended, no change of input makes this computable by this method.
  • TARGET_OUTSIDE_RANGE: the target probability is outside the range in which the comparison with the model's probability was checked Next: Give a target inside the method's range; a target nearer certainty than the range allows is not decided by this method.
  • TARGET_NOT_REACHED: no number of cells per sample within the method's range reaches the target Next: Lower the target, the fewest cells wanted or the number of samples, or check the frequency and its unit; otherwise no change of input makes this computable by this method.

Input ranges: minimumCells: at most 10000; outside it, refused (COUNT_ABOVE_RANGE). samples: at most 10000; outside it, refused (COUNT_ABOVE_RANGE). targetProbability: at least 0.5 and at most 0.999999; outside it, refused (TARGET_OUTSIDE_RANGE).

Changes

No correction is logged for singlecell-cells-required@1.0.2.

Tools that use it

Cite this version

Cells to profile per sample so that every sample holds enough cells of a rare type. Drybench; singlecell-cells-required@1.0.2; https://www.drybench.com/methods/m/singlecell-cells-required/1.0.2 (accessed [date]).