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.HoloGenomeCommercial 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.
Data behind the diagram
| Vectors built with | Correlation r | 95% interval |
|---|---|---|
| Measured twist plus shape | 0.600 | 0.591 to 0.609 |
| Measured twist | 0.529 | 0.520 to 0.539 |
| One constant twist | 0.483 | 0.473 to 0.494 |
| Dinucleotide-shuffled sequence | 0.260 | 0.249 to 0.272 |
| Counts of 1-, 2- and 3-base words | 0.253 | 0.239 to 0.267 |
| Contrast | Difference in r | 95% interval |
|---|---|---|
| Measured twist over constant twist | 0.046 | 0.041 to 0.050 |
| Shape layer over measured twist | 0.071 | 0.063 to 0.078 |
| Library | DNAcycP, trained network | 22-parameter fit | Zero-parameter score |
|---|---|---|---|
| Random sequence | 0.93 | 0.54 | 0.31 |
| Chromosome V tiling | 0.77 | 0.50 | 0.36 |
| Nucleosome | 0.89 | 0.60 | 0.46 |
| Library | Found from real data | Order scrambled | Labels scrambled |
|---|---|---|---|
| Yeast tiling | 10.49 | 12.03 | 12.05 |
| Random sequence | 10.51 | 12.01 | 12.01 |
| Chromosome V tiling | 10.48 | 12.03 | 12.04 |
| Nucleosome | 10.51 | 11.96 | 12.03 |
| Started at (bases per turn) | Settled at (bases per turn) |
|---|---|
| 6 | 6.01 |
| 9 | 10.49 |
| 12 | 10.49 |
| 18 | 18.01 |
| 24 | 24.48 |
| Library | Helical period | 7 bases | 15 bases |
|---|---|---|---|
| Random sequence | 0.307 | -0.013 | -0.022 |
| Yeast tiling | 0.430 | -0.065 | -0.090 |
| Chromosome V tiling | 0.364 | -0.060 | -0.065 |
| Nucleosome | 0.465 | -0.037 | -0.053 |
| 50-base library | 0.221 | -0.058 | -0.054 |
| Vectors built with | Random sequence | Chromosome V tiling | Nucleosome |
|---|---|---|---|
| Measured twist plus shape | 0.544 | 0.524 | 0.620 |
| Measured twist | 0.570 | 0.483 | 0.578 |
| One constant twist | 0.529 | 0.462 | 0.558 |
| Base | Letter | Measured twist | Constant 34.3 degrees |
|---|---|---|---|
| 1 | A | 0.000 | 0.000 |
| 2 | T | 0.081 | 0.095 |
| 3 | G | 0.185 | 0.191 |
| 4 | C | 0.278 | 0.286 |
| 5 | G | 0.379 | 0.381 |
| 6 | T | 0.466 | 0.476 |
| 7 | A | 0.571 | 0.572 |
| 8 | C | 0.659 | 0.667 |
| 9 | G | 0.759 | 0.762 |
| 10 | T | 0.846 | 0.858 |
| 11 | T | 0.944 | 0.953 |
| 12 | A | 1.049 | 1.048 |
| 13 | G | 1.137 | 1.143 |
| 14 | C | 1.231 | 1.239 |
| 15 | A | 1.334 | 1.334 |
| 16 | A | 1.432 | 1.429 |
| 17 | A | 1.529 | 1.524 |
| 18 | A | 1.627 | 1.620 |
| 19 | A | 1.724 | 1.715 |
| 20 | T | 1.806 | 1.810 |
| 21 | T | 1.903 | 1.906 |
| 22 | T | 2.001 | 2.001 |
| 23 | T | 2.098 | 2.096 |
| 24 | T | 2.196 | 2.191 |
| 25 | G | 2.299 | 2.287 |
| 26 | C | 2.393 | 2.382 |
| 27 | G | 2.493 | 2.477 |
| 28 | C | 2.586 | 2.572 |
| 29 | G | 2.687 | 2.668 |
| 30 | A | 2.788 | 2.763 |
| 31 | T | 2.869 | 2.858 |
| 32 | C | 2.970 | 2.954 |
| 33 | G | 3.070 | 3.049 |
| 34 | A | 3.171 | 3.144 |
| 35 | T | 3.252 | 3.239 |
| 36 | C | 3.353 | 3.335 |
| 37 | G | 3.453 | 3.430 |
| 38 | T | 3.541 | 3.525 |
| 39 | A | 3.646 | 3.621 |
| 40 | G | 3.734 | 3.716 |
| 41 | C | 3.828 | 3.811 |
| 42 | T | 3.916 | 3.906 |
| 43 | A | 4.021 | 4.002 |
| 44 | G | 4.110 | 4.097 |
| 45 | C | 4.203 | 4.192 |
| 46 | T | 4.292 | 4.287 |
| 47 | A | 4.397 | 4.383 |
| 48 | G | 4.486 | 4.478 |
| 49 | C | 4.579 | 4.573 |
| 50 | A | 4.683 | 4.669 |
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.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);512 reals; helix turns: 4.68
10.5340 bases per turn
TrueThis 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).
Evidence
Method and every numberA 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.