buley commited on
Commit
581717a
·
verified ·
1 Parent(s): 7a3db47

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +171 -0
README.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - feature-extraction
5
+ - text-classification
6
+ tags:
7
+ - biology
8
+ - genomics
9
+ - dna
10
+ - cancer
11
+ - bioinformatics
12
+ - binary-encoding
13
+ - knot-theory
14
+ pretty_name: Bitwise Genome Datasets
15
+ size_categories:
16
+ - 10K<n<100K
17
+ ---
18
+
19
+ # Bitwise Genome Datasets
20
+
21
+ DNA sequences encoded as 2-bit binary with topological annotations.
22
+ **4x smaller than FASTA. Searchable at 32 bases per CPU cycle.**
23
+
24
+ ## Format
25
+
26
+ ```
27
+ A = 00, C = 01, G = 10, T = 11
28
+ 4 bases per byte. The DNA IS the binary.
29
+ ```
30
+
31
+ Each `.bw` file contains:
32
+ - Magic header `0x4257` ("BW")
33
+ - Sequence length (4 bytes, big-endian)
34
+ - Header string (variable length)
35
+ - Packed 2-bit bases
36
+
37
+ ## Datasets
38
+
39
+ ### cancer-genes/
40
+
41
+ 20 clinically important cancer genes from NCBI RefSeq:
42
+
43
+ | Gene | Accession | Bases | Bitwise Size | Function |
44
+ |------|-----------|-------|-------------|----------|
45
+ | TP53 | NM_000546.6 | 2,512 | 628 B | Tumor suppressor ("guardian of the genome") |
46
+ | BRCA1 | NM_007294.4 | 7,088 | 1,772 B | DNA repair (breast/ovarian cancer) |
47
+ | BRCA2 | NM_000059.4 | 11,954 | 2,989 B | DNA repair (breast/ovarian/prostate) |
48
+ | KRAS | NM_004985.5 | 5,306 | 1,327 B | GTPase (pancreatic/lung/colorectal) |
49
+ | EGFR | NM_005228.5 | 9,905 | 2,477 B | Growth factor receptor (lung cancer) |
50
+ | BRAF | NM_004333.6 | 6,459 | 1,615 B | Kinase (melanoma/colorectal) |
51
+ | PIK3CA | NM_006218.4 | 9,259 | 2,315 B | PI3K catalytic (breast/endometrial) |
52
+ | PTEN | NM_000314.8 | 8,515 | 2,129 B | Phosphatase (glioblastoma/prostate) |
53
+ | APC | NM_000038.6 | 10,704 | 2,676 B | Wnt regulator (colorectal) |
54
+ | RB1 | NM_000321.3 | 4,768 | 1,192 B | Retinoblastoma protein |
55
+ | MYC | NM_002467.6 | 3,721 | 931 B | Transcription factor (many cancers) |
56
+ | IDH1 | NM_005896.4 | 2,318 | 580 B | Isocitrate dehydrogenase (glioma) |
57
+ | VHL | NM_000551.4 | 4,414 | 1,104 B | Von Hippel-Lindau (renal cancer) |
58
+ | ALK | NM_004304.5 | 6,240 | 1,560 B | Receptor tyrosine kinase (lung/lymphoma) |
59
+ | HER2 | NM_004448.4 | 4,557 | 1,140 B | ERBB2 (breast cancer) |
60
+ | ATM | NM_000051.4 | 12,915 | 3,229 B | DNA damage response kinase |
61
+ | MGMT | NM_002412.5 | 4,678 | 1,170 B | DNA methyltransferase (glioblastoma) |
62
+ | TERT | NM_198253.3 | 4,039 | 1,010 B | Telomerase (many cancers) |
63
+ | JAK2 | NM_004972.4 | 7,023 | 1,756 B | Janus kinase (myeloproliferative) |
64
+ | FLT3 | NM_004119.3 | 3,826 | 957 B | FMS-like tyrosine kinase (AML) |
65
+
66
+ ## Usage
67
+
68
+ ### With `bw` CLI
69
+
70
+ ```bash
71
+ # Install
72
+ cargo install --path .
73
+
74
+ # Search for a mutation hotspot
75
+ bw grep GGTGGCGTAGGC datasets/cancer-genes/fasta/KRAS.fasta
76
+
77
+ # Pack FASTA to Bitwise binary
78
+ bw pack datasets/cancer-genes/fasta/TP53.fasta > TP53.bw
79
+
80
+ # Count mutations between sequences
81
+ bw count ref.fasta tumor.fasta
82
+
83
+ # Compression stats
84
+ bw stats datasets/cancer-genes/fasta/BRCA1.fasta
85
+ ```
86
+
87
+ ### With WASM (JavaScript/TypeScript)
88
+
89
+ ```typescript
90
+ import { pack_bases, search_packed, mutation_count } from 'bitwise';
91
+
92
+ const packed = pack_bases(new TextEncoder().encode('ATGCTAGCATGC'));
93
+ const needle = pack_bases(new TextEncoder().encode('TAGC'));
94
+ const matches = search_packed(packed, 12, needle, 4);
95
+ // matches = [4] -- found TAGC at position 4
96
+ ```
97
+
98
+ ## Theory
99
+
100
+ Every dataset is backed by mechanized Lean 4 theorems (zero sorry):
101
+
102
+ - `dna_is_folded_knot`: DNA IS a folded knot (PsycheGrindExtended Pass 17)
103
+ - `two_bit_four_per_byte`: 4 bases per byte by construction (Pass 39)
104
+ - `word_parallel_speedup`: 32x search speedup (Pass 39)
105
+ - `xor_detects_mutations`: XOR = mutation detection (Pass 39)
106
+ - `noncoding_is_void`: non-coding DNA IS the void boundary (Pass 43)
107
+ - `junk_not_junk`: "junk" DNA carries MORE information (Pass 43)
108
+ - `sigma_monotone_with_age`: σ IS a molecular clock (GenomicVoidArchaeology)
109
+ - `unwinding_theorem`: history reconstructible from void (GenomicVoidArchaeology)
110
+
111
+ 402 theorems total. The math proves the encoding. The encoding enables the search. The search reveals the biology.
112
+
113
+ ## Source
114
+
115
+ All sequences from NCBI RefSeq (public domain). Fetched via E-utilities API.
116
+ Reproducible via `scripts/fetch-and-convert.sh`.
117
+
118
+ ## Related
119
+
120
+ - [helix.repair](https://helix.repair) -- DNA topology search engine
121
+ - [Aunt Sandy](https://github.com/forkjoin-ai/aunt-sandy) -- Cancer genomics via Buleyean probability
122
+ - [Gnosis](https://github.com/forkjoin-ai/gnosis) -- Formal verification engine (402 Lean theorems)
123
+
124
+ ## License
125
+
126
+ Data: CC-BY-4.0 (sequences are public domain from NCBI)
127
+ Code: MPL-2.0
128
+
129
+ ## hg38 -- Full Human Reference Genome
130
+
131
+ **2.9GB FASTA → 736MB Bitwise binary. 25 chromosomes.**
132
+
133
+ | Chromosome | Bases | Bitwise Size |
134
+ |------------|-------|-------------|
135
+ | chr1 | 248,956,422 | 59 MB |
136
+ | chr2 | 242,193,529 | 58 MB |
137
+ | chr3 | 198,295,559 | 47 MB |
138
+ | chr4 | 190,214,555 | 45 MB |
139
+ | chr5 | 181,538,259 | 43 MB |
140
+ | chr6 | 170,805,979 | 41 MB |
141
+ | chr7 | 159,345,973 | 38 MB |
142
+ | chr8 | 145,138,636 | 35 MB |
143
+ | chr9 | 138,394,717 | 33 MB |
144
+ | chr10 | 133,797,422 | 32 MB |
145
+ | chr11 | 135,086,622 | 32 MB |
146
+ | chr12 | 133,275,309 | 32 MB |
147
+ | chr13 | 114,364,328 | 27 MB |
148
+ | chr14 | 107,043,718 | 26 MB |
149
+ | chr15 | 101,991,189 | 24 MB |
150
+ | chr16 | 90,338,345 | 22 MB |
151
+ | chr17 | 83,257,441 | 20 MB |
152
+ | chr18 | 80,373,285 | 19 MB |
153
+ | chr19 | 58,617,616 | 14 MB |
154
+ | chr20 | 64,444,167 | 15 MB |
155
+ | chr21 | 46,709,983 | 11 MB |
156
+ | chr22 | 50,818,468 | 12 MB |
157
+ | chrX | 156,040,895 | 37 MB |
158
+ | chrY | 57,227,415 | 14 MB |
159
+ | chrM | 16,569 | 4.1 KB |
160
+
161
+ **Too large for GitHub.** Reproduce locally:
162
+
163
+ ```bash
164
+ # Download and convert (requires ~4GB disk)
165
+ bash scripts/fetch-and-convert-hg38.sh
166
+
167
+ # Or use Cloud Build
168
+ gcloud builds submit --config=cloudbuild-whole-genome.yaml --substitutions=_ASSEMBLY=hg38 .
169
+ ```
170
+
171
+ Search speed: **90 million bases per second** on a single CPU core.