EnigmaDataset / README.md
shivendrra's picture
Update README.md
0486af5 verified
---
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.