--- pretty_name: Pfam Current Release license: cc0-1.0 tags: - biology - protein - protein-family - protein-domain - domain-annotation - pfam - jsonl configs: - config_name: clans data_files: - split: train path: tables/annotation_pfam_current_release_Pfam-A.clans.tsv.gz.jsonl - config_name: regions data_files: - split: train path: tables/annotation_pfam_current_release_Pfam-A.regions.tsv.gz.jsonl.parts/part-*.jsonl --- # Pfam Pfam is a widely used protein family and domain annotation resource built from curated multiple sequence alignments and profile hidden Markov models. This Hugging Face dataset mirrors tabular exports from the Pfam current release in a normalized JSONL format with row-level provenance. It is intended for large-scale domain annotation lookup, protein family analysis, model training over Pfam-A region assignments, and integration with protein sequence or structure datasets. This mirror contains two Pfam-A tables: a small clan mapping table and a very large regions table. The clan table maps Pfam-A families to clans and family names, while the regions table records where Pfam-A domains occur on protein sequences. Each JSONL record preserves the upstream row under `row` and adds provenance fields so downstream users can trace the source file and row index. ## Splits - `clans/train`: 27,480 rows - `regions/train`: 128,192,943 rows Total rows: 128,220,423. The large regions table is split into two JSONL parts: - `tables/annotation_pfam_current_release_Pfam-A.regions.tsv.gz.jsonl.parts/part-00000.jsonl` - `tables/annotation_pfam_current_release_Pfam-A.regions.tsv.gz.jsonl.parts/part-00001.jsonl` ## Columns Every row is a JSON object with the same outer provenance fields: - `dataset_id`: dataset identifier, always `pfam` - `row`: raw upstream Pfam row represented as a nested JSON object - `row_index`: zero-based row index within the upstream source table - `source_file`: original Pfam source path The `clans` table contains Pfam-A family and clan metadata. Its upstream fields correspond to family name, Pfam family identifier, clan identifier, clan short name, and Pfam accession. The `regions` table contains Pfam-A sequence-region assignments. Its nested `row` fields include: - `pfamseq_acc`: protein sequence accession - `seq_version`: sequence version - `crc64`: CRC64 checksum for the protein sequence - `md5`: MD5 checksum for the protein sequence - `pfamA_acc`: Pfam-A family accession - `seq_start`, `seq_end`: domain coordinates on the full sequence - `ali_start`, `ali_end`: alignment coordinates for the Pfam match ## Usage Load the smaller clans table: ```python from datasets import load_dataset clans = load_dataset("LiteFold/Pfam", "clans", split="train") print(clans[0]) ``` Stream the large regions table: ```python from datasets import load_dataset regions = load_dataset("LiteFold/Pfam", "regions", split="train", streaming=True) row = next(iter(regions)) print(row["dataset_id"]) print(row["row"]["pfamseq_acc"]) print(row["row"]["pfamA_acc"]) print(row["row"]["seq_start"], row["row"]["seq_end"]) ``` Load directly from JSONL paths if you do not want to use named configs: ```python from datasets import load_dataset regions = load_dataset( "json", data_files={ "train": "hf://datasets/LiteFold/Pfam/tables/annotation_pfam_current_release_Pfam-A.regions.tsv.gz.jsonl.parts/part-*.jsonl" }, split="train", streaming=True, ) ``` Download the full repository snapshot: ```bash hf download LiteFold/Pfam --repo-type dataset --local-dir ./pfam ``` Iterate over the raw JSONL files locally: ```python import json from pathlib import Path root = Path("./pfam") for jsonl in sorted(root.glob("tables/**/*.jsonl")): with jsonl.open() as handle: for line in handle: record = json.loads(line) upstream_row = record["row"] break ``` ## Data Notes This dataset is a normalized table mirror, not a full mirror of every Pfam artifact. It includes Pfam-A clan mappings and Pfam-A region assignments, but not necessarily the full profile HMM files, seed/full alignments, or upstream sequence databases. Use `row_index` and `source_file` when you need reproducible provenance back to the Pfam release files. Because the two tables have different nested `row` schemas, load them separately using the `clans` and `regions` configs or explicit `data_files`. Loading every JSONL file in the repository as a single dataset may fail schema casting in the Hugging Face dataset viewer. ## License This mirror follows the upstream Pfam release license metadata provided with the dataset: `CC0 1.0`. # Citation ```bibtex @article{mistry2021pfam, title = {{Pfam}: The protein families database in 2021}, author = {Mistry, Jaina and Chuguransky, Sara and Williams, Lowri and Qureshi, Matloob and Salazar, Gustavo A. and Sonnhammer, Erik L. L. and Tosatto, Silvio C. E. and Paladin, Lisanna and Raj, Shriya and Richardson, Lorna J. and Finn, Robert D. and Bateman, Alex}, journal = {Nucleic Acids Research}, volume = {49}, number = {D1}, pages = {D412--D419}, year = {2021}, doi = {10.1093/nar/gkaa913}, url = {https://doi.org/10.1093/nar/gkaa913} } ```