Scoring

Scoring turns the counts into a functional score with a standard error for every variant, in a run that keeps everything needed to repeat it. The parameters and the filters are in plain view in the Score view.

Scores

A variant's score in one replicate is the natural logarithm of its frequency after selection over its frequency before, normalized so that the reference scores 0, with a pseudocount (0.5) added to every count and a standard error from the counts, as Enrich2 computes them. Normalizations:

Optional rescaling anchors the scale: nonsense median 0 and wild type 1, or synonymous median 0 and nonsense median −1.

The Score view: parameters, two runs of the GRB2 counts, the run's warnings, filter flow and scores by classThe Score view: parameters, two runs of the GRB2 counts, the run's warnings, filter flow and scores by class
Two runs of the GRB2 counts. Each run lists its parameters, warnings, filter flow and scores by class.

Time series

A time series (the same library sampled at three or more times) is scored by default from every time point: each variant's score is the slope of its normalized log count against time scaled to 0–1, fitted by weighted least squares, each point weighted by its counting precision, as Enrich2 computes it. Ordinary least squares and the log ratio of the first and last samples are the other choices under Scored by. Times need not be evenly spaced.

The map of the simulated time series with p.Ser2Ter selected; the inspector shows its time course in three replicates, the points and dashed fitted lines falling over eight generationsThe map of the simulated time series with p.Ser2Ter selected; the inspector shows its time course in three replicates, the points and dashed fitted lines falling over eight generations
A nonsense variant's time course in each replicate: the points, the fitted lines, and each slope, the replicate's score.

The inspector draws a variant's time course in each replicate. Quality control reads the time points used and the fit of the time courses.

The Score view of the simulated time series: scored by weighted least squares on every time point, with the standard error of a slope at least what counting predictsThe Score view of the simulated time series: scored by weighted least squares on every time point, with the standard error of a slope at least what counting predicts
A time series in the Score view: Scored by and Standard error of a slope appear when the design is a time series.

Sorted bins

When cells are sorted by a reporter (abundance, binding, expression) into ordered bins and each bin is sequenced, a variant's score comes from its distribution over the bins:

The map of the simulated sort-seq example with a nonsense variant selected; the inspector shows its reads in each bin and its distribution over the four bins in three replicates, falling from bin 1, beside the wild type's rising toward bin 4The map of the simulated sort-seq example with a nonsense variant selected; the inspector shows its reads in each bin and its distribution over the four bins in three replicates, falling from bin 1, beside the wild type's rising toward bin 4
A nonsense variant's distribution over the bins in each replicate, beside the wild type's (dashed).

Each replicate's scores are then scaled: by default so that its median nonsense variant scores 0 and the wild type 1 (VAMP-seq); or so that the median of its lowest 5% scores 0 (MultiSTEP, for libraries without nonsense variants); or not at all. The VAMP-seq preset also leaves out variants whose summed bin frequency is below 10−4.75, keeps variants seen in two or more replicates, and combines replicates by their mean with SE their SD over √k.

The Score view of the simulated sort-seq example scored by maximum likelihood with the wild type's spread, beside a run by the weighted averageThe Score view of the simulated sort-seq example scored by maximum likelihood with the wild type's spread, beside a run by the weighted average
Sorted bins in the Score view: the weighted average and maximum likelihood, the scale of each replicate, and σ.

On factor IX (MaveDB urn:mavedb:00001200-a-1), MaveScape reproduces every published replicate score from the counts, to 10−15, and the combined scores exactly. On a simulated sort, its maximum-likelihood fits equal fitdistrplus's fitdistcens to 3 × 10−7, and track the true shifts more closely than the weighted average.

Barcodes

A table of barcodes (Opening your data) is scored in either of two ways, chosen under Barcodes:

Either way every barcode is scored and compared with its variant's other barcodes: its departure is its difference from their inverse-variance mean, in units of their counting error together, over √φ, where φ is how much more a replicate's barcodes disagree than counting explains (the median squared departure over its value under counting alone). A barcode departing by more than 4 is an outlier, found one at a time so that one outlier does not make its siblings look off; variants need three barcodes for this. The barcode filter leaves outliers out of the sums or the combination, and a minimum number of barcodes per variant can be required. The inspector lists a variant's barcodes in each replicate, with their counts, scores and departures.

The map of the simulated barcoded library scored barcode by barcode, with the inspector listing a missense variant's barcodes in three replicates: their reads before and after selection, scores and departures, one marked an outlier at 7.2The map of the simulated barcoded library scored barcode by barcode, with the inspector listing a missense variant's barcodes in three replicates: their reads before and after selection, scores and departures, one marked an outlier at 7.2
A variant's barcodes in each replicate; one departs from the others by 7.2 and is marked an outlier.

On a simulated barcoded library with a map in conflict for 1.5% of its barcodes, MaveScape scores every barcode, and every variant from its summed barcodes, equal to dms_variants 1.6.0's func_scores by barcode and by substitution to 5 × 10−13, whether the counts come with MaveScape's map, in dms_variants' own variant_counts layout, or in Enrich2's layout. Against the library's true effects, the barcodes scored and combined by REML track them more closely (r = 0.990) than the sums (0.977), and their 95% intervals hold the true effect 94% of the time.

DiMSum's error model

For an input and an output, Scored by offers DiMSum's fitness and error model (Faure et al., Genome Biology 2020), computed as DiMSum 1.4 computes them, for the replicates of each condition and tile together:

DiMSum fits its error model by nonlinear least squares on 100 bootstrap samples of up to 10,000 variants from random starts, and averages them. The model is linear in its terms, so its least-squares fit has one answer: MaveScape computes it on every variant at once, and gives in brackets the 10th and 90th percentiles of a seeded bootstrap of it, as DiMSum reports its own (DiMSum labels them a 90% interval). The DiMSum-compatible preset chooses this model, fixed effects and no minimum input count; the run's table of replicates lists each replicate's scale, shift and terms.

The Score view of the GRB2 example scored by the DiMSum-compatible preset: DiMSum's fitness and error model, with a table of each replicate's scale, shift, input and output terms (input 20 to 38, output 1.7 to 5.3) and additive SD, with their percentilesThe Score view of the GRB2 example scored by the DiMSum-compatible preset: DiMSum's fitness and error model, with a table of each replicate's scale, shift, input and output terms (input 20 to 38, output 1.7 to 5.3) and additive SD, with their percentiles
GRB2 scored by DiMSum's model: input terms of 20 to 38 against outputs of 1.7 to 5.3, a bottleneck before selection.

Against DiMSum 1.4's own functions on GRB2, DiMSum's demonstration data (four replicates of nucleotide variants) and a fixture with zero counts and dropouts planted, MaveScape finds the same threshold and the same variants to fit, the same scales and shifts (within 5 × 10−7 where R's minimizer converges), and an error model equal to DiMSum's own fit on every variant within 5 × 10−6, inside DiMSum's percentiles; given DiMSum's parameters, every fitness, σ and merged score is DiMSum's within 10−12. GRB2 scored this way follows the Domainome's published scores with r = 0.994. On simulated experiments with a bottleneck of 25 cells per variant, its 95% intervals hold the true effects 93–96% of the time, against 67–69% for counting alone with fixed effects and 87–88% with REML. The moderated combination, given the log ratios' counting error alone, finds the bottleneck in its own shared model and holds 95–97%.

Two conditions

A design with two or more conditions (each replicate's condition is set in the Experiment view, and one condition is the reference) is scored in each condition, and each other condition is compared with the reference: every variant measured in both gets a differential score with its SE, 95% interval, p-value and q-value (Benjamini and Hochberg, within each comparison). Conditions compared by offers three methods:

The Score view of the simulated two-condition example: With ligand vs Without ligand compared by limma, 94 variants lower with the ligand at q below 0.05, a volcano plot with the binding site's variants far to the left, and the largest differences listedThe Score view of the simulated two-condition example: With ligand vs Without ligand compared by limma, 94 variants lower with the ligand at q below 0.05, a volcano plot with the binding site's variants far to the left, and the largest differences listed
A comparison in the Score view: how it was made, how many variants differ, the volcano plot and the largest differences.

On the two-condition fixture, MaveScape's limma differential equals mutscan 1.2.0's within 2 × 10−10 for the log fold changes and 10−12 for the SEs and p-values. On CBS's yeast complementation at two vitamin B6 levels (MaveDB urn:mavedb:00000005-a-5 and -a-6: 9,409 variants from four shared inputs) it is within 4 × 10−11. Enrich2 2.0.2's z between conditions, which Enrich2's command never computes, is reproduced within 5 × 10−13. On simulated experiments with shared inputs and a bottleneck, the paired intervals hold the true difference 95–97% of the time and limma's 97–98%. As independent they hold 99–100% of the time: they are too wide, and they find fewer of the variants that differ. With noise between replicates beyond counting and only three pairs, REML has little to estimate that noise from: its paired intervals held 82–94% and called 1–11% of the unchanged variants at q < 0.05. The moderated combination learns that noise from every variant: over 40 simulated experiments its paired intervals hold the true difference 95.0% of the time (REML 88.3%), and limma's 96.5%. Limma stays the default where it applies, since it models the counts themselves.

Replicates

Technical replicates (one library sequenced more than once) are summed first. Each biological replicate is scored on its own, and a variant's replicate scores are combined:

Each variant also has Cochran's Q and I², and how far its score moves when one replicate is left out; τ² with REML and Enrich2's estimator. The inspector shows them.

The moderated combination

REML estimates τ², the noise between replicates beyond counting, from each variant's own two to six scores. With so few it is often 0 by chance, and the variant's interval is then too narrow. MaveScape 0.1 combined replicates this way, and on simulated experiments its 95% intervals held the truth as little as 82% of the time. The moderated combination borrows from every variant, as DiMSum's error model and limma's moderated variances do (Faure et al. 2020; Smyth 2004):

Its fitted model is in the run's notes and its methods paragraph: a, b, the reference's shift and the prior.

The map of the simulated example rescaled so that nonsense scores 0 and the wild type 1, with p.Lys3Glu in the inspector: its score of 0.52 with its SE, a 95% interval by t at 11.3 degrees of freedom, and the rescaling anchors' shared uncertainty, ±0.012, beside itThe map of the simulated example rescaled so that nonsense scores 0 and the wild type 1, with p.Lys3Glu in the inspector: its score of 0.52 with its SE, a 95% interval by t at 11.3 degrees of freedom, and the rescaling anchors' shared uncertainty, ±0.012, beside it
A rescaled score in the inspector: its interval by t at its degrees of freedom, and the anchors' uncertainty (SE_scale), shared by every score, apart.

Intervals that hold the truth. MaveScape's coverage suite (validation/coverage.mjs) scores simulated experiments with known effects, 40 of each of 26 kinds: depths from 30 to 2,000 reads per variant, two to six replicates, bottlenecks, selection noise, shared inputs, overdispersed reads, time series, sorted bins, barcodes, DiMSum's fitness, rescaled scores and differential scores. With MaveScape's defaults, the intervals hold the truth 93.6–96.5% of the time in every kind; REML's 81.8–95.5%. On experiments made by an independent simulator, the Bloom lab's dms_variants (three selections sharing one input), they hold 94–98% (REML 83–86%). On real data, which has no truth, each replicate is held out and predicted from the others: on GRB2 and CBS about 6% fall beyond ±1.96 SD, as about 5% should (REML: 23% and 4%); on factor IX 10% (REML 26%); on BRCA1's E2 assay 12% (REML 18%).

What no variance can fix, and the suite shows:

Filters, in order

Variants pass eight stages in order (nine for a table of barcodes); a variant left out is left out at its first failing stage, with that stage as its reason. The filter flow shows how many each stage removed.

  1. Counted in a replicate (always): counted in every sample of at least one replicate; for a regression, at the first time point and at the minimum of time points.
  2. Valid identifier (always): a valid name that agrees with the target.
  3. Variant class: the classes scored.
  4. Exclusion list: identifiers you exclude.
  5. Minimum input count, per replicate (default 1: a variant with no input reads was not in that library).
  6. Minimum total count, per replicate.
  7. Minimum barcodes (a table of barcodes), per replicate: the barcodes measured, outliers left out by the barcode filter not counting.
  8. Minimum usable replicates.
  9. Maximum SE.

Variants scored from fewer replicates than expected, or with a zero count, are kept but marked low confidence.

Presets

MaveScape defaults leave out a replicate measurement with no input reads, floor a regression's SE at counting's, and combine replicates by the moderated combination. Enrich2-compatible reproduces Enrich2 2.0.2's "ratios", "WLS" and "OLS": no count filter, every time point required, SEs scaled by the residuals alone, variants combined only when scored in every replicate, and its random-effects estimator. Either keeps the normalization chosen and, for a time series, the model; with two conditions, the Enrich2-compatible preset compares them as Enrich2 does (as independent), the others by limma where it applies. DiMSum-compatible (an input and an output) scores by DiMSum's fitness and error model with no count filter and combines by fixed effects. Any parameter can be changed from any preset.

Published scores

A table of published scores (a score set opened from MaveDB, or a table with a column of scores) is not scored: its design, of model published scores, names the column of scores and, when the table gives them, of standard errors and 95% intervals, and its run reads them as they are. The Score view shows Read as published in place of the scoring parameters; the filters that apply are the classes left out, an exclusion list and a maximum SE. A variant the table gives no score is left out with the stage a score in the table; a row repeating an earlier one's variant and scores is read once. To rescore, open the counts with a design (Public data).

Runs

Each scoring is a run: immutable, named, with an id made from its table, design, parameters and the scoring engine's version. Scoring the same inputs again shows the existing run rather than computing it twice. A run keeps its inputs and the SHA-256 of its output, not the scores: when a workspace is reopened, each run is recomputed from its recorded inputs and must have its recorded hash, and the run says reproduced (or why not).

The scoring engine computes its logarithms with fdlibm's algorithms in plain arithmetic, so every browser gives the same bits (why). Runs made by MaveScape 0.1.0, which used the browser's own logarithms, reopen with scores that differ only in their last digits, and say so.

Robustness to these choices

Whether a run's conclusions survive other reasonable choices of these parameters (another pseudocount, normalization, model of uncertainty or combination of replicates, other filters, each replicate left out) is its robustness: below the run in Score, Check robustness scores it again each way and says, variant by variant, which classes hold under every one and which depend on a choice.

When scoring is refused

A run that cannot be done as asked is refused with the reasons, never quietly done another way: a design with errors, a blocking problem in the table, a normalization whose reference is absent, a rescaling anchor missing, or parameters that cannot score (a pseudocount of 0, Enrich2's estimator without every replicate). DiMSum's model is refused for designs other than an input and an output, for barcodes scored one by one, when the wild type has no reads in a sample, and when fewer than 30 variants per replicate are counted in every sample above its threshold, too few to fit the scales and the error model (both can be turned off).