Skip to content

Consistency with the PEAgent browser

The contribution scores served by the PEAgent genome browser were produced by the analysis pipeline that accompanies the manuscript, not by this package. If peagent_tool is to be useful for designing new sequences, the numbers it computes from sequence must be the same numbers.

They are.

What was compared

Five crownRoot cell-type-specific ACRs of the maize atlas were recomputed from sequence alone with

scorer = ContributionScorer("maize")
scorer.compute_many({acr_id: sequence},
                    targets=scorer.celltypes_in_tissue("crownRoot"),
                    normalize="tissue")

and each of the resulting 23 cell-type tracks was compared, base by base, with the stored pipeline array that the corresponding browser BigWig was built from. The raw (normalize="none") global track was checked the same way against the pipeline's constitutive-global output for three constitutive ACRs.

Recomputed versus stored contribution scores

Result

Normalization Tracks compared Median Pearson r Minimum r Max absolute difference Max difference relative to track amplitude
"tissue" 115 0.999995 0.999975 3.2 × 10⁻⁴ 0.42 %
"none" 3 0.999999 0.999999 2.0 × 10⁻⁴ 0.09 %

The residual differences are float32 accumulation noise — the two computations ran on different hardware, in different batch orders, years apart. There is no systematic offset.

Why the conventions match

The pipeline computes a cell-type track as:

  1. mutate every position of the 1,344 bp window to all four bases and take the change in the shared 64-d bottleneck embedding;
  2. project onto the mean final-layer weight vector of the cell group;
  3. centre across A/C/G/T at each position;
  4. multiply by the reference one-hot, so only the reference base carries a score;
  5. subtract the mean of step 4 over all valid tissue_celltype groups of the same tissue.

Steps 1–4 are normalize="none"; step 5 is what normalize="tissue" adds. The set of groups averaged in step 5 is taken from the cell-group metadata, which is the same set the pipeline used — for crownRoot, all 23 cell types.

AttributionResult.tissue_reference lists exactly which groups went into the subtraction, so the reference set is never implicit:

result = scorer.compute(sequence, target="crownRoot_cortex", normalize="tissue")
result.tissue_reference
# ('crownRoot_LRC', 'crownRoot_QC', 'crownRoot_atrichoblast', ...)

Reproducing this check

The comparison script is script/56-peagent-tool-docs/01_validate_tissue_norm.py in the analysis repository. It needs the stored pipeline arrays, which are not distributed with the package; the tutorial notebooks are the runnable equivalent.