Datasets:
File size: 4,724 Bytes
57ce52b 9383f4d 57ce52b 9383f4d 57ce52b 9383f4d 57ce52b 9383f4d | 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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | ---
pretty_name: Gene Ontology Terms
license: cc-by-4.0
tags:
- biology
- ontology
- gene-ontology
- go
- obo
- parquet
configs:
- config_name: default
data_files:
- split: train
path: data/train-*.parquet
- split: test
path: data/test-*.parquet
---
# Gene Ontology Terms
The Gene Ontology is a structured knowledgebase and controlled vocabulary for describing gene product functions, biological processes, and cellular components across organisms.
This dataset contains a viewer-friendly Parquet table derived from the Gene Ontology OBO files in this repository. Each row is one `[Term]` stanza from `go.obo`, with repeated OBO fields stored as list columns.
The original source files are preserved in the repository:
- `go.obo`
- `go-basic.obo`
`in_go_basic` marks whether a term is also present in `go-basic.obo`. Relationship typedef metadata from `go.obo` is available as `metadata/typedefs.parquet`.
## Splits
The split is deterministic by GO identifier: `sha256(go_id) % 10`. Bucket `0` is `test`; buckets `1` through `9` are `train`.
| Split | Rows |
|---|---:|
| train | 43,522 |
| test | 4,769 |
| total | 48,291 |
## Dataset Statistics
| Field | Value |
|---|---:|
| GO release | `releases/2026-03-25` |
| Terms | 48,291 |
| Typedefs | 11 |
| Terms in `go-basic.obo` | 48,291 |
| Active terms | 38,560 |
| Obsolete terms | 9,731 |
| Namespace | Rows |
|---|---:|
| biological_process | 30,857 |
| molecular_function | 12,839 |
| cellular_component | 4,595 |
## Usage
Install the Hugging Face Datasets library:
```bash
pip install datasets
```
Load all splits:
```python
from datasets import load_dataset
ds = load_dataset("LiteFold/GO")
print(ds)
row = ds["train"][0]
print(row["go_id"], row["name"], row["namespace"])
```
Load one split:
```python
from datasets import load_dataset
train = load_dataset("LiteFold/GO", split="train")
test = load_dataset("LiteFold/GO", split="test")
```
Stream rows without downloading the full table first:
```python
from datasets import load_dataset
stream = load_dataset("LiteFold/GO", split="train", streaming=True)
for row in stream.take(5):
print(row["go_id"], row["name"])
```
Filter active biological process terms:
```python
from datasets import load_dataset
ds = load_dataset("LiteFold/GO", split="train")
active_bp = ds.filter(
lambda row: row["namespace"] == "biological_process" and not row["is_obsolete"]
)
print(active_bp[0])
```
Load typedef metadata directly:
```python
import pandas as pd
from huggingface_hub import hf_hub_download
path = hf_hub_download(
repo_id="LiteFold/GO",
repo_type="dataset",
filename="metadata/typedefs.parquet",
)
typedefs = pd.read_parquet(path)
print(typedefs[["id", "name"]].head())
```
## Columns
| Column | Description |
|---|---|
| `go_id` | GO identifier, such as `GO:0008150`. |
| `go_numeric_id` | Numeric portion of `go_id`. |
| `name` | Term name. |
| `namespace` | GO namespace: `biological_process`, `molecular_function`, or `cellular_component`. |
| `definition` | Parsed OBO definition text. |
| `definition_xrefs` | Cross-references attached to the definition. |
| `comment` | OBO comment text, when present. |
| `synonyms` | Parsed synonym strings. |
| `synonym_scopes` | Scope for each synonym, such as `EXACT`, `BROAD`, `NARROW`, or `RELATED`. |
| `alt_ids` | Alternate GO identifiers. |
| `subsets` | GO subsets or slims containing the term. |
| `xrefs` | Term cross-references. |
| `is_a_ids` | Direct `is_a` parent GO identifiers. |
| `relationship_edges` | Raw relationship edges with comments removed. |
| `relationship_types` | Relationship predicates, such as `part_of` or `regulates`. |
| `relationship_target_ids` | GO identifiers targeted by relationship edges. |
| `parent_ids` | Combined unique `is_a_ids` and `relationship_target_ids`. |
| `intersection_of` | Parsed `intersection_of` entries. |
| `union_of` | Parsed `union_of` entries. |
| `disjoint_from` | Parsed `disjoint_from` entries. |
| `replaced_by` | Replacement IDs for obsolete terms. |
| `consider` | Suggested replacement IDs for obsolete terms. |
| `property_values` | Raw OBO property values. |
| `created_by` | Creator metadata, when present. |
| `creation_date` | Creation date metadata, when present. |
| `is_obsolete` | Whether the term is obsolete. |
| `in_go_basic` | Whether the same GO ID appears in `go-basic.obo`. |
| `split_bucket` | Deterministic split bucket from `sha256(go_id) % 10`. |
# Citation
```
@article{geneontology2023,
title = {The Gene Ontology knowledgebase in 2023},
author = {{The Gene Ontology Consortium}},
journal = {Genetics},
volume = {224},
number = {1},
year = {2023},
doi = {10.1093/genetics/iyad031}
}
``` |