Skip to content

Commit

Permalink
fix generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bento007 committed Feb 17, 2024
1 parent ad425b9 commit ad3c2d6
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/generate_curated_lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ jobs:
- name: ontology-processing
run: |
python3 ./tools/ontology-builder/src/curated_lists.py
git add --all
git add ./tools/ontology-builder/src/ontology-references/tissue_general_list.json
git add ./tools/ontology-builder/src/ontology-references/organ_list.json
git add ./tools/ontology-builder/src/ontology-references/cell_class_list.json
git add ./tools/ontology-builder/src/ontology-references/cell_subclass_list.json
git add ./tools/ontology-builder/src/ontology-references/system_list.json
- name: Commit
run: |
git commit -m "AUTO: update curated_lists"
Expand Down
16 changes: 8 additions & 8 deletions tools/ontology-builder/src/curated_lists.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# #### Hand-Curation of Systems and Organs
# #### Tissue Constants
# Hand-curated systems.
# # Hand-Curation of Systems and Organs
# ## Tissue Constants
# ### Hand-curated systems.
SYSTEM_TISSUES = [
"UBERON_0001017",
"UBERON_0004535",
Expand All @@ -21,7 +21,7 @@
"UBERON_0001434",
]

# Hand-curated organs.
# ### Hand-curated organs.
ORGAN_TISSUES = [
"UBERON_0000992",
"UBERON_0000029",
Expand Down Expand Up @@ -167,9 +167,9 @@
"UBERON_0000916", # abdomen
]

# ### Cell Type Constants
# Hand-Curation of Cell Classes and Cell Subclasses
# Hand-curated cell classes.
# # Cell Type Constants
# ## Hand-Curation of Cell Classes and Cell Subclasses
# ### Hand-curated cell classes.
CELL_CLASSES = [
"CL_0002494", # cardiocyte
"CL_0002320", # connective tissue cell
Expand All @@ -196,7 +196,7 @@
"CL_4033054", # perivascular cell
]

# Hand-curated cell subclasses.
# ### Hand-curated cell subclasses.
CELL_SUBCLASSES = [
"CL_0000624", # CD4-positive, alpha-beta T cell
"CL_0000625", # CD8-positive, alpha-beta T cell
Expand Down
13 changes: 7 additions & 6 deletions tools/ontology-builder/src/curation_list_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os.path
from typing import List

import env
from curated_lists import CELL_CLASSES, CELL_SUBCLASSES, ORGAN_TISSUES, SYSTEM_TISSUES, TISSUE_GENERAL


Expand All @@ -17,20 +18,20 @@ def main(path: str = "ontology-references") -> None:
:return:
"""
# Create a dictionary that matches the JSON schema in artifact-schemas
with open(os.path.join(path, "system_list.json"), "w") as f:
json.dump(reformat_ontology_term_ids(SYSTEM_TISSUES), f)
with open(os.path.join(env.ONTOLOGY_REF_DIR, "system_list.json"), "w") as f:
json.dump(reformat_ontology_term_ids(SYSTEM_TISSUES), f, indent=0)

with open(os.path.join(path, "organ_list.json"), "w") as f:
json.dump(reformat_ontology_term_ids(ORGAN_TISSUES), f)
json.dump(reformat_ontology_term_ids(ORGAN_TISSUES), f, indent=0)

with open(os.path.join(path, "tissue_general_list.json"), "w") as f:
json.dump(reformat_ontology_term_ids(TISSUE_GENERAL), f)
json.dump(reformat_ontology_term_ids(TISSUE_GENERAL), f, indent=0)

with open(os.path.join(path, "cell_class_list.json"), "w") as f:
json.dump(reformat_ontology_term_ids(CELL_CLASSES), f)
json.dump(reformat_ontology_term_ids(CELL_CLASSES), f, indent=0)

with open(os.path.join(path, "cell_subclass_list.json"), "w") as f:
json.dump(reformat_ontology_term_ids(CELL_SUBCLASSES), f)
json.dump(reformat_ontology_term_ids(CELL_SUBCLASSES), f, indent=0)


if __name__ == "__main__":
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit ad3c2d6

Please sign in to comment.