|
| 1 | +# Ontology of Biological Attributes (OBA) Project Guide |
| 2 | + |
| 3 | +This includes instructions for editing the OBA ontology. |
| 4 | + |
| 5 | +## Project Layout |
| 6 | +- Main development file is `src/patterns/definitions.owl` (functional syntax) |
| 7 | +- ODK and ontology documentation can be found in `/docs/` |
| 8 | + |
| 9 | +## Querying ontology |
| 10 | + |
| 11 | +- Use grep/rg to find terms. To look at a specific term if you know the ID: |
| 12 | + - `grep 'id: OBA_2040177' src/patterns/definitions.owl` |
| 13 | +- All mentions of an ID |
| 14 | + - `obo-grep.pl -r 'OBA_2040177' src/patterns/definitions.owl` |
| 15 | +- Search over `src/patterns/definitions.owl`,`src/patterns/dosdp-patterns/*.yaml` and `src/patterns/data/default`. |
| 16 | +- DO NOT bother doing your own greps over the files, or looking for other files, unless otherwise asked, you will just waste time. |
| 17 | +- ONLY use the methods above for searching the ontology |
| 18 | + |
| 19 | +## Before making edits |
| 20 | +- Read the request carefully and make a plan, especially if there is nuance |
| 21 | +- If related issues are mentioned read them: `gh issue view GITHUB-ISSUE-NUMBER` |
| 22 | +- If a PMID is mentioned in the issue, ALWAYS try and read it |
| 23 | +- ALWAYS check proposed parent terms for consistency |
| 24 | + |
| 25 | +## Editors guide |
| 26 | + |
| 27 | +### How to create new terms in OBA |
| 28 | + |
| 29 | +#### Overview |
| 30 | +- OBA terms are compositional, check DOSDP design patterns: `src/patterns/dosdp-patterns/*.yaml` |
| 31 | +- Design pattern templates are found in `src/patterns/data/default` |
| 32 | + |
| 33 | +#### Steps |
| 34 | + |
| 35 | + 1- Read the issue carefully to identify the most appropriate design pattern and filler terms. Use the following examples as a general guide. |
| 36 | + |
| 37 | + Example 1: The amount or level of cholesterol when measured in blood serum. Use the design pattern template `entity_attribute_location.tsv` and the filler terms: cholesterol, amount and blood serum. |
| 38 | + |
| 39 | + Example 2: The age at which asthma manifestations first appear. Use the design pattern template `disease_onset.tsv` and the filler term: asthma. |
| 40 | + |
| 41 | + Example 3: A trait that affects the response to prednisolone. Use the design pattern template `response_to_chemical_stimulus_trait.tsv` and the filler term: prednisolone. |
| 42 | + |
| 43 | + 2- Check whether design pattern fillers have been imported to OBA. `grep - i src/ontology/imports/merged_import.owl` |
| 44 | + |
| 45 | + 3- If they have been imported, please proceed to creating the new OBA term using the appropriate DOSDP pattern template. |
| 46 | + |
| 47 | + 4- Add the term to the template, then in `src/ontology` run |
| 48 | + `make IMP=false MIR=false ../patterns/definitions.owl` |
| 49 | + |
| 50 | + 5- Refresh OBA imports by running |
| 51 | + `make refresh-merged` |
| 52 | + |
| 53 | + 6 - Run `make IMP=false MIR=false ../patterns/definitions.owl` again. |
| 54 | + |
| 55 | + 7- When creating new OBA terms using DOSDP patterns, it may be necessary to import terms from other ontologies like ChEBI, the Chemical Entities of Biological Interest or PRO, the PRotein Ontology. However, they are too large to be managed as standard imports so are managed as slims. They are located here: |
| 56 | + PRO: https://github.com/obophenotype/pro_obo_slim |
| 57 | + CHEBI: https://github.com/obophenotype/chebi_obo_slim |
| 58 | + |
| 59 | + When a new term you are using in a DOSDP pattern is not yet in a slim, make a comment in the issue requesting the terms to be added manually. |
| 60 | + |
| 61 | +## OBO Format Guidelines |
| 62 | +- Term ID format: OBA:NNNNNNN (7-digit number) |
| 63 | +- Handling New Term Requests (NTRs): |
| 64 | + - New terms start OBA:210xxxx |
| 65 | + - Do `grep id: OBA:210 src/patterns/definitions.owl` to check for clashes |
| 66 | +- Each term requires: id, name, definition with references |
| 67 | +- Never guess OBA IDs, or ontology term IDs, use search tools above to determine actual term |
| 68 | +- Never guess PMIDs for references, do a web search if needed |
| 69 | +- Use standard relationship types: `is_a`, `part_of`, `characteristic_of`, `characteristic_of_part_of`, `subclass_of` and `has_role`. |
| 70 | +- Follow existing term patterns for consistency |
| 71 | + |
| 72 | +## Publications |
| 73 | +- Run the command `aurelian fulltext <PMID:nnn>` to fetch full text for a publication. A doi or URL can also be used |
| 74 | +- You should cite publications appropriately, e.g. `def: "...." [PMID:nnnn, doi:mmmm] |
| 75 | + |
| 76 | +## GitHub Contribution Process |
| 77 | +- Most requests from users should follow one of two patterns: |
| 78 | + - You are not confident how to proceed, in which case end with asking a clarifying question (via `gh`) |
| 79 | + - You are confident how to proceed, you make changes, commit on a branch, and open a PR for the user to review |
| 80 | +- Check existing terms before adding new ones |
| 81 | +- For new terms: provide name, definition, place in hierarchy, and references |
| 82 | +- Include PMIDs for all assertions |
| 83 | +- Follow naming conventions from parent terms |
| 84 | +- Always commit in a branch, e.g. issue-NNN |
| 85 | +- If there is an existing PR which you started then checkout that branch and continue, rather than starting a new PR (unless you explicitly want to abandon the original PR, e.g. it was on completely the wrong tracks) |
| 86 | +- Always make clear detailed commit messages, saying what you did and why |
| 87 | +- Always sign your commits `@AI agent` |
| 88 | +- Create PRs using `gh pr create ...` |
| 89 | +- File PRs with clear descriptions, and sign your PR |
| 90 | + |
| 91 | +## Handling GitHub issues and requests |
| 92 | +- Use `gh` to read and write issues/PRs |
| 93 | +- Sign all commits and PRs as `@AI agent` |
| 94 | + |
| 95 | +## Obsoleting terms originating from DOS-DP templates |
| 96 | + |
| 97 | +- Delete the row with the targeted term from the appropriate data table (tsv file) in folder: `src/patterns/data/default/` |
| 98 | +- Fill in the IRI of the term to be obsoleted in `src/templates/obsoletes.tsv` along with other relevant information. It is useful to add a comment with an explanation for the obsoletion. Start the comment with 'Reason for obsoletion: '. |
| 99 | + |
| 100 | +Example: |
| 101 | + |
| 102 | +``` |
| 103 | +
|
| 104 | +Ontology ID: http://purl.obolibrary.org/obo/OBA_2050081 |
| 105 | +Type: owl:Class |
| 106 | +Obsolete: true |
| 107 | +Replacement Term: http://purl.obolibrary.org/obo/OBA_2045319 |
| 108 | +label of replaced class: serum gamma-glutamyl transferase level |
| 109 | +Comment: Reason for obsoletion: a term with the same intended meaning already exists. |
| 110 | +
|
| 111 | +``` |
| 112 | + |
| 113 | +- Re-create the DOS-DP axioms by running |
| 114 | + |
| 115 | + `cd src/ontology #If you are not in the ontology folder` |
| 116 | + `make ../patterns/definitions.owl` |
| 117 | + `make components/obsoletes.owl` |
| 118 | + |
| 119 | +## Other metadata |
| 120 | + |
| 121 | +- Link back to the issue you are dealing with using the `term_tracker_item` |
| 122 | +- All terms should have definitions, with at least one definition xref, ideally a PMID |
| 123 | +- You can sign terms as `created_by: AI agent` |
| 124 | + |
| 125 | +## Relationships |
| 126 | + |
| 127 | +All terms should have at least one `is_a` (this can be implicit by a logical definition, see below). |
| 128 | +The four main relationships used in OBA are `part_of`, `characteristic_of`, `characteristic_of_part_of`, and `subclass_of`. In addition, the relationship `has_role` is used in cases where the definition of a biological attribute requires a reference to a chemical role. |
| 129 | + |
| 130 | +## Logical definitions |
| 131 | + |
| 132 | +These should follow genus-differentia form, and depend on the pattern used. |
| 133 | + |
| 134 | + Example: |
| 135 | + |
| 136 | + ``` |
| 137 | + |
| 138 | + [Term] |
| 139 | + id: OBA:2040177 |
| 140 | + name: level of ceramide |
| 141 | + def: "The amount of a ceramide when measured in anatomical entity." [AUTO:patterns/patterns/entity_attribute_location] |
| 142 | + synonym: "anatomical entity ceramide amount" EXACT [AUTO:patterns/patterns/entity_attribute_location] |
| 143 | + synonym: "ceramide amount" EXACT [] |
| 144 | + is_a: OBA:1000965 ! sphingolipid level |
| 145 | + property_value: terms:contributor "https://orcid.org/0000-0001-8314-2140" xsd:string |
| 146 | + |
| 147 | + ``` |
| 148 | + |
| 149 | +The reasoner can find the most specific `is_a`, so it's OK to leave this off. |
0 commit comments