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 CIDs entries.

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

Installation

pip install drugresolver

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.1.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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: drug_resolver-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 3ac509154c5ecd37fdd1387cda09dae9d0ec8da0f45d58e7fc02d246a81d9340
MD5 acd006315e780db9e8ed907fd002964c
BLAKE2b-256 6f8d33d0419f46494aa92d841a42e3a10767420052e1b16d3a58c68e19d03619

See more details on using hashes here.

Provenance

The following attestation bundles were made for drug_resolver-0.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: drug_resolver-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70dac80e2e4d9c254eda377ac8e01d31fffbeac6aa7bb976cd7179c28833f4f0
MD5 71718376be98e2db59453ad152b8bb5c
BLAKE2b-256 d5ccf690a40bd86ff2277a34639c3d75730fc3833d6de7b557dc1bd09cfbdc24

See more details on using hashes here.

Provenance

The following attestation bundles were made for drug_resolver-0.0.1-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