Computable OWL Formalization of LOINC
- comp-loinc/ - Python package for this project
- data/ - LOINC Input data and output OWL Files
- code_files/ - LOINC Code Files
- part_files/ - LOINC Part Files
- output/ - OWL Output Files
- owl_component_files/ - OWL Component Files
- merged_loinc.owl - Merged OWL File
- merged_reasoned_loinc.owl - Merged and Reasoned OWL File
- project/ - project files (do not edit these)
- src/ - source files (edit these)
- tests/ - Python tests
- data/ - LOINC Input data and output OWL Files
make all
: make everythingmake deploy
: deploys site
This project was made with linkml-project-cookiecutter.
- Python 3.9.7+
- Required LOINC Files They need to be put in these locations:
data/part_files/ComponentTree.tsv
data/code_files/LOINC.csv
data/code_files/LoincPartlink_Primary.csv
- Clone this repository.
- install poetry [pip install poetry]
- run
poetry install
- run
poetry shell
Commands 1.1 - 1.5 are meant to be run sequentially.
Alternatively, you can run all of them at once using default values by running python src/comp_loinc/main.py all
.
Help text can be run via python src/comp_loinc/main.py --help
. You can see help text for a specific command, including
information about its parameters, by running python src/comp_loinc/main.py COMMAND_NAME --help
.
1.0. loinc_release
: Download the latest LOINC release files and put them in the correct locations. Zip LoincRelease needs to be in the data/loinc_release directory.
python src/comp_loinc/main.py loinc_release
python src/comp_loinc/main.py parts --schema-file src/comp_loinc/schema/part_schema.yaml --part-directory data/part_files --output data/output/owl_component_files/part_ontology.owl
python src/comp_loinc/main.py codes --schema-file src/comp_loinc/schema/code_schema.yaml --code-directory data/code_files --output data/output/owl_component_files/code_classes.owl
1.3. composed
: Build the composed class axioms for the reasoner to group classes (this is pretty bespoke, and hardcoded at the moment)
python src/comp_loinc/main.py composed --schema-file src/comp_loinc/schema/grouping_classes_schema.yaml --composed-classes-data-file data/composed_classes_data.yaml --output data/output/owl_component_files/composed_component_classes.owl
1.4. map
: Get Mappings from the LOINC FHIR Server and use SSSOM to convert to OWL (Requires LOINC FHIR Server credentials)
python src/comp_loinc/main.py map --username username --password password --output loinc2chebi.owl
python src/comp_loinc/main.py merge --owl-directory data/output/owl_component_files/ --output data/output/merged_loinc.owl
python src/comp_loinc/main.py reason --output latest/comp_loinc.owl
Open data/output/merged_reasoned_loinc.owl