# Normalised spectral abundance factor of the proteins in one sample, version 1.0.1

nsaf\@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: Tested, not reference-checked; Relative within one sample; an index, not a molar amount; shared spectra not distributed. Reference kind: our own exact-arithmetic script and a hand-worked case.**

Tested by this project, not reference-checked and not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with this project's own expected values within the stated tolerance. That tests the code against our own working, not against an outside reference. 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 tests. No independent scientist has yet reviewed them.

[Every version of this method](https://www.drybench.com/methods/m/nsaf) · [Every method](https://www.drybench.com/methods/m) · [What the levels mean](https://www.drybench.com/methods/levels)

## Version 1.0.1

**Level: Tested, not reference-checked; Relative within one sample; an index, not a molar amount; shared spectra not distributed. Reference kind: our own exact-arithmetic script and a hand-worked case.** `nsaf@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:** Matches an exact-rational script on McIlwain 2012's NSAF (display formula 1, read at source 24 November 2026 in the version of record's full text) and Drybench's hand case; NSAF after Paoletti et al. 2006, as stated in McIlwain 2012, Paoletti not read; Crux spectral-counts not run. Relative within one sample; an index, not a molar amount; shared spectra not distributed. Research arithmetic.

Each protein's spectra per residue over the sum of that across the proteins sent: an index relative within one sample, not a molar amount.

- **How results are reported:** Exact rationals; spectra per residue, their sum and each NSAF rounded once to the nearest double.
- **Uncertainty:** No uncertainty of the counts is given or propagated.
- **Reference, as its record states it:** an exact-rational script and Drybench's hand case

[What this page can and cannot show](#what-this-page-can-and-cannot-show)

### What was checked

33 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: 22 agree within the tolerance the file states, 11 refuse as the case expects, 0 differ, 0 were not run.

- **File 1, 9 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-11
  - **Reference:** exact rational script (Python fractions), 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** Spectra per residue, their sum and NSAF within absolute 1e-12 (each rounded once from an exact quotient); texts, flags, statuses and codes exact

- **File 2, 24 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-24
  - **Reference:** second implementation (Python 3.13), 2026-11-24; licence PSF-2.0
  - **Tolerance as the file states it:** every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); counts, labels, strings, flags, 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

Paoletti et al. 2006 not read (NSAF as McIlwain 2012 states it); Crux spectral-counts was not run (its download asks for agreement to licensing terms); no second implementation or edge fixture yet; dNSAF, emPAI and iBAQ are not offered (Zhang 2010 and Ishihama 2005 unread); lengths are stated, not derived from a sequence; one session wrote the script and the engine.

### Definition or model

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

### Equations

```equation
NSAF_N = (s_N / L_N) / sum over the proteins sent of (s_i / L_i)
```

| Symbol | Meaning and unit |
| --- | --- |
| N, i | a protein of the list (proteins\[k\]); i runs over every protein sent |
| s\_N / L\_N | spectra per residue of protein N (rows\[k\].spectraPerResidue); its sum over the proteins sent is spectraPerResidueSum |
| s\_N | spectra matched to protein N (spectralCount): under unique-only, spectra of peptides unique to it; under shared-counted-to-each, a shared peptide's spectra counted for each protein it maps to; the basis does not change the arithmetic |
| L\_N | length of protein N in residues, as stated |
| NSAF\_N | normalised spectral abundance factor of protein N |

Source: McIlwain S, Mathews M, Bereman MS, Rubel EW, MacCoss MJ, Noble WS. Estimating relative abundances of proteins from shotgun proteomics data. BMC Bioinformatics 2012;13:308 (NSAF after Paoletti AC et al., PNAS 2006;103:18928, its ref. 5, not read), equation display formula 1 (M1), section Implementation, Software (NSAF), version of record, full text as Europe PMC serves it (JATS XML of PMC3599300); read in full on 2026-11-24 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning a2fc58c4b045. Free to read (CC BY 2.0 (the article's licence element)), checked 2026-11-24. No erratum found (searched crossref (10.1186/1471-2105-13-308): no update or erratum relation, the Europe PMC record as read), 2026-11-24.

### Conventions

- `SUM_OVER_PROTEINS_SUPPLIED` = the proteins sent: Fixed by the method; not an argument. The sum runs over the proteins sent, where McIlwain sums over the protein database; proteins with no spectra change nothing.
- `SHARED_SPECTRA_NOT_DISTRIBUTED` = not distributed: Fixed by the method; not an argument. Shared spectra are not distributed between proteins; dNSAF, which distributes them, is not offered.

What each mode computes:

- `index = nsaf`: NSAF: each protein's spectra per residue over its sum across the proteins sent, unit one; the only index offered (index = nsaf)

### Constants

Constants: none used.

### Worked example

Worked example: one case of nsaf\@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**

- index = nsaf
- proteins\[0\].label = A
- proteins\[0\].spectralCount = 10
- proteins\[0\].lengthResidues = 100
- proteins\[1\].label = B
- proteins\[1\].spectralCount = 20
- proteins\[1\].lengthResidues = 400
- proteins\[2\].label = C
- proteins\[2\].spectralCount = 5
- proteins\[2\].lengthResidues = 50
- sharedSpectraBasis = unique-only

**Steps**

1. a = 0.1, from proteins\[0\].spectralCount, proteins\[0\].lengthResidues; by the equation above; gives rows\[0\].spectraPerResidue.
2. b = 0.05, from proteins\[1\].spectralCount, proteins\[1\].lengthResidues; by the equation above; gives rows\[1\].spectraPerResidue.
3. c = 0.1, from proteins\[2\].spectralCount, proteins\[2\].lengthResidues; by the equation above; gives rows\[2\].spectraPerResidue.
4. sum = 0.25, from a, b, c; by the equation above; gives spectraPerResidueSum.
5. nA = 0.4, from a, sum; by the equation above; gives rows\[0\].nsaf.
6. nB = 0.2, from b, sum; by the equation above; gives rows\[1\].nsaf.
7. nC = 0.4, from c, sum; by the equation above; gives rows\[2\].nsaf.

The working, as the case writes it:

```equation
Spectra per residue 1/10, 1/20, 1/10
sum 1/4
NSAF 2/5, 1/5, 2/5, summing to one.
```

**Answer**

- `rows[0].spectraPerResidue` = **0.1**
- `rows[1].spectraPerResidue` = **0.05**
- `rows[2].spectraPerResidue` = **0.1**
- `spectraPerResidueSum` = **0.25**
- `rows[0].nsaf` = **0.4**
- `rows[1].nsaf` = **0.2**
- `rows[2].nsaf` = **0.4**

Where these values came from: our own exact-arithmetic script and a hand-worked case; exact rationals (Python fractions), by this script, from Drybench's rulings of 11 November 2026 on McIlwain et al. 2012.

At build the tool returned this answer within the tolerance the file states: Spectra per residue, their sum and NSAF within absolute 1e-12 (each rounded once from an exact quotient); texts, flags, statuses and codes exact.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `ALL_ZERO_SPECTRA`: every protein has zero spectra, so the sum is zero Next: Give the spectral counts; a sample with no matched spectra has no NSAF.

### Flags and notes a reply may carry

A flag says a number must be read differently:

- `NO_SPECTRA_MATCHED`: No spectra matched; not evidence of absence.

### Changes

No correction is logged for nsaf\@1.0.1.

## Tools that use it

- [`ms_label_free_abundance`](https://www.drybench.com/methods/tools/ms-label-free-abundance)

## Cite this version

Normalised spectral abundance factor of the proteins in one sample. Drybench; nsaf\@1.0.1; [https://www.drybench.com/methods/m/nsaf/1.0.1](https://www.drybench.com/methods/m/nsaf/1.0.1) (accessed \[date\]).
