File size: 3,365 Bytes
0486af5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
license: mit
tags:
- biology
- protien-sequences
- dna-database
- raw-fasta
- dna
size_categories:
- 10M<n<100M
---

## DNA Sequence Database from NCBI

Welcome to the curated DNA sequence dataset, automatically gathered from NCBI using the Enigma2 pipeline. This repository provides ready-to-use CSV and Parquet files for downstream machine-learning and bioinformatics tasks.

## 📋 Dataset Overview

* **Scope**

  * A collection of topic-specific DNA sequence sets (e.g., BRCA1, TP53, CFTR) sourced directly from NCBI’s Nucleotide database.
* **Curation Process**

  1. **Query Design**

     * Predefined Entrez queries (gene names, organism filters) identify relevant GenBank records.
  2. **Batch Retrieval**

     * Sequences fetched in controlled batches to respect rate limits and ensure reliability.
  3. **Quality Control & Filtering**

     * Records shorter than 100 bp or exhibiting parsing errors were omitted.
  4. **Metadata Extraction**

     * For each sequence, we record:

       * **ID** (accession number)
       * **Name** (full FASTA description)
       * **Length** (base-pair count)
  5. **Export**

     * Data saved in both CSV and Parquet formats for seamless integration with Python, R, and big-data frameworks.

## 📂 Dataset Structure

Each topic is stored in its own file under the `datasets/` directory:

```
datasets/
├── BRCA1_Gene_AND_Homo_sapiens_Organism.csv
├── BRCA1_Gene_AND_Homo_sapiens_Organism.parquet
├── TP53_Gene_AND_Homo_sapiens_Organism.csv
├── TP53_Gene_AND_Homo_sapiens_Organism.parquet

```

**File contents** (4 columns):

| Column     | Description                                    |
| ---------- | ---------------------------------------------- |
| `id`       | NCBI accession ID                              |
| `name`     | Full FASTA-style description                   |
| `length`   | Original sequence length (in base pairs)       |
| `sequence` | Raw DNA string (A/C/G/T; no alignment padding) |

## 🚀 How to Use

```python
from enigma2 import Database, EntrezQueries, convert_fasta

queries = EntrezQueries()  # contains about 20 queries
db = Database(topics=queries(), out_dir="./data/", mode='csv', email="your@mail.com", retmax=500, max_rate=10, raw=True)
db.build_raw()

# inspect first record
print(ds[0])
# → {'id': 'NM_007294.3', 'name': 'Homo sapiens BRCA1 transcript …', 'length': 1863, 'sequence': 'ATGGATT…'}
```

Or, in a Unix shell:

```bash
pip install datasets
datasets-cli download -d shivendrra/dna-ncbi -s BRCA1_Gene_AND_Homo_sapiens_Organism.csv
```

## 🔍 Recommended Workflows

* **Feature Engineering**: k-mer counting, GC content analysis
* **Sequence Modeling**: RNNs, Transformers on raw DNA
* **Phylogenetic Studies**: distance matrices from sequence distances

## 🔗 Source Code

The full data-gathering and processing pipeline is open-source:
[Enigma2](https://github.com/shivendrra/enigma2)


## 📖 Citation

If you use this dataset in your work, please cite:

```
@misc{shivendrra_enigma2_2025,
  author = {Shivendrra, Harsh and contributors},
  title = {Enigma2 NCBI DNA Dataset},
  year = {2025},
  howpublished = {\\url{https://huggingface.co/datasets/shivendrra/EnigmaDataset}}
}
```

## 📝 License

This dataset is released under the [MIT License](LICENSE).
Feel free to reuse and adapt—with attribution.