Comparisons

Do two replicates agree? Does a rescoring reproduce the published scores? Does another assay of the protein, or a predictor, say the same? Compare puts two sets of scores side by side. Before any number, it says whether the two can be compared, and what their agreement can mean.

Two sets of scores, side by side

The Compare view: GRB2's replicate 1 against replicate 2, the compatibility report with every item ok, the scatter of the 1,109 variants scored in both with the line y = x, the statistics (Pearson's r 0.874, Spearman's ρ 0.823, Lin's concordance 0.874, the bias and limits of agreement) and the Bland–Altman plotThe Compare view: GRB2's replicate 1 against replicate 2, the compatibility report with every item ok, the scatter of the 1,109 variants scored in both with the line y = x, the statistics (Pearson's r 0.874, Spearman's ρ 0.823, Lin's concordance 0.874, the bias and limits of agreement) and the Bland–Altman plot
GRB2's replicates 1 and 2: every item of the report ok, so every statistic is given.

The Compare view (after Map in the view switcher) shows two sets of scores: each a run's condition (its combined scores) or one of its replicates, of one run or two, or a MaveDB score set or a predictor kept beside the workspace (below). Pick them under Sides; Swap exchanges them. MaveScape starts with the comparison a workspace most likely asks for: a run scored from a MaveDB record's counts against the record's published scores; otherwise the latest run's first two replicates, or its two conditions, or the last two runs.

The tabs show the comparison: Agreement (a scatter plot and its statistics), Maps (the two maps and their difference), Disagreement (the variants and the positions that differ) and, against a predictor, Classes. In the scatter plot the first side is drawn across, the second up, one point per variant compared, colored by class. Click a point to see the variant in the inspector, as a run scored it; the ring follows it.

The compatibility report

The report comes before the statistics. Each item is ok, qualified (the statistics hold, read as the item says), or blocked (no statistics, and why):

The Compare view of BRCA1's saturation genome editing: Run 1, its counts scored, against the published scores; 3,893 variants matched at the nucleotide level; the scale and independence items qualified; Pearson's r 0.760 and Spearman's ρ 0.677, Lin's concordance and Bland–Altman withheldThe Compare view of BRCA1's saturation genome editing: Run 1, its counts scored, against the published scores; 3,893 variants matched at the nucleotide level; the scale and independence items qualified; Pearson's r 0.760 and Spearman's ρ 0.677, Lin's concordance and Bland–Altman withheld
BRCA1's counts scored against the published scores: correlations only, because the published scores are on the record's own scale, and one experiment analysed twice.

Other sources

Under Other sources, add what to compare a run with, kept beside the workspace rather than opened as one:

A score set or predictor is removed in Map view, Tracks (Undo brings it back).

A score set that writes one protein variant on several rows with different scores (several codons, or several measurements, with no nucleotide names to tell them apart, as Kotler et al.'s TP53 record does) is read as published scores are read: each protein variant as one, its rows merged as DiMSum merges a protein variant's codons (weighted by 1/SE², or averaged without SEs). Frameshifts, which MAVE-HGVS names alike at a codon though they make different proteins, are left out. The report's Variants says how many were merged (FORMATS.md).

Scale

The Compare view of GRB2's Run 1 against its record's published scores (urn:mavedb:00000835-a-1), kept beside the workspace: rescaled by their anchors (nonsense median 0, wild type 1), the points on the line y = x, Lin's concordance 0.996 and a bias of 0.009The Compare view of GRB2's Run 1 against its record's published scores (urn:mavedb:00000835-a-1), kept beside the workspace: rescaled by their anchors (nonsense median 0, wild type 1), the points on the line y = x, Lin's concordance 0.996 and a bias of 0.009
GRB2's Run 1 against its record's published scores, not opened: one experiment on two scales, and rescaled by their anchors, one.

Two sets of scores are compared as scored unless Scale says otherwise:

The anchors are measured too: the wild type's score has its SE, and a median of n controls is uncertain by about √(π/2 × their mean squared SE / n). Rescaled, every score of a side moves with its anchors, by its place between them, so each difference's test carries both sides' anchors' share of its uncertainty, and a position's test their shared share. In simulated pairs of two assays that differ only in scale, with nothing planted, about 4% of pairs have any variant called discordant; leaving the anchors' uncertainty out, 10% to 55% do, the less certain the anchors the more. The anchors, the rescaled scores, the statistics and the tests are checked against R.

Read the anchors before the numbers. GRB2's Run 1 (DiMSum's fitness) and its record's published scores (rescaled by their authors) correlate at r 0.997 on two scales; rescaled by their anchors, Lin's concordance is 0.996 and the bias 0.009. PTEN's lipid phosphatase record writes its wild type as 1 with an SE of 0, though its methods put wild type-like variants from −1.11 to 0.89: rescaled by that row, its activity sits low.

Two screens that only seem to disagree

The Compare view of the TP53 example: the etoposide screen's published scores against Kotler et al.'s screen of the DNA-binding domain, both rescaled by their synonymous and nonsense medians: 3,341 variants, Pearson's r 0.783, Lin's concordance 0.777, a bias of −0.041The Compare view of the TP53 example: the etoposide screen's published scores against Kotler et al.'s screen of the DNA-binding domain, both rescaled by their synonymous and nonsense medians: 3,341 variants, Pearson's r 0.783, Lin's concordance 0.777, a bias of −0.041
TP53: two laboratories' screens, on one scale.

The TP53 example compares two laboratories' screens of p53's function: Giacomelli et al.'s, Z-scores of growth under etoposide in which a variant like the wild type scores higher, and Kotler et al.'s, log₂ fold changes of H1299 cells' growth in which it scores lower. Matched on UniProt P04637's numbering, their 3,341 variants in common correlate at r −0.78: as published they seem to disagree completely. Stating Kotler et al.'s direction gives r 0.78, but a Z-score and a log₂ fold change are two scales, and Lin's concordance and Bland–Altman are withheld. Rescaled each by its own synonymous and nonsense medians, Lin's concordance is 0.78 and the bias −0.04: they agree.

A rescoring against the published scores

The Compare view of Hsp90's Run 1 against its record's published scores, stated to be on one scale: 187 variants, Pearson's r 0.951, Lin's concordance 0.476, a bias of 0.223, and the Bland–Altman plot whose differences rise as the mean fallsThe Compare view of Hsp90's Run 1 against its record's published scores, stated to be on one scale: 187 variants, Pearson's r 0.951, Lin's concordance 0.476, a bias of 0.223, and the Bland–Altman plot whose differences rise as the mean falls
Hsp90: a rescoring correlated with the published scores, but not in agreement.

Correlation is not agreement. The Hsp90 example's Run 1 and its record's own published scores (kept beside) correlate at r 0.95, and both are natural-log change per generation. Stated to be on one scale, Lin's concordance is only 0.48 and the bias 0.22, and the Bland–Altman plot shows why: the difference grows with the effect (slope −0.91), most at positions 585–587, which tolerate nothing. The authors fit null-like variants on their first three time points, before they reach the floor; Run 1 fits all eight. How deleterious those variants are depends on that choice. The report says the two are one experiment analysed twice, so their agreement measures the analyses, and no difference is tested.

Filters

Under Filters, leave out the variants of low confidence on either side (a score resting on a pseudocount, or fitted on fewer replicates or time points than the design has), those whose SE on either side is above a maximum, or those with fewer input reads than a minimum on either side (a condition's: the mean over its replicates). The report says how many each filter left out. A side with no SEs or no counts, as published scores may be, is not filtered on them, and the report says that the filter applies to the other side only. A variant of few reads is mostly noise: DHFR's two conditions agree at r 0.52 over every variant both score, and at 0.77 with low confidence left out.

The agreement

Each statistic is given with its 95% interval:

The statistics equal R's to 13 significant digits (cor.test, DescTools' CCC, BlandAltmanLeh, lm) on seven pairs, among them DHFR's published scores without and with the Lon protease. In simulated pairs of known agreement, from 30 to 1,000 variants, the intervals hold the truth 94–96% of the time. Two are weaker, and the validation reports them as they are: near r = 1, Spearman's interval holds the truth less often (86% with 30 variants, 92% with 200), its ρ biased below the truth there; and with 30 variants on two scales, Lin's holds it 92% of the time.

Read the report with the numbers. Replicates that share their input agree for a reason the experiment does not care about. A rescoring that correlates with the published scores at r 0.76 (BRCA1's saturation genome editing) may differ only in what the authors did to their scores (each exon normalized apart), which the counts do not record.

The maps

The Maps tab of DHFR's comparison, −Lon against +Lon with low confidence left out: the map of each condition on its own scale, and below them the map of their difference, all three at the same positions, the substitution p.Trp47Arg selected in eachThe Maps tab of DHFR's comparison, −Lon against +Lon with low confidence left out: the map of each condition on its own scale, and below them the map of their difference, all three at the same positions, the substitution p.Trp47Arg selected in each
DHFR's two conditions on their maps, with their difference below: the maps pan and zoom together, and a variant clicked is selected in each.

Maps shows the first side's map, the second's, and the map of their difference (first − second), one above the other. They pan and zoom as one: drag, scroll sideways, or zoom with ⌘ or Ctrl and the wheel in any of them, and the others follow. Two stretches of one protein line up on the entry's coordinates. Click a cell to see the variant in the inspector; it is selected in each map. Each side's map is on its own scale, centered on its wild type. The difference is centered on no difference; its hatched cells were scored on one side only, or left out by the filters. Only two sides on one scale have a difference map. Each map exports as SVG.

Disagreement

The Disagreement tab of DHFR's comparison: 201 of 1,715 variants differ beyond their uncertainty, 186 of them higher without Lon; a warning that the differences are 2.8 times as variable as the SEs say; the discordant variants by q; and the mean difference at each position, darker where it differs beyond its uncertaintyThe Disagreement tab of DHFR's comparison: 201 of 1,715 variants differ beyond their uncertainty, 186 of them higher without Lon; a warning that the differences are 2.8 times as variable as the SEs say; the discordant variants by q; and the mean difference at each position, darker where it differs beyond its uncertainty
DHFR: the variants that differ beyond their uncertainty, a warning that the SEs are too small for these differences, and the disagreement by position.

For two independent sides on one scale, each difference is tested against its uncertainty: its z is the difference over the square root of the sum of the two SEs squared, its p two-sided, and its q by Benjamini and Hochberg over the variants tested. A variant is discordant when its q is below 0.05. Replicates that share a sample, or one table scored twice, are not tested: the SE of a difference from both SEs assumes independent errors.

The dispersion says whether the SEs describe how far the two differ: the median z² over its expected value, about 1 when they do. Above 1.5 the view warns that either the SEs are too small, or the two differ nearly everywhere; either way, more variants test as discordant than truly differ. GRB2's replicates differ 8 times as much as their counting SEs say, which is the input bottleneck QC finds as variance beyond counting.

By position: the mean difference of the variants compared at each position, as bars along the target. Each position with 3 or more variants compared is tested too, its z the sum of its differences over their combined SE, with q over the positions. The ten that differ most are listed, with how many of their variants are discordant: a position can differ because one of its variants does. Click a bar to see one of its variants in the inspector.

The tests are checked against R (pnorm, p.adjust). In simulated pairs with planted differences they find 96% of the variants planted, while about 4% of the variants they call differ by chance, within the 5% Benjamini and Hochberg allow. They also find 57 of 60 planted positions. With nothing planted they call none, and the dispersion is about 1.

A predictor by its classes

The Classes tab of PTEN's abundance against AlphaMissense: the abundance scores in each of AlphaMissense's classes as boxes, likely pathogenic lowest, with the synonymous and nonsense medians as dashed lines, a table of each class's median and quartiles, and the AUC of 0.771 (0.755 to 0.787)The Classes tab of PTEN's abundance against AlphaMissense: the abundance scores in each of AlphaMissense's classes as boxes, likely pathogenic lowest, with the synonymous and nonsense medians as dashed lines, a table of each class's median and quartiles, and the AUC of 0.771 (0.755 to 0.787)
PTEN's abundance in each of AlphaMissense's classes: its likely benign substitutions nearer the synonymous variants, its likely pathogenic ones lower.

A predictor is compared by rank (Spearman's ρ; Pearson's r, Lin's concordance, Bland–Altman and the tests of disagreement are withheld) and, when it classes its substitutions (AlphaMissense's likely pathogenic, ambiguous and likely benign; EVE's), by its classes. Classes shows the measured side's scores, as scored, of the variants compared in each class: the middle half as a box, the median as a line, with the measured side's synonymous and nonsense medians (of every variant it scores) as dashed lines, what full function and its loss look like in the assay. The AUC says how well the scores tell the predictor's tolerated substitutions from its damaging ones: the chance that a likely benign one has more of the function than a likely pathogenic one (0.5 no better than chance, 1 always), with DeLong's 95% interval. The AUC and its interval equal R's pROC; in simulated classes of known AUC the interval holds the truth 94–95% of the time.

GRB2's abundance tells AlphaMissense's classes apart with an AUC of 0.78; PTEN's abundance with 0.77, and its phosphatase activity with 0.70. A predictor is not a measurement: where they disagree, the measurement says what happened in the assay, and the predictor what is expected of the protein.

The files

Variants compared (CSV) writes one row per variant compared: the variant (on the entry's coordinates when matched there), as each side names it, its class, each side's score and SE as scored, each score as compared (rescaled, or negated), the difference and mean as compared, and the difference's z, p and q where they were tested. Report and statistics (JSON) writes the two sides (a run's id and output hash; a score set's or predictor's URN and file hash), how they were matched, scaled (the anchors) and filtered, the report, the counts, every statistic, the discordant variants, the disagreement by position and a predictor's classes, with what was withheld and why. Positions (CSV) writes the disagreement by position, By class (CSV) a predictor's classes, and each map exports as SVG. FORMATS.md describes each. A comparison is a view: the workspace keeps the runs, each with its record, and the comparison is made again from them.

From a script

Remote control's compare takes the two sides by name ("Run 1: Replicate 1", "Published scores", "Run 1: +Lon", "AlphaMissense: P62993") or a MaveDB score set's URN (fetched and kept when it is not yet), the scale (scale: scored, stated, nonsense-wt or synonymous-nonsense), what a higher score of a score set means (direction), the filters (low_confidence, max_se, min_reads) and the tab to show (show); it shows the Compare view and returns the report, the statistics, the discordant variants, the disagreement by position and a predictor's classes. export with what: "comparison" writes the variants compared, or, to a path ending in .json, the report and statistics; comparison-positions writes the disagreement by position, comparison-classes a predictor's classes, and comparison-map a map (map: first, second or difference). add_track with provider: "mavedb-scores" and a urn keeps a score set beside the workspace (Remote control).