GO / README.md
anindya64's picture
Update README.md
9383f4d verified
---
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}
}
```