Why Score Anchors After Filtering?
An anchor is a proposed correspondence between cells from different batches that are judged to represent a shared cell state. Even after candidate pairs have passed a neighborhood-consistency filter, they need not all be equally informative. A pair supported by several nearby candidate anchors in both batches has a different local context from a pair that is isolated or whose neighboring anchors disagree across batches. A reliability score summarizes that difference on a continuous scale.
The score developed here measures local neighborhood support. It is a diagnostic and a way to rank candidate anchors, not a probability that an anchor is biologically correct. Its interpretation depends on the geometry of the chosen representation and on how candidate anchors and neighborhoods were defined.
The same candidate-anchor IDs are used in both sets, so their intersection consists of other proposed correspondences that are locally near the focal anchor at both endpoints. Excluding the focal anchor prevents its own presence from creating artificial agreement. The neighborhood rule should be chosen before scoring and applied consistently within each batch. For example, one may choose the same \(k\) in both batches, or choose a radius appropriate to each space; the choice affects the score and should be reported.
What the Score Measures
The numerator counts locally supported candidate anchors: pairs that are near the focal endpoint in both batches. The denominator counts all candidate anchors near at least one endpoint. Thus \(R_e\) is the fraction of the local union that is shared. A score of 1 means the two local support sets are identical and nonempty. A score of 0 means they have no shared IDs, or that the anchor is unsupported under the stated empty-set convention. Intermediate values indicate partial overlap.
This is a set-agreement measure, not a test statistic. It does not use a null distribution, and a score of 0.8 does not mean there is an 80% chance that the anchor is correct. Two anchors with the same score may also have very different amounts of evidence: one could have four shared neighbors out of five total, while another has forty out of fifty. Retaining the set sizes alongside the score helps reveal that distinction.
Worked Example: Calculating a Jaccard Score
Suppose a hypothetical candidate anchor \(e\) has local support sets \(L_A(e)=\{u,v,w\}\) and \(L_B(e)=\{v,w,x\}\). The shared IDs are \(v,w\), while the union is \(\{u,v,w,x\}\).
Substitute into the definition.
Half of the candidate anchors appearing in at least one local neighborhood appear in both. The score indicates moderate local agreement for this hypothetical pair; it does not establish that the underlying cells are the same biological state.
The score is bounded because the intersection is a subset of the union. If the union is nonempty, then \(0\leq |L_A\cap L_B|\leq |L_A\cup L_B|\), so \(0\leq R_e\leq1\). A perfect score requires identical nonempty sets. The special convention for two empty sets is not a consequence of this ratio; it is a deliberate choice to make unsupported anchors score zero and to preserve a warning that there was no local evidence to compare.
Why Jaccard Gives a Relative Local Agreement
Let \(a=|L_A\cap L_B|\) be the number of shared local anchors, \(b=|L_A\setminus L_B|\) the number found only in batch A's local set, and \(c=|L_B\setminus L_A|\) the number found only in batch B's local set. When the union is nonempty, its size is \(a+b+c\), so
This form makes the interpretation explicit: shared support is the numerator, and both shared and discordant local support contribute to the denominator. Adding a new shared anchor while holding the discordant counts fixed raises the score, since \((a+1)/(a+b+c+1)>a/(a+b+c)\) whenever \(b+c>0\). Adding a one-sided anchor lowers it when \(a>0\), because \(a/(a+b+c+1)<a/(a+b+c)\). When \(a=0\), adding only one-sided anchors leaves the score at zero.
This behavior is useful when the intended question is whether the candidate's local anchor neighborhoods agree, including their size. It also means that a large neighborhood can lower the score if it contains many one-sided candidates. The score should therefore be interpreted together with neighborhood sizes and the geometric choices that produced them.
Worked Example: Comparing Two Candidates
In hypothetical data, anchor \(e_1\) has 6 shared local anchors and 2 anchors found in only one batch's local set. Anchor \(e_2\) has 3 shared anchors and 1 one-sided anchor. Calculate both scores.
For \(e_1\), the union has \(6+2=8\) IDs, so
For \(e_2\), the union has \(3+1=4\) IDs, so
The scores are equal, but \(e_1\) has twice as many shared local anchors as \(e_2\). The equality says that the same fraction of each union is shared; it does not say the amount of supporting evidence is identical. A sensible report gives the score and the local set sizes, especially when neighborhoods are small.
Worked Example: An Unsupported Candidate
For a hypothetical candidate \(e_3\), suppose no other candidate anchors fall near either endpoint: \(L_A(e_3)=\varnothing\) and \(L_B(e_3)=\varnothing\). The numerator and denominator in the Jaccard formula would both be zero:
This expression is undefined, so it must not be reported as a computed Jaccard value. Under the convention in this tutorial, set \(R_{e_3}=0\) and mark the anchor as unsupported. That flag matters: the score is zero because no local support was available, not because observed local sets disagreed. For comparison, if \(L_A(e_4)=\{q\}\) and \(L_B(e_4)=\{r\}\), then the union has two IDs and the intersection is empty, giving \(R_{e_4}=0/2=0\). This second zero reflects observed disagreement rather than two empty sets.
How Scores Should Influence Downstream Weights
When an integration method combines information from multiple anchors, reliability scores can guide their relative influence. Holding other design choices fixed, an anchor with stronger local agreement would generally be given at least as much influence as a less-supported anchor. This reduces the contribution of isolated or locally inconsistent pairs while retaining graded information that a yes-or-no filter would discard.
The score is not itself a prescribed weight. A downstream procedure may transform or normalize scores, impose a threshold, or combine them with other evidence. For a simple illustration only, suppose two anchors have scores 0.75 and 0.25, and a hypothetical weighting rule makes raw weights proportional to those scores. Their normalized relative weights would be \(0.75/(0.75+0.25)=0.750\) and \(0.25/(0.75+0.25)=0.250\). This arithmetic illustrates relative scaling; it does not define a universal integration rule. In particular, zero scores, score ties, and the number of anchors contributing near a cell require explicit handling by the downstream method.
A score should not be converted into a probability or interpreted as a calibrated measure of truth unless a separate calibration procedure justifies that interpretation. It reflects the chosen candidate set, feature space, neighborhood size, and geometry. If the geometry is poor or the candidate set is incomplete, a high score can reflect consistent local structure that is nonetheless biologically misleading.
Assumptions, Diagnostics, and Alternatives
The reliability score is most interpretable under several practical conditions. The chosen feature space should place biologically similar cells near one another; otherwise “local support” has little biological meaning. Candidate anchors should be defined consistently and should represent plausible cross-batch correspondences. Neighborhood sizes should be adequate to provide support, while not so broad that they mix distinct states. Finally, distances and neighborhood rules should be meaningful within each batch; equal numerical radii are not automatically comparable if the spaces have different scales.
Inspect score distributions and the underlying sets rather than relying on a single cutoff. Useful checks include comparing scores across neighborhood sizes, examining whether low scores cluster in rare states or at batch-specific boundaries, and checking whether high scores are driven by a few repeated cells or many distinct candidate pairs. A score that changes sharply under a small change in \(k\) is sensitive to the neighborhood definition. Many empty or tiny local sets indicate inadequate local anchor coverage, not necessarily widespread biological mismatch.
The Jaccard score is one choice among alternatives. The Dice coefficient gives relatively more emphasis to shared members; for nonempty union its formula is \(2|L_A\cap L_B|/(|L_A|+|L_B|)\). It lies between 0 and 1 when \(|L_A|+|L_B|>0\). If both sets are empty, the denominator is zero; one may explicitly assign 0 and flag the anchor as unsupported, as here. The overlap coefficient, \(|L_A\cap L_B|/\min(|L_A|,|L_B|)\), emphasizes whether the smaller set is contained in the larger, but can give a high value despite substantial extra support on one side. A binary filter is simpler, but discards distinctions among anchors that pass it. None of these summaries replaces examining the geometry or biological context.
Practical Scoring Workflow
State which candidate pairs are being scored and use the same IDs when comparing local support across batches.
Choose a feature space and a neighborhood rule, such as a fixed number of nearest cells, and exclude each focal endpoint itself.
Record \(L_A(e)\) and \(L_B(e)\), calculate the intersection and union sizes, and apply the empty-set convention when needed.
Compare scores alongside set sizes and neighborhood sensitivity; investigate unsupported or unstable anchors before assigning downstream influence.
The score is limited by construction. It summarizes local agreement among the candidate anchors that were found, not anchors that were missed. It does not establish shared biological identity, correct batch correction, or preservation of all cell states. A high score can arise in a large common population even when a rare population has few supporting candidates. Conversely, a low score in a rare state may reflect limited sampling rather than a false correspondence. These limits are reasons to combine scoring with geometric and biological diagnostics, not reasons to treat the score as a verdict.
Check Your Understanding
Work through the questions, then check the brief solutions below.
- If \(L_A=\{m,n,p\}\) and \(L_B=\{n,p,q\}\), calculate the Jaccard score.
- What does the convention \(R_e=0\) for two empty support sets indicate, and why is the ratio not directly defined?
- Two anchors each have a score of 0.6, but one has 3 shared local anchors and the other has 30. What information is the score omitting?
- Why is it incorrect to interpret a score of 0.9 as a 90% probability that an anchor is correct?
- Name one diagnostic for detecting sensitivity of scores to neighborhood choice.
Solutions. (1) The intersection has 2 IDs and the union has 4, so \(R=2/4=0.500\). (2) It indicates no other candidate anchors support either endpoint under the chosen neighborhoods. The union size is zero, so the formula gives \(0/0\), which is undefined; the assigned zero is an explicit convention and should retain an unsupported flag. (3) It omits the absolute amount of local support; report the shared and union sizes as well as the ratio. (4) The score is a set-overlap fraction, not a calibrated probability of biological correctness. (5) Recalculate scores for several reasonable neighborhood sizes and check whether the rankings or values change substantially.