Skip to main content

No project description provided

Project description

preon (PREcision Oncology Normalization)

preon is a fuzzy search tool for medical entities.

Installation

You can install preon with PyPi: python -m pip install preon

Examples

Let's first import the normalizer and EBI drug names with CHEMBL ids.

>>> from preon.normalization import PrecisionOncologyNormalizer
>>> from preon.drug import store_ebi_drugs, load_ebi_drugs

Please download the EBI compound CSV file and store it as a local resource. This step only has to be performed when the resource file is created or updated.

>>> store_ebi_drugs("/Users/Username/Downloads/compounds.csv")

Next, we can fit the normalizer with the drug names and ids as its reference data.

>>> drug_names, chembl_ids = load_ebi_drugs()
>>> normalizer = PrecisionOncologyNormalizer().fit(drug_names, chembl_ids)

We can now search for drug names and retrieve their CHEMBL ids. Let's search for the cancer drug "Avastin".

>>> normalizer.query("Avastin")
(['avastin'], [['CHEMBL1201583']], {'match_type': 'exact'})

As a result for our query, we get list of matching normalized drug names (in this case ['avastin']), a list of associated CHEMBL ids for every returned drug name [['CHEMBL1201583']] and some meta information about the matching {'match_type': 'exact'}. We can also search for multi-token drug names like "Ixabepilone Epothilone B analog" and find CHEMBL ids for the relevant tokens.

>>> normalizer.query("Ixabepilone Epothilone B analog")
(['ixabepilone'], [['CHEMBL1201752']], {'match_type': 'substring'})

We find the relevant drug name ['ixabepilone'] and preon provides the meta information that the matching is based on a substring. On default, preon only looks for 1 matching token. It can also look for n-grams by setting the n_grams parameter in the query method. Let's take a harder example, say "Isavuconazonium", but misspell it as "Isavuconaconium".

>>> normalizer.query("Isavuconaconium")
(['isavuconazonium'], [['CHEMBL1183349']], {'match_type': 'partial', 'edit_distance': 0.067})

preon finds the correct drug "Isavuconazonium" and provides the meta information that it is a partial match with 7% distance. It returns drug names with a distance smaller than 20% on default. In order to change this parameter, set the threshold argument in the query method. If preon cannot normalize the query, it returns None and issues a user warning.

>>> normalizer.query("risolipase en.")
preon/normalization.py:50: UserWarning: Cannot match risolipase en. to reference data. Try changing the partial matching threshold or number of n-grams.

For automatic data integrations, warnings can be stored in a logging file, see e.g. here. In a similar fashion, you can also normalize cancer types or genes. We provide gold standards for preon with which we test it. For more detail, see the example notebooks. We also use preon in practice to normalize and integrate medical data in the PREDICT project.

Citation

The preon package is actively maintained, updated and intended for application. If you use it in your scientific publication, we would appreciate the following citation:

@article{preon2023,
  title={preon: Fast and accurate entity normalization for drug names and cancer types in precision oncology},
  author={Arik Ermshaus and Michael Piechotta and Gina R{\"u}ter and Ulrich Keilholz and Ulf Leser and Manuela Benary},
  journal={Bioinformatics},
  year={2023},
  volume={40}
}

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

preon-0.1.2.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preon-0.1.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file preon-0.1.2.tar.gz.

File metadata

  • Download URL: preon-0.1.2.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for preon-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9b91f92d460dcb5524493977b488ce9d08bba7ccfddfb6df4fa5ac0bf0bfc0dd
MD5 b2edbef8a95a5048c1785d24499b7f19
BLAKE2b-256 d91c55d56918a316ca973e2bf99b8c5f910940ce7242c3f470b8dc572c0fd062

See more details on using hashes here.

File details

Details for the file preon-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: preon-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for preon-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81412586b820e8f7a8b54750528c98d00efc101bb371997d955578e1f3a976a1
MD5 8843fa6a586546ea21be675498b81cf4
BLAKE2b-256 e84482e919b1d0255c7e4ee1523ff5145ddc253f726a15e52d64c91ffbc8ebe7

See more details on using hashes here.

Supported by

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