Skip to main content

Python version of LOINC2HPO

Project description

PyPI version Anaconda-Server Badge

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

conda config --add channels conda-forge
conda config --set channel_priority strict
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

A dictionary from file:

annotations = AnnotationParser.parse_annotation_file(annotation_path)

A list from file:

annotations = AnnotationParser.parse_annotation_file(annotation_path, ls=True)

A dictionary from pandas df:

annotations = AnnotationParser.parse_annotation(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

resolver = QueryResolver(annotations)
hpo_term = resolver.resolve(query)

Project details


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.2.dev1.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

loinchpo-1.1.2.dev1-py3-none-any.whl (39.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page