diff --git a/README.md b/README.md index 68f156e..d0aba6c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A slimmed down version of CHEBI sufficient to cover 99% of the term needs across 1. Make a Pull request on https://github.com/obophenotype/chebi_obo_slim/blob/main/seed.txt. In the PR, indicate which terms you are adding (at least the ids) and for which ontology. 2. If you are a member of obophenotype organisation: - - You should make sure seed.txt is sorted alphanumerically + - You should make sure seed.txt is sorted alphanumerically by running `python scripts/sort.py` - Merge the changes without review at your own discretion 3. If you are not a member of obophenotype organisation: - Wait until a member of obophenotype deals with your PR diff --git a/scripts/sort.py b/scripts/sort.py new file mode 100644 index 0000000..7b87542 --- /dev/null +++ b/scripts/sort.py @@ -0,0 +1,16 @@ +"""Run this script to sort the ``seed.txt`` file.""" + +from pathlib import Path + +HERE = Path(__file__).parent.resolve() +ROOT = HERE.parent.resolve() +SEED_PATH = ROOT.joinpath("seed.txt") + + +def main(): + curies = set(SEED_PATH.read_text().splitlines()) + SEED_PATH.write_text("\n".join(sorted(curies))) + + +if __name__ == "__main__": + main()