HoloGenome, DNA as a hologram of measured helix physics

Turn DNA into a vector that winds like the real helix.

HoloGenome reads a stretch of A, C, G and T and gives you one fixed-width vector. Its phase turns by the measured twist of each base pair step, so the order along the helix is in the vector. Then it is graded against laboratory measurements it never saw, with the losses published beside the wins.

dotnet add package EvaluatedApplications.HoloGenome

Commercial licence for commercial use. Evaluation and non-commercial use are permitted.Licence terms

How it scores

Four views of the same graded runs: the vectors against their own controls, the best trained network (where HoloGenome loses), the helical period a small model finds by itself, and the measured twist along one window.

Linear readout on vectors, held-out correlationTrained on 12,472 random-sequence constructs and tested on 82,368 yeast-gene constructs it never saw, the vectors with the measured twist score r = 0.529, against 0.483 with one constant twist. Adding the local-shape layer lifts it to 0.600. Counts of short words score 0.253, and shuffled sequence 0.260.0.000.200.400.600.80Measured twist plus shape0.600Measured twist0.529One constant twist0.483Shuffled order0.260Word counts0.253Correlation r with the held-out measurement; the line is the 95% interval
Data behind the diagram
Linear readout on vectors, held-out correlation. Trained on random sequence, tested on yeast genes it never saw
Vectors built withCorrelation r95% interval
Measured twist plus shape0.6000.591 to 0.609
Measured twist0.5290.520 to 0.539
One constant twist0.4830.473 to 0.494
Dinucleotide-shuffled sequence0.2600.249 to 0.272
Counts of 1-, 2- and 3-base words0.2530.239 to 0.267
Differences between those readouts
ContrastDifference in r95% interval
Measured twist over constant twist0.0460.041 to 0.050
Shape layer over measured twist0.0710.063 to 0.078
Held-out correlation, by library. The fitted model was trained on the yeast tiling library and scored on each library with shared sequence removed. The DNAcycP scores are published figures
LibraryDNAcycP, trained network22-parameter fitZero-parameter score
Random sequence0.930.540.31
Chromosome V tiling0.770.500.36
Nucleosome0.890.600.46
Helical period a small phasor model settled on, bases per turn. Every run starts from a neutral 12 bases and is never told the helical period
LibraryFound from real dataOrder scrambledLabels scrambled
Yeast tiling10.4912.0312.05
Random sequence10.5112.0112.01
Chromosome V tiling10.4812.0312.04
Nucleosome10.5111.9612.03
Where the period search started, yeast tiling library
Started at (bases per turn)Settled at (bases per turn)
66.01
910.49
1210.49
1818.01
2424.48
Zero-parameter score: strength of the AA/TT step pattern at three periods, correlation with bendability
LibraryHelical period7 bases15 bases
Random sequence0.307-0.013-0.022
Yeast tiling0.430-0.065-0.090
Chromosome V tiling0.364-0.060-0.065
Nucleosome0.465-0.037-0.053
50-base library0.221-0.058-0.054
More training, same accuracy: held-out correlation after training the readouts with iterative optimisation
Vectors built withRandom sequenceChromosome V tilingNucleosome
Measured twist plus shape0.5440.5240.620
Measured twist0.5700.4830.578
One constant twist0.5290.4620.558
The 50-base window, cumulative helix turns
BaseLetterMeasured twistConstant 34.3 degrees
1A0.0000.000
2T0.0810.095
3G0.1850.191
4C0.2780.286
5G0.3790.381
6T0.4660.476
7A0.5710.572
8C0.6590.667
9G0.7590.762
10T0.8460.858
11T0.9440.953
12A1.0491.048
13G1.1371.143
14C1.2311.239
15A1.3341.334
16A1.4321.429
17A1.5291.524
18A1.6271.620
19A1.7241.715
20T1.8061.810
21T1.9031.906
22T2.0012.001
23T2.0982.096
24T2.1962.191
25G2.2992.287
26C2.3932.382
27G2.4932.477
28C2.5862.572
29G2.6872.668
30A2.7882.763
31T2.8692.858
32C2.9702.954
33G3.0703.049
34A3.1713.144
35T3.2523.239
36C3.3533.335
37G3.4533.430
38T3.5413.525
39A3.6463.621
40G3.7343.716
41C3.8283.811
42T3.9163.906
43A4.0214.002
44G4.1104.097
45C4.2034.192
46T4.2924.287
47A4.3974.383
48G4.4864.478
49C4.5794.573
50A4.6834.669
Scores are from graded runs against Loop-seq bendability measurements that were never used to build the encoding. The twist view is generated by running the published package (release 0.1.1). Every bar, dot and figure on this page is read from the same data file.

The numbers

bases per turn found by a small model that was never told the helical period, on four independent libraries (the crystallographic value is 10.534)
10.48 to 10.51
correlation with held-out bendability using the measured twist of each base pair step, against one constant twist
0.529 vs 0.483
correlation with held-out bendability once the local-shape layer is added, against 0.253 for counts of short words
0.600
behind the best trained network, DNAcycP, on every library where it has published scores (0.93, 0.77 and 0.89 against 0.54, 0.50 and 0.60)
0.28 to 0.39
See the numbers
  • Measured twist beats a constant twist: 0.529 against 0.483

    A linear readout trained on 12,472 random-sequence constructs and tested on 82,368 yeast-gene constructs (no shared sequence, forward or reverse complement). The difference is 0.046, with a 95% interval of 0.041 to 0.050. Adding the local-shape layer lifted r to 0.600, a further 0.071 (interval 0.063 to 0.078).

  • Order matters, not just composition

    The same readout on counts of 1-, 2- and 3-base words scored r = 0.253, and on vectors built from dinucleotide-shuffled sequence it scored 0.260. Label-permutation checks landed at zero, as designed.

  • A zero-parameter score finds the helix

    The strength of the AA/TT step pattern at the helical period of 10.53 bases per turn is a closed-form number with nothing fitted. It correlates with bendability at r = 0.22 to 0.46 across five independent libraries. The same score at a 7-base or 15-base period is slightly negative (r = -0.01 to -0.09) on every library.

  • The helical period falls out of the data

    A small phasor model that was allowed to choose its own period, starting from a neutral 12 bases, settled at 10.49, 10.51, 10.48 and 10.51 bases per turn on four independent libraries (the crystallographic value is 10.534). With the base order or the labels scrambled it stayed near 12.0. The basin is narrow: runs started at 9 or 12 bases found it, and runs started at 6, 18 or 24 bases found nothing.

  • Where it was measured

    Loop-seq DNA cyclizability: how readily a 50-base stretch of DNA bends into a loop (Basu et al. 2021, Nature 589:462). Each figure is a Pearson correlation between prediction and measurement on sequences the model had not seen. The measurements were never used to build the encoding.

Release 0.1.1Built on Phasor and HoloDb · Twist tables built in · net8.0 and net10.0

Where it did not win

The results that went against it, stated in full.
  • It does not beat the best trained model

    DNAcycP, an approximately 94,000-parameter trained neural network, reaches r = 0.93, 0.77 and 0.89 on the libraries where it has published scores (published figures). The best 22-parameter physical model here reached 0.54, 0.50 and 0.60 on the same libraries, trailing by 0.28 to 0.39.

  • More training did not help

    Training the hologram readouts with iterative optimisation left accuracy where it was (r 0.46 to 0.62 across the libraries tested). Running the phasor models for 2.5 times as many steps moved their scores by at most 0.0001.

  • The measurement itself has a ceiling

    Loop-seq replicates agree at roughly r = 0.84 to 0.87, so no model can score near 1.0 on it.

  • The simplest zero-parameter score is modest

    At r = 0.22 to 0.46 it is well below any trained readout. Its value is that it needs no fitting and matches the known periodicity of the double helix.

What you can build

Made from what the package ships: the encoder, the twist tables and the window store.
  • A strand-aware DNA vector for any window of sequence

    One call turns A/C/G/T text into a fixed-width vector whose phase follows the published twist of each base pair step, so order along the helix is in the vector, not just which letters are present.

  • Physical features for your own models

    Feed the vectors to any regression or classifier. On a held-out bendability test, a plain linear readout on these vectors beats the same readout on constant-twist vectors and on base-composition counts.

  • A queryable window store

    Slide a window along a sequence, store each hologram in HoloDb next to ordinary SQL columns (source, start, sequence), and read them back or compare them by dot product.

  • A helix-aware teaching tool

    Show where a sequence winds tighter or looser, how many turns it makes, and why the helix repeats about every 10.5 bases, all computed from published tables.

  • Your own shape layer

    Load a minor-groove, propeller-twist, roll and helix-twist pentamer table and add it to the encoding. On the held-out test, the shape layer added measurable accuracy.

  • A measure-it-yourself harness

    The encoding takes its numbers from published tables, so any score you derive from it can be compared with an independent laboratory measurement, with no fitted constants hiding in the encoder.

Run it yourself

Encode a 50-base window, count its helix turns, read the mean twist, and store the window beside ordinary SQL columns.
C#
using HoloDb;
using HoloGenome;

var encoder = new GenomeEncoder(new GenomeEncoderOptions { Dim = 512, Twist = OlsonTwist.Instance });
string seq = "ATGCGTACGTTAGCAAAAATTTTTGCGCGATCGATCGTAGCTAGCTAGCA";
double[] h = encoder.Encode(seq);

// How many turns does the helix make along this sequence?
Console.WriteLine($"{h.Length} reals; helix turns: {encoder.HelixPhases(seq)[^1] / (2 * Math.PI):F2}");

// The mean measured twist gives the helical repeat.
double sum = 0;
foreach (char a in "ACGT") foreach (char b in "ACGT") sum += OlsonTwist.Instance.TwistDegrees(a, b);
Console.WriteLine($"{360 / (sum / 16):F4} bases per turn");

// Store the window beside ordinary SQL columns and read it back.
var store = new GenomeWindowStore(new HoloDbService(new HoloDbOptions()));
store.Put([new GenomeWindow(1, "demo", 0, seq, h)]);
Console.WriteLine(store.Get(1)!.Sequence == seq);
Output
512 reals; helix turns: 4.68
10.5340 bases per turn
True

This is the complete program, compiled and run against the published package.

How it works

A stretch of DNA becomes one list of phase angles. Each base is a Phasor symbol. As you move along the sequence a carrier phase advances by the measured twist of each pair of neighbouring bases (the published table of Olson et al. 1998), so the vector records how the real double helix winds, not just which letters are present.

An optional second layer adds local shape (minor-groove width, propeller twist, roll, helix twist) from a pentamer table you supply, weighted in as extra signal beside the helical phase. Everything is bound and summed into a single fixed-width vector.

  • Each base is a Phasor symbol

    The encoder uses the Phasor codec, so a window is one vector you can bind, sum, store and compare by dot product like any other Phasor value.

  • The carrier follows the measured twist

    The phase advances by the measured twist of each pair of neighbouring bases, taken from a published table that is built in. The vector records how the helix winds along the window.

  • Shape is optional and yours

    Supply a pentamer table and its minor-groove, propeller-twist, roll and helix-twist values are weighted in beside the helical phase. No third-party shape data ships in the package.

  • Nothing in the encoding is invented

    Each number comes from a cited measurement. The one constant twist of 34.3 degrees exists only as the sequence-blind control.

Everything in the package

  • GenomeEncoder

    Encode(window) gives the fixed-width vector, EncodeWindow(sequence, start, length) encodes a window and uses the bases outside it only as shape context, and HelixPhases(window) returns the cumulative helix angle along the window.

  • Twist models

    OlsonTwist is the measured table, with all six step parameters per pair of bases. ConstantTwist is the sequence-blind control. Setting no twist model turns the helix off.

  • Local-shape layer

    PentamerShapeTable loads or parses a table you supply, falls back to the reverse complement when a pentamer is missing, and counts the misses. Nothing from a third-party shape table is in the package.

  • Window store

    GenomeWindowStore keeps windows in a HoloDb table with ordinary SQL columns beside the hologram: bulk and atomic puts, reads by id, and float32 packing.

  • Strict input

    Dna.Normalise accepts A, C, G and T and throws on anything else. Reverse complement and complement helpers are included.

When another tool fits better

  • You need the most accurate bendability predictor. Use DNAcycP, which is trained for exactly that and scores far higher on Loop-seq.
  • You need shape tracks for a whole genome. Use a dedicated shape predictor such as DNAshapeR; HoloGenome only reads a table of shape values you load.
  • You need alignment, variant calling or annotation. HoloGenome is not an aligner or a caller. It encodes windows of sequence for physical comparison.
  • You need clinical or consumer results. It makes no health, disease-risk, drug-response or ancestry claims.

Know before you start

What HoloGenome does not do, and where to be careful
  • Sequences must be A, C, G and T. Anything else is rejected, not guessed.
  • The hologram is an unnormalised sum, so compare windows of equal length.
  • The encoding is strand-specific: a sequence and its reverse complement give different vectors (cosine 0.23 for the example above).
  • Stored holograms are float32, exact to about 6e-8 relative error.
  • All grading so far uses one kind of measurement (Loop-seq bendability in yeast-derived and random sequence). Nothing is claimed for other organisms, other assays or chromatin in the living cell.
  • The graded scores on this page (the linear readout, the zero-parameter helical score and the fitted phasor models) come from a research harness and are not in the shipped package. The package ships the encoder, the twist tables and the window store.
  • The shape layer was graded with a pentamer table from the DNAshapeR project. That table is not shipped because its licence does not allow it, so you load your own.
  • The Loop-seq data is not redistributed with the package.
  • Early-stage package: the public surface may change.

Every public type is documented in the package readme on NuGet. Open the NuGet page.

Data and sources

  • Dinucleotide twist and roll: Olson, Gorin, Lu, Hock and Zhurkin, PNAS 95(19):11163 (1998), Table 1, built in.
  • Local shape: the DNAshape method (Zhou et al. 2013, NAR) as distributed in DNAshapeR (Chiu et al. 2016), supplied by you at run time.
  • Held-out measurements: Basu et al. 2021, Nature 589:462 (Loop-seq).
  • Comparison model: DNAcycP (published accuracy figures).

A linear readout trained on 12,472 random-sequence constructs and tested on 82,368 yeast-gene constructs (no shared sequence, forward or reverse complement) scores r = 0.529 with vectors that use the measured twist, against 0.483 with one constant twist (difference 0.046, 95% interval 0.041 to 0.050). Adding the local-shape layer lifts it to 0.600, a further 0.071. A small phasor model that chose its own period, starting from 12 bases, settled at 10.49, 10.51, 10.48 and 10.51 bases per turn on four independent libraries, against the crystallographic 10.534. The best trained network scores higher: the 22-parameter fit trails it by 0.28 to 0.39.

Related

Licence

Proprietary. Every package ships as a compiled library. Evaluation and non-commercial development or testing are permitted; commercial, production or revenue-generating use needs a commercial licence from the owner. Read the licence terms.