File size: 3,440 Bytes
ebf0084
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d7c698
 
ebf0084
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
license: mit
tags:
  - genomics
  - microbiology
  - horizontal-gene-transfer
  - crispr
  - causal-inference
pretty_name: LEDGER
size_categories:
  - 1M<n<10M
---

# LEDGER data

Processed data for LEDGER, a latent-variable model that separates *exposure* from *establishment*
when estimating which mobile genetic elements a bacterial genome will accept. Code lives at [bryanc5864/LEDGER](https://github.com/bryanc5864/LEDGER).

The core problem: when an element is missing from a genome, the host either never met it or met it
and rejected it. Regressing observed presence on host features estimates the product of those two
things, and exposure tracks the same phylogeny as the defense repertoire, so susceptibility is never
separately identified. LEDGER uses CRISPR spacers as a record of encounter that survives regardless
of the outcome.

## Contents

```
simulation/     5,551 per-fit records from every simulation sweep (JSONL, one object per fit)
genomes/
  annotations/  DefenseFinder 3.0.0 systems tables for 1,200 P. aeruginosa genomes
  matrices/     host x defense-system presence matrices, split chromosomal/extrachromosomal
  crispr/       27,620 CRISPR spacers (MinCED), pooled and per genome
  elements/     Y and S matrices: 1,200 hosts x 2,589 spacer-derived elements
  clusters/     ANI lineage clusters at three thresholds
  metadata/     NCBI assembly metadata and the stratified cohort definition
results/        exclusion-restriction audit, CRISPR proximity test, real-data fit output
figures/        every figure in the paper, PNG and PDF
main.pdf        the paper
```

## The two matrices

`genomes/elements/Y.tsv.gz` and `S.tsv.gz` are the observables the model consumes. Rows are the
1,200 genomes, columns the 2,589 elements. `S[i,j] = 1` means host *i* carries a CRISPR spacer
targeting element *j*, so it demonstrably encountered it. `Y[i,j] = 1` means the element (strictly,
a >= 95% identity match to the protospacer, outside any CRISPR array) is resident in that genome.

Three things about this data are worth knowing before using it:

- The informative cell, encounter without establishment, holds 25,099 pairs.
- Self-targeting pairs (spacer present *and* element resident) are depleted 0.54x relative to
  independence, which is what the model predicts, since a spacer against a resident element is
  self-targeting and gets purged.
- The false-match rate is zero: 2,589 dinucleotide-shuffled decoy sequences produced no hits at all
  against the same 1,200 genomes under identical search settings.

CRISPR arrays were masked out of the genomes before searching. Without that step every spacer
matches its own array, `Y` becomes identical to `S`, and the informative cell is empty.

## Simulation records

`simulation/*.jsonl` is one JSON object per model fit: the full configuration, every metric, the
realised marginal rates and the convergence status. Nothing is aggregated. Three audit scripts in
the code repository recompute all 181 published numbers from these records.

Superseded runs are kept rather than deleted and are named accordingly, including a permutation
control that turned out not to be a null and a threat sweep whose arms were confounded by a shared
random stream.

## Raw genomes

Not mirrored here. They are public NCBI assemblies; `make genomes` in the code repository
re-downloads them (about 18 GB) and reproduces everything above.

## License

MIT, Bryan Cheng, 2026.