|
|
--- |
|
|
tags: ['napistu', 'napistu-torch', 'graph-neural-networks', 'biological-networks', 'pytorch', 'napistu-data-store'] |
|
|
library_name: napistu-torch |
|
|
license: mit |
|
|
--- |
|
|
|
|
|
# NapistuDataStore Dataset |
|
|
|
|
|
This dataset contains a complete NapistuDataStore with all artifacts published as a read-only store. |
|
|
|
|
|
## Source Data |
|
|
|
|
|
This store was created from GCS asset: **human_consensus_no_rxns** (version: **20251218**) |
|
|
|
|
|
## Artifacts |
|
|
|
|
|
### NapistuData (1) |
|
|
- `relation_prediction` |
|
|
|
|
|
### VertexTensor (1) |
|
|
- `comprehensive_pathway_memberships` |
|
|
|
|
|
### Pandas DataFrame (5) |
|
|
- `edge_strata_by_node_species_type` |
|
|
- `edge_strata_by_edge_sbo_terms` |
|
|
- `species_identifiers` |
|
|
- `name_to_sid_map` |
|
|
- `edge_strata_by_node_type` |
|
|
|
|
|
## Usage |
|
|
|
|
|
### Load from HuggingFace Hub |
|
|
|
|
|
The easiest way to load this dataset is using the `from_huggingface` class method: |
|
|
|
|
|
```python |
|
|
from napistu_torch.napistu_data_store import NapistuDataStore |
|
|
from pathlib import Path |
|
|
|
|
|
# Load read-only store from HuggingFace Hub |
|
|
store = NapistuDataStore.from_huggingface( |
|
|
repo_id="seanhacks/relation_prediction", |
|
|
store_dir=Path("./local_store"), |
|
|
revision="main" |
|
|
) |
|
|
|
|
|
# Use the store (read-only) |
|
|
napistu_data = store.load_napistu_data("relation_prediction") |
|
|
``` |
|
|
|
|
|
### Configure DataConfig |
|
|
|
|
|
You can also use this dataset in your `DataConfig` YAML for PyTorch Lightning experiments: |
|
|
|
|
|
```yaml |
|
|
data: |
|
|
store_dir: "./local_store" |
|
|
hf_repo_id: "seanhacks/relation_prediction" |
|
|
hf_revision: "main" |
|
|
napistu_data_name: "relation_prediction" |
|
|
``` |
|
|
|
|
|
To make the store writable (non-read-only), provide paths to the raw data files: |
|
|
|
|
|
```yaml |
|
|
data: |
|
|
store_dir: "./local_store" |
|
|
hf_repo_id: "seanhacks/relation_prediction" |
|
|
hf_revision: "main" |
|
|
sbml_dfs_path: "/path/to/sbml_dfs.pkl" |
|
|
napistu_graph_path: "/path/to/napistu_graph.pkl" |
|
|
napistu_data_name: "relation_prediction" |
|
|
``` |
|
|
|
|
|
### Load Raw Data from GCS (Optional) |
|
|
|
|
|
If you need to create new artifacts, you can convert this read-only store to a non-read-only store |
|
|
by loading the raw data from GCS and passing the paths directly to `from_huggingface`: |
|
|
|
|
|
```python |
|
|
from napistu_torch.napistu_data_store import NapistuDataStore |
|
|
from napistu.gcs.downloads import load_public_napistu_asset |
|
|
from napistu.gcs.constants import GCS_SUBASSET_NAMES |
|
|
from pathlib import Path |
|
|
import tempfile |
|
|
|
|
|
# Download raw data from GCS |
|
|
with tempfile.TemporaryDirectory() as temp_data_dir: |
|
|
sbml_dfs_path = load_public_napistu_asset( |
|
|
"human_consensus_no_rxns", |
|
|
temp_data_dir, |
|
|
subasset=GCS_SUBASSET_NAMES.SBML_DFS, |
|
|
version="20251218", |
|
|
) |
|
|
napistu_graph_path = load_public_napistu_asset( |
|
|
"human_consensus_no_rxns", |
|
|
temp_data_dir, |
|
|
subasset=GCS_SUBASSET_NAMES.NAPISTU_GRAPH, |
|
|
version="20251218", |
|
|
) |
|
|
|
|
|
# Load and convert to non-read-only in one step |
|
|
store = NapistuDataStore.from_huggingface( |
|
|
repo_id="seanhacks/relation_prediction", |
|
|
store_dir=Path("./local_store"), |
|
|
revision="main", |
|
|
sbml_dfs_path=sbml_dfs_path, |
|
|
napistu_graph_path=napistu_graph_path, |
|
|
) |
|
|
|
|
|
# Now you can create new artifacts |
|
|
store.ensure_artifacts(["new_artifact_name"]) |
|
|
``` |
|
|
|
|
|
## Links |
|
|
|
|
|
- 🌐 [Napistu](https://napistu.com) |
|
|
- 💻 [GitHub Repository](https://github.com/napistu/Napistu-Torch) |
|
|
- 📚 [Napistu Wiki](https://github.com/napistu/napistu/wiki) |
|
|
|
|
|
## Citation |
|
|
|
|
|
If you use this dataset, please cite: |
|
|
|
|
|
```bibtex |
|
|
@software{napistu_torch, |
|
|
title = {Napistu-Torch: Graph Neural Networks for Biological Pathway Analysis}, |
|
|
author = {Hackett, Sean R.}, |
|
|
url = {https://github.com/napistu/Napistu-Torch}, |
|
|
year = {2025} |
|
|
} |
|
|
``` |
|
|
|
|
|
## License |
|
|
|
|
|
MIT License - See [LICENSE](https://github.com/napistu/Napistu-Torch/blob/main/LICENSE) for details. |
|
|
|