Python version of LOINC2HPO
Project description
loinchpo
A simple and efficient library for mapping loinc test results to hpo terms.
Requirements
Python 3.5+
Installing with pip
pip install loinchpo
Installing with Conda
# Ensure conda-forge is in your channels
conda config --add channels conda-forge
conda config --set channel_priority strict
# Install the package
conda install loinchpo
Usage
Just three steps and you should be able to map your loinc codes to hpo.
1. Parse the annotations using AnnotationParser
# returns a list of the annotations
annotations = AnnotationParser.parse_annotation_file(annotation_path)
# returns a dictionary query mapper
annotations = AnnotationParser.parse_annotation_file_dict(annotation_path)
# returns a dictionary query mapper from a pandas dataframe
annotations = AnnotationParser.parse_annotation_pandas(dataframe)
2. Parse the query files
# file path returns a list of queries
queries = QueryFileParser.parse(query_path)
# single query
query = Query(loinc_id, outcome)
3. Resolve the hpo term
# Resolve the hpo term.
resolver = QueryResolver(annotations)
hpo_term = resolver.resolve(query)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
loinchpo-1.1.1.tar.gz
(20.6 kB
view hashes)
Built Distribution
loinchpo-1.1.1-py3-none-any.whl
(48.1 kB
view hashes)