loubnabnl HF Staff commited on
Commit
6e7eb15
Β·
verified Β·
1 Parent(s): 9f2f426

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +127 -84
README.md CHANGED
@@ -6,10 +6,10 @@ tags:
6
  - biology
7
  - genomics
8
  - dna
9
- - pretraining
10
- - carbon
11
- - parquet
12
- pretty_name: Carbon pretraining corpus
13
  configs:
14
  - config_name: eukaryote_generator
15
  data_files:
@@ -29,121 +29,164 @@ configs:
29
  path: prokaryote_evo2/*.parquet
30
  ---
31
 
32
- # Carbon pretraining corpus
33
 
34
- Private aggregation of the DNA-side sources used for Carbon pretraining, mirrored
35
- into one Hub dataset with four loadable configs. The goal is to make the
36
- pretraining mixture reproducible without re-stitching data from multiple upstream
37
- repositories.
38
 
39
- All files are stored as Parquet. OpenGenome2 JSONL sources were converted to
40
- Parquet and their `metadata.file_path` values were scrubbed so the metadata keeps
41
- only useful upstream provenance such as `{"source": "data_mrna_train_chunk1.jsonl.gz"}`
42
- and, where present, the upstream `record` id.
43
 
44
- ## Subsets
 
 
 
 
 
45
 
46
- | Config | Upstream source | Files | Size | Rows / sequence stats |
47
- |---|---:|---:|---:|---|
48
- | `eukaryote_generator` | [GenerTeam/pretrain_data_eukaryote](https://huggingface.co/datasets/GenerTeam/pretrain_data_eukaryote) | 456 | 376.80 GB | Rich schema with `sequence`, `taxonomy`, `species_type`, `gene_type`, coordinates, and boundary markers. A sampled fungi shard has 187,500 rows with mean sequence length ~1,631 nt. |
49
- | `mrna_evo2` | [OpenGenome2 mRNA](https://huggingface.co/datasets/arcinstitute/opengenome2/tree/main/json/pretraining_or_both_phases/mrna) | 11 | 54.78 GB | 52,702,454 rows; 115.94 Gbp total; mean 2,200 nt; min 64; max 99,994. |
50
- | `mrna_splice_evo2` | [OpenGenome2 mRNA splice/promoter](https://huggingface.co/datasets/arcinstitute/opengenome2/tree/main/json/pretraining_or_both_phases/mrna_splice_promoter) | 19 | 92.89 GB | 56,877,762 rows; 197.36 Gbp total; mean 3,470 nt; min 96; max 122,533. |
51
- | `prokaryote_evo2` | [OpenGenome2 GTDB v220 + IMG/PR](https://huggingface.co/datasets/arcinstitute/opengenome2/tree/main/json/pretraining_or_both_phases/gtdb_v220_imgpr) | 34 | 165.98 GB | 17,408,059 rows; 357.45 Gbp total; mean 20,533 nt; min 20; max 16,040,666. |
52
 
53
- Test splits from opengenome2 are not included (this is a pretraining corpus).
54
 
55
- ## Schema
56
 
57
- `eukaryote_generator` preserves the GenerTeam Parquet schema:
58
 
59
- ```text
60
- begin_of_sequence, end_of_sequence, begin_of_gene, end_of_gene, gene_type,
61
- species_type, strand, sequence, molecule_type, topology, taxonomy, record_id,
62
- start, end
63
- ```
64
 
65
- The three OpenGenome2-derived configs have:
 
 
 
 
66
 
67
- ```text
68
- text, metadata
69
- ```
70
 
71
- After scrubbing, `metadata` no longer contains local `/scratch/...` paths. It
72
- contains a compact upstream source filename, and for prokaryote rows may also
73
- include `record`.
74
 
75
- ## Usage
76
 
77
  ```python
78
  from datasets import load_dataset
79
 
80
  ds = load_dataset(
81
  "hf-carbon/carbon-pretraining-corpus",
82
- "mrna_evo2",
83
  split="train",
84
  streaming=True,
85
  )
86
- print(next(iter(ds)))
 
 
87
  ```
88
 
89
- To stream the four configs together:
90
 
91
- ```python
92
- from datasets import interleave_datasets, load_dataset
93
-
94
- configs = [
95
- "eukaryote_generator",
96
- "prokaryote_evo2",
97
- "mrna_splice_evo2",
98
- "mrna_evo2",
99
- ]
100
- streams = [
101
- load_dataset("hf-carbon/carbon-pretraining-corpus", cfg, split="train", streaming=True)
102
- for cfg in configs
103
- ]
104
- mixed = interleave_datasets(streams, seed=42)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  ```
106
 
107
- Pass `probabilities=` to `interleave_datasets` if you want to reproduce a
108
- specific training mixture.
109
 
110
- ## Provenance
111
 
112
- This mirror is derived from:
113
 
114
- - [GenerTeam/pretrain_data_eukaryote](https://huggingface.co/datasets/GenerTeam/pretrain_data_eukaryote), MIT license.
115
- - [arcinstitute/opengenome2](https://huggingface.co/datasets/arcinstitute/opengenome2), Apache-2.0 license.
 
 
 
116
 
117
- The OpenGenome2 configs include train chunks only:
118
 
119
- - `json/pretraining_or_both_phases/mrna/*_train_*.jsonl.gz`
120
- - `json/pretraining_or_both_phases/mrna_splice_promoter/*_train_*.jsonl.gz`
121
- - `json/pretraining_or_both_phases/gtdb_v220_imgpr/*_train_*.jsonl.gz`
122
 
123
- ## Limitations
124
 
125
- - This is a private pretraining mirror, not a benchmark dataset.
126
- - OpenGenome2 test chunks are intentionally omitted.
127
- - No additional deduplication or quality filtering was applied beyond upstream processing.
128
- - The configs are schema-asymmetric: `eukaryote_generator` has a rich structured schema, while OpenGenome2-derived configs are `text` plus `metadata`.
129
- - Sequence casing, ambiguity codes, and length distributions differ by upstream source.
130
 
131
- ## Citation
132
 
133
- If you use this mirror, cite the upstream datasets:
134
 
135
- ```bibtex
136
- @misc{generteam2025generator,
137
- title = {GENERATOR: A Long-Context Generative Genomic Foundation Model},
138
- author = {GenerTeam},
139
- year = {2025},
140
- eprint = {2502.07272},
141
- archivePrefix= {arXiv},
142
- }
143
 
144
- @misc{arcinstitute_opengenome2,
145
- title = {OpenGenome2},
146
- author = {Arc Institute},
147
- howpublished = {Hugging Face dataset: arcinstitute/opengenome2},
148
- }
 
 
149
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  - biology
7
  - genomics
8
  - dna
9
+ pretty_name: Carbon Pretraining Corpus
10
+ size_categories:
11
+ - 1T<n<10T
12
+ language: []
13
  configs:
14
  - config_name: eukaryote_generator
15
  data_files:
 
29
  path: prokaryote_evo2/*.parquet
30
  ---
31
 
32
+ # 🧬 Carbon Pretraining Corpus
33
 
34
+ > **~127M DNA & RNA sequences Β· 1 trillion nucleotides** β€” the DNA pretraining mixture used to train [Carbon](https://github.com/hf-carbon/carbon), a genomic foundation model.
 
 
 
35
 
36
+ This dataset is a collection of data sources intended for training genomic foundation models, such as Carbon. It contains DNA and RNA sequences spanning eukaryote and prokaryote species, spanning fungi, plants, animals, bacteria...
37
+ And has almost 1T DNA base pairs (160B tokens with Carbon's 6-mer tokenizer).
 
 
38
 
39
+ | Subset | Domain | Source | Size | Rows | Nucleotides |
40
+ |---|---|---|---:|---:|---:|
41
+ | `eukaryote_generator` | Eukaryote genomes | GenerTeam / GENERATOR | 376.8 GB | 48.02 M | ~420 Gbp |
42
+ | `mrna_evo2` | Messenger RNA | Arc Institute / OpenGenome2 | 54.8 GB | 52,702,454 | ~115.9 Gbp |
43
+ | `mrna_splice_evo2` | mRNA + splice & promoter | Arc Institute / OpenGenome2 | 92.9 GB | 56,877,762 | ~197.4 Gbp |
44
+ | `prokaryote_evo2` | Prokaryote genomes (GTDB + IMG/PR) | Arc Institute / OpenGenome2 | 166.0 GB | 17,408,059 | ~357.5 Gbp |
45
 
46
+ > ℹ️ Nucleotides are counted in **base pairs (Gbp = billion nucleotides)**. The prokaryote subset has the longest individual sequences (mean ~20 K nt; max ~16 M nt) because it contains whole chromosomal chunks.
 
 
 
 
 
47
 
 
48
 
49
+ ## What is this?
50
 
51
+ **Quick biology primer**
52
 
53
+ DNA is the molecule that stores genetic information in all living things. It is a sequence of four letters β€” **A, T, G, C** β€” and a genome can be anywhere from thousands to billions of these letters long. Training a language model on DNA means treating those letters like tokens and learning the statistical patterns of life.
 
 
 
 
54
 
55
+ This corpus covers three major layers of biological complexity:
56
+
57
+ - **Eukaryotes** β€” organisms with a nucleus (animals, plants, fungi, protists). Complex, large genomes with introns, regulatory regions, and lots of repetition.
58
+ - **Prokaryotes** β€” bacteria and archaea. Simpler, denser genomes; genes are packed tightly with less non-coding "junk."
59
+ - **mRNA** β€” the processed, spliced transcript of a gene. This is what actually gets translated into protein. Much shorter than full genomic sequences. Including mRNA teaches the model about gene structure without the noise of intergenic regions.
60
 
 
 
 
61
 
62
+ ## Loading the data
 
 
63
 
 
64
 
65
  ```python
66
  from datasets import load_dataset
67
 
68
  ds = load_dataset(
69
  "hf-carbon/carbon-pretraining-corpus",
70
+ "mrna_evo2", # or: eukaryote_generator | mrna_splice_evo2 | prokaryote_evo2
71
  split="train",
72
  streaming=True,
73
  )
74
+
75
+ for example in ds.take(3):
76
+ print(example)
77
  ```
78
 
 
79
 
80
+ ## Subset Details
81
+
82
+ ### 1. `eukaryote_generator` β€” Eukaryote Genomes
83
+
84
+ **Source:** [GenerTeam/pretrain_data_eukaryote](https://huggingface.co/datasets/GenerTeam/pretrain_data_eukaryote) Β· MIT License
85
+
86
+ **What it contains:** Genomic sequences from eukaryotic organisms (fungi, plants, animals, and more), packaged by the GenerTeam as part of their [GENERATOR](https://arxiv.org/abs/2502.07272) genomic foundation model. This is the main part is Carbon training data, which is focused on Eukaryote species. Each row carries full taxonomic metadata, gene type, strand orientation, and chromosome coordinates alongside the raw sequence.
87
+ We filter out sequences longer than 100 kbp, as excluding them improves training performance on DNA donwstream benchmarks. For long-context training, you can concatenate genes from the same contig to build longer samples.
88
+
89
+ **Schema:**
90
+
91
+ ```
92
+ begin_of_sequence bool β€” special boundary marker
93
+ end_of_sequence bool β€” special boundary marker
94
+ begin_of_gene bool β€” marks gene start
95
+ end_of_gene bool β€” marks gene end
96
+ gene_type str β€” e.g. "protein_coding", "ncRNA", "pseudogene"
97
+ species_type str β€” e.g. "fungi", "plant", "vertebrate"
98
+ strand str β€” "+" or "-" (which DNA strand)
99
+ sequence str β€” the raw nucleotide string (A/T/G/C/N...)
100
+ molecule_type str β€” e.g. "genomic DNA"
101
+ topology str β€” "linear" or "circular"
102
+ taxonomy str β€” full NCBI taxonomy lineage
103
+ record_id str β€” upstream GenBank/RefSeq accession
104
+ start int β€” coordinate start on chromosome
105
+ end int β€” coordinate end on chromosome
106
+ ```
107
+
108
+ **Example row (sequence truncated):**
109
+ ```json
110
+ {
111
+ "species_type": "fungi",
112
+ "gene_type": "protein_coding",
113
+ "strand": "+",
114
+ "sequence": "ATGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC...",
115
+ "taxonomy": "Eukaryota; Fungi; Ascomycota; ...",
116
+ "record_id": "NC_001224.1",
117
+ "start": 1872,
118
+ "end": 3503
119
+ }
120
  ```
121
 
122
+ ### 2. `mrna_evo2` β€” Messenger RNA Sequences
 
123
 
124
+ **Source:** [arcinstitute/opengenome2](https://huggingface.co/datasets/arcinstitute/opengenome2) Β· Apache-2.0 License Β· `mrna` split
125
 
126
+ **What it contains:** Processed mRNA sequences β€” the "final edited" version of a gene after the cell has removed introns (non-coding interruptions) and kept only the exons. This is the sequence that gets read to produce protein. These sequences are shorter and more information-dense than raw genomic DNA.
127
 
128
+ **Schema:**
129
+ ```
130
+ text str β€” the raw nucleotide sequence
131
+ metadata dict β€” {"source": "data_mrna_train_chunk1.jsonl.gz", "record": "..."}
132
+ ```
133
 
134
+ **Stats:** 52.7 M rows Β· mean 2,200 nt Β· min 64 nt Β· max ~100 K nt Β· 115.9 Gbp total
135
 
 
 
 
136
 
137
+ ### 3. `mrna_splice_evo2` β€” Augmented mRNA Transcripts
138
 
139
+ **Source:** [arcinstitute/opengenome2](https://huggingface.co/datasets/arcinstitute/opengenome2) Β· Apache-2.0 Β· `mrna_splice_promoter` split
 
 
 
 
140
 
141
+ **What it contains:** The same mRNA transcripts as `mrna_evo2`, with augmentations applied by the Evo2 team: each transcript gets an extra 1,024 bp of upstream promoter sequence prepended, and an extra 32 bp of flanking sequence around each exon boundary to expose splice sites. The resulting exon chunks are concatenated with a special `@` separator into a single stitched sequence per transcript.
142
 
143
+ Sequences here are systematically longer than `mrna_evo2` β€” the extra promoter and splice flanks are the only difference, not a different set of genes.
144
 
145
+ **Stats:** 56.9 M rows Β· mean 3,470 nt Β· min 96 nt Β· max ~122 K nt Β· 197.4 Gbp total
 
 
 
 
 
 
 
146
 
147
+ ### 4. `prokaryote_evo2` β€” Prokaryote Genomes (Bacteria & Archaea)
148
+
149
+ **Upstream:** [arcinstitute/opengenome2](https://huggingface.co/datasets/arcinstitute/opengenome2) Β· Apache-2.0 License Β· `gtdb_v220_imgpr` split
150
+
151
+ **What it contains:** Long chromosomal chunks from bacteria and archaea, sourced from [GTDB v220](https://gtdb.ecogenomic.org/) (a curated taxonomy of ~85 K prokaryote genomes) and [IMG/PR](https://img.jgi.doe.gov/) (a DOE database of environmental prokaryote sequences). Prokaryote genomes are compact β€” genes sit back-to-back with minimal intergenic space β€” so these sequences are biologically rich per nucleotide.
152
+
153
+ **Schema:** identical to the mRNA subsets
154
  ```
155
+ text str β€” nucleotide sequence (can be megabases long)
156
+ metadata dict β€” {"source": "gtdb_..._train_chunk1.jsonl.gz", "record": "GCF_..."}
157
+ ```
158
+
159
+ **Stats:** 17.4 M rows Β· mean 20,533 nt Β· min 20 nt Β· **max ~16 M nt** Β· 357.5 Gbp total
160
+
161
+
162
+ ## βš—οΈ Carbon Training Mixture
163
+
164
+ The proportions below reflect the target mixture for Carbon's pure-DNA pretraining runs (1 T token target):
165
+
166
+ | Subset | Approx. weight |
167
+ |---|---:|
168
+ | `prokaryote_evo2` | ~70% |
169
+ | `mrna_splice_evo2` | ~15% |
170
+ | `mrna_evo2` | ~10% |
171
+ | `eukaryote_generator` | ~5% |
172
+
173
+
174
+ ### Metadata conditioning in Carnon training (`eukaryote_generator` only)
175
+
176
+ In Carbon we added optional metadata tags to a fraction of eukaryote sequences, so the model learns to use biological context when available but doesn't depend on it. Tags are prepended before the sequence with random dropout at tokenization time:
177
+
178
+ ```text
179
+ # 50% of sequences β€” no tags
180
+ <dna>ATGCTAGCTA...</dna>
181
+
182
+ # 16.7% β€” species + gene type
183
+ <species>fungi<gene_type>protein_coding<dna>ATGCTAGCTA...</dna>
184
+
185
+ # 16.7% β€” species only
186
+ <species>fungi<dna>ATGCTAGCTA...</dna>
187
+
188
+ # 16.7% β€” gene type only
189
+ <gene_type>protein_coding<dna>ATGCTAGCTA...</dna>
190
+ ```
191
+
192
+ At inference time you can prompt with any combination of tags or none at all. The three OpenGenome2 subsets are tokenized as plain `<dna>SEQUENCE</dna>` without metadata conditioning.