From ad3c2d630f8cef02e85f9b20e0a9d106ed3836e6 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Fri, 16 Feb 2024 16:27:34 -0800 Subject: [PATCH] fix generation --- .github/workflows/generate_curated_lists.yml | 6 +++++- tools/ontology-builder/src/curated_lists.py | 16 ++++++++-------- .../src/curation_list_generator.py | 13 +++++++------ .../src/ontology-references/cell_class_list.json | 0 .../ontology-references/cell_subclass_list.json | 0 .../src/ontology-references/organ_list.json | 0 .../src/ontology-references/system_list.json | 0 .../ontology-references/tissue_general_list.json | 0 8 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 tools/ontology-builder/src/ontology-references/cell_class_list.json create mode 100644 tools/ontology-builder/src/ontology-references/cell_subclass_list.json create mode 100644 tools/ontology-builder/src/ontology-references/organ_list.json create mode 100644 tools/ontology-builder/src/ontology-references/system_list.json create mode 100644 tools/ontology-builder/src/ontology-references/tissue_general_list.json diff --git a/.github/workflows/generate_curated_lists.yml b/.github/workflows/generate_curated_lists.yml index 47726bb3..caa7adf6 100644 --- a/.github/workflows/generate_curated_lists.yml +++ b/.github/workflows/generate_curated_lists.yml @@ -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" diff --git a/tools/ontology-builder/src/curated_lists.py b/tools/ontology-builder/src/curated_lists.py index e39e05be..8967718b 100644 --- a/tools/ontology-builder/src/curated_lists.py +++ b/tools/ontology-builder/src/curated_lists.py @@ -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", @@ -21,7 +21,7 @@ "UBERON_0001434", ] -# Hand-curated organs. +# ### Hand-curated organs. ORGAN_TISSUES = [ "UBERON_0000992", "UBERON_0000029", @@ -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 @@ -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 diff --git a/tools/ontology-builder/src/curation_list_generator.py b/tools/ontology-builder/src/curation_list_generator.py index 4ba6bce8..72af35cb 100644 --- a/tools/ontology-builder/src/curation_list_generator.py +++ b/tools/ontology-builder/src/curation_list_generator.py @@ -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 @@ -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__": diff --git a/tools/ontology-builder/src/ontology-references/cell_class_list.json b/tools/ontology-builder/src/ontology-references/cell_class_list.json new file mode 100644 index 00000000..e69de29b diff --git a/tools/ontology-builder/src/ontology-references/cell_subclass_list.json b/tools/ontology-builder/src/ontology-references/cell_subclass_list.json new file mode 100644 index 00000000..e69de29b diff --git a/tools/ontology-builder/src/ontology-references/organ_list.json b/tools/ontology-builder/src/ontology-references/organ_list.json new file mode 100644 index 00000000..e69de29b diff --git a/tools/ontology-builder/src/ontology-references/system_list.json b/tools/ontology-builder/src/ontology-references/system_list.json new file mode 100644 index 00000000..e69de29b diff --git a/tools/ontology-builder/src/ontology-references/tissue_general_list.json b/tools/ontology-builder/src/ontology-references/tissue_general_list.json new file mode 100644 index 00000000..e69de29b