preon


Namepreon JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/ermshaua/preon
Summary
upload_time2023-05-25 13:39:54
maintainer
docs_urlNone
authorArik Ermshaus
requires_python>=3.7,<3.11
licenseBSD 3-Clause License Copyright (c) 2021, Arik Ermshaus All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords precision-oncology data-integration text-mining normalization drug-names cancer-types
VCS
bugtrack_url
requirements daproli jellyfish nltk numpy pandas pronto tqdm lxml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

```python3
>>> from preon.normalization import PrecisionOncologyNormalizer
>>> from preon.drug import load_ebi_drugs
```

Before we fit the normalizer with the drug names and ids as its reference data, download the <a href="https://www.ebi.ac.uk/chembl/g/#search_results/compounds">EBI compound CSV file</a> and place it into the resources folder `preon/resources/ebi_drugs.csv` where it is expected (or specify another folder). Unfortunately, we cannot easily download the drug names automatically.

```python3
>>> 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".

```python3
>>> 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.

```python3
>>> 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".

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

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.

In a similar fashion you can normalize cancer types or genes. we provide gold standards for preon with which we test it. For more detail, see the example <a href="https://github.com/ermshaua/preon/tree/main/preon/examples">notebooks</a>. We also use preon in practice to normalize and integrate medical data in the <a href="https://predict.informatik.hu-berlin.de/">PREDICT</a> 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 <a href="https://doi.org/10.1101/2023.05.22.540912" target="_blank">citation</a>:

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ermshaua/preon",
    "name": "preon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<3.11",
    "maintainer_email": "",
    "keywords": "precision-oncology,data-integration,text-mining,normalization,drug-names,cancer-types",
    "author": "Arik Ermshaus",
    "author_email": "Arik Ermshaus <ermshaua@informatik.hu-berlin.de>",
    "download_url": "https://files.pythonhosted.org/packages/ad/14/5f2a6eb8f0479b6c552455c6bbbca362ace624a5a61233c498ef4298bc20/preon-0.1.0.tar.gz",
    "platform": null,
    "description": "# preon (PREcision Oncology Normalization)\npreon is a fuzzy search tool for medical entities.\n\n## Installation\n\nYou can install preon with PyPi:\n`python -m pip install preon`\n\n## Examples\n\nLet's first import the normalizer and EBI drug names with CHEMBL ids.\n\n```python3\n>>> from preon.normalization import PrecisionOncologyNormalizer\n>>> from preon.drug import load_ebi_drugs\n```\n\nBefore we fit the normalizer with the drug names and ids as its reference data, download the <a href=\"https://www.ebi.ac.uk/chembl/g/#search_results/compounds\">EBI compound CSV file</a> and place it into the resources folder `preon/resources/ebi_drugs.csv` where it is expected (or specify another folder). Unfortunately, we cannot easily download the drug names automatically.\n\n```python3\n>>> drug_names, chembl_ids = load_ebi_drugs()\n>>> normalizer = PrecisionOncologyNormalizer().fit(drug_names, chembl_ids)\n```\n\nWe can now search for drug names and retrieve their CHEMBL ids. Let's search for the cancer drug \"Avastin\".\n\n```python3\n>>> normalizer.query(\"Avastin\")\n(['avastin'], [['CHEMBL1201583']], {'match_type': 'exact'})\n```\n\nAs 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.\n\n```python3\n>>> normalizer.query(\"Ixabepilone Epothilone B analog\")\n(['ixabepilone'], [['CHEMBL1201752']], {'match_type': 'substring'})\n```\n\nWe 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\".\n\n```python3\n>>> normalizer.query(\"Isavuconaconium\")\n(['isavuconazonium'], [['CHEMBL1183349']], {'match_type': 'partial', 'edit_distance': 0.0667})\n```\n\npreon 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.\n\nIn a similar fashion you can normalize cancer types or genes. we provide gold standards for preon with which we test it. For more detail, see the example <a href=\"https://github.com/ermshaua/preon/tree/main/preon/examples\">notebooks</a>. We also use preon in practice to normalize and integrate medical data in the <a href=\"https://predict.informatik.hu-berlin.de/\">PREDICT</a> project.\n\n## Citation\n\nThe preon package is actively maintained, updated and intended for application. If you use it in your scientific publication, we would appreciate the following <a href=\"https://doi.org/10.1101/2023.05.22.540912\" target=\"_blank\">citation</a>:\n\n```\n@article {preon2023,\n\tauthor = {Arik Ermshaus and Michael Piechotta and Gina R{\\\"u}ter and Ulrich Keilholz and Ulf Leser and Manuela Benary},\n\ttitle = {preon: Fast and accurate entity normalization for drug names and cancer types in precision oncology},\n\tyear = {2023},\n\tdoi = {10.1101/2023.05.22.540912},\n\tjournal = {bioRxiv}\n}\n```\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2021, Arik Ermshaus All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/ermshaua/preon",
        "repository": "https://github.com/ermshaua/preon"
    },
    "split_keywords": [
        "precision-oncology",
        "data-integration",
        "text-mining",
        "normalization",
        "drug-names",
        "cancer-types"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad145f2a6eb8f0479b6c552455c6bbbca362ace624a5a61233c498ef4298bc20",
                "md5": "643f7c6aa6c017a6dd2b4823b47b97f2",
                "sha256": "f83e97a92ccf90d2276bd3b6895f0e4171567b964f6657e35719dc40db7e82b1"
            },
            "downloads": -1,
            "filename": "preon-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "643f7c6aa6c017a6dd2b4823b47b97f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<3.11",
            "size": 12770,
            "upload_time": "2023-05-25T13:39:54",
            "upload_time_iso_8601": "2023-05-25T13:39:54.275227Z",
            "url": "https://files.pythonhosted.org/packages/ad/14/5f2a6eb8f0479b6c552455c6bbbca362ace624a5a61233c498ef4298bc20/preon-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-25 13:39:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ermshaua",
    "github_project": "preon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "daproli",
            "specs": [
                [
                    ">=",
                    "0.22"
                ]
            ]
        },
        {
            "name": "jellyfish",
            "specs": [
                [
                    ">=",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "nltk",
            "specs": [
                [
                    ">=",
                    "3.6.5"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.21.0"
                ],
                [
                    "<",
                    "1.25"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "<",
                    "1.6.0"
                ],
                [
                    ">=",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "pronto",
            "specs": [
                [
                    ">=",
                    "2.5.0"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    ">=",
                    "4.62.3"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    ">=",
                    "4.6.3"
                ]
            ]
        }
    ],
    "lcname": "preon"
}
        
Elapsed time: 0.07468s