Skip to main content

A tool to resolve messy drug names in biomedical datasets to standard identifiers

Project description

Drug Resolver

This package offers a simple way to resolve drug names to their corresponding PubChem entries.

This is useful for identifying unknown drug synonyms or matching drug synonyms across different datasets in an automated way.

Installation

pip install drug-resolver

Usage

from drug_resolver import resolve_drug

d1 = resolve_drug("tetracycline hcl")
print(d1)
"""
ResolvedDrug(
   name='Tetracycline hydrochloride', 
   pubchem_compound_id='54704426', 
   pubchem_substance_id='103591391', 
   smiles='CN(C)C1C(=O)C(C(N)=O)=C(O)C2(O)C(=O)C3=C(O)c4c(O)cccc4C(C)(O)C3CC12.Cl', 
   drug_classes=None, 
   fda_approval=<FDAApprovalStatus.APPROVED: 'APPROVED'>, 
   pubchem_parent_compound_id='54675776')
"""

d2 = resolve_drug("Sumycin")
print(d2)
"""
ResolvedDrug(
    name='Tetracycline', 
    pubchem_compound_id='54675776', 
    pubchem_substance_id='124766046', 
    smiles='CN(C)C1C(=O)C(C(N)=O)=C(O)C2(O)C(=O)C3=C(O)c4c(O)cccc4C(C)(O)C3CC12', 
    drug_classes=frozenset({'Established Pharmacologic Class [EPC] - Tetracycline-class Antimicrobial'}), 
    fda_approval=<FDAApprovalStatus.APPROVED: 'APPROVED'>, 
    pubchem_parent_compound_id=None)
"""

assert d1 == d2 # True

The equality operator between ResolvedDrug objects will return True under the following conditions:

  • The pubchem_compound_id attribute is the same
  • The pubchem_substance_id attribute is the same
  • The smiles strings refer to the same molecule
  • Two compounds share the same pubchem_parent_compound_id or the pubchem_compound_id is the same as the pubchem_parent_compound_id of the other compound.

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

drug_resolver-0.0.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

drug_resolver-0.0.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file drug_resolver-0.0.4.tar.gz.

File metadata

  • Download URL: drug_resolver-0.0.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for drug_resolver-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6b633932553f070e0dce240627a0b56ab38e8460e61e72762385a27e0dbaeab9
MD5 597f7b9646c6537cf27a29a1467c20c2
BLAKE2b-256 30d08f7325f6569bf4f1984b1bd42b7e22f21387319e0c387990bb8afadf8c26

See more details on using hashes here.

Provenance

The following attestation bundles were made for drug_resolver-0.0.4.tar.gz:

Publisher: release.yml on tansey-lab/drug-resolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file drug_resolver-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: drug_resolver-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for drug_resolver-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 df935d86f13c009dbc0490ea38f7d6f34257f358f3e6d34e3b2f7a2aed34b8d4
MD5 ce51be3e1f71d411c05dd778534a8c87
BLAKE2b-256 d1be01fba8eb7fa74bba87319da6e284a0508e0c16721c6ef88f828122a2bb35

See more details on using hashes here.

Provenance

The following attestation bundles were made for drug_resolver-0.0.4-py3-none-any.whl:

Publisher: release.yml on tansey-lab/drug-resolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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