File size: 2,739 Bytes
bb4cbe0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: other
pretty_name: NCBI RefSeq Protein
size_categories:
  - 100M<n<1B
task_categories:
  - other
language:
  - en
tags:
  - biology
  - proteins
  - sequences
  - fasta
  - refseq
  - ncbi
---

# NCBI RefSeq Protein

Normalized FASTA shards of the NCBI Reference Sequence (RefSeq) protein release.

Processed and uploaded by the [MegaData](https://github.com/) post-download pipeline
(internal repo). Original source: <https://www.ncbi.nlm.nih.gov/refseq/>.

## Statistics

| | |
|---|---|
| Source files | 1,725 |
| Shards | 1,725 |
| Compressed shard bytes | 72.74 GiB (78,108,688,857) |
| Records (per-source manifest sum) | 459,415,871 |
| Residues (per-source manifest sum) | 179,203,453,293 |
| Aggregate manifest `total_records` | 459415871 |

## Layout

```
.
├── _MANIFEST.json                      # aggregate manifest written by the pipeline
├── manifests/<source_slug>.json        # per-source manifest (records, residues, shards)
├── metadata/<source_slug>.records.jsonl  # per-record provenance
└── sequences/<source_slug>/shard-NNNNNN.fasta.zst
```

`<source_slug>` corresponds 1:1 with an upstream source archive; e.g.
`sequence_uniprotkb_uniprot_sprot.fasta.gz`.

## Loading

Stream every shard of one source (replace `<source_slug>` with the directory of
interest under `sequences/`):

```bash
hf download LiteFold/NCBI --repo-type dataset \
  --include 'sequences/<source_slug>/shard-*.fasta.zst' \
  --local-dir ./ncbi_refseq_protein
zstd -dc ./ncbi_refseq_protein/sequences/<source_slug>/shard-*.fasta.zst | head
```

Programmatic streaming with [`zstandard`](https://pypi.org/project/zstandard/):

```python
from huggingface_hub import snapshot_download
from pathlib import Path
import zstandard as zstd

local = snapshot_download(
    repo_id="LiteFold/NCBI",
    repo_type="dataset",
    allow_patterns=["sequences/*/shard-*.fasta.zst"],
)

dctx = zstd.ZstdDecompressor()
for shard in sorted(Path(local).rglob("shard-*.fasta.zst")):
    with shard.open("rb") as f, dctx.stream_reader(f) as reader:
        buf = b""
        while chunk := reader.read(1 << 20):
            buf += chunk
            *lines, buf = buf.split(b"\n")
            for line in lines:
                ...  # naive splitter; swap in your FASTA parser
```

## License

Public Domain (US Government work, NCBI RefSeq policy).

## Citation

> O'Leary NA, et al. Reference sequence (RefSeq) database at NCBI: current status, taxonomic expansion, and functional annotation. Nucleic Acids Research, 44(D1):D733-45, 2016.

## Provenance

Built from the local manifest entry `ncbi_refseq_protein` of `manifests/atlas_download_plan.json`.
Pipeline source: `megadata-post normalize --dataset ncbi_refseq_protein`.