Skip to main content

A package to characterize small ligands

Project description

DrugTax

DrugTax: package for drug taxonomy identification and explainable feature extraction

A.J.Preto, Paulo C. Correia and Irina S. Moreira

Abstract: DrugTax is an easy-to-use Python package for small molecule detailed characterization. It extends a previously explored chemical taxonomy making it ready-to-use in any Artificial Intelligence approach. DrugTax leverages small molecule representations as input in one of their most accessible and simple forms (SMILEs) and allows the simultaneously extraction of taxonomy information and key features for big data algorithm deployment. In addition, it delivers a set of tools for bulk analysis and visualization that can also be used for chemical space representation and molecule similarity assessment. DrugTax is a valuable tool for chemoinformatic processing and can be easily integrated in drug discovery pipelines. DrugTax can be effortlessly installed via PyPI (https://pypi.org/project/DrugTax/) or GitHub (https://github.com/MoreiraLAB/DrugTax).

Installation

To install DrugTax, first make sure you have python 3.6.x, or above, installed.

pip install drugtax upsetplot==0.6.0 pandas==1.1.5 matplotlib==3.3.4 pubchempy==1.0.4

In order to ensure all necessary packages are installed.

Usage

Firstly, import DrugTax

import drugtax

The basic usage of DrugTax stems from the DrugTax class, which takes as input a single SMILE.

molecule = drugtax.DrugTax("OC(=O)C1=C(C(O)=O)C(C(O)=O)=C(C(O)=O)C(C(O)=O)=C1C(O)=O")

The molecule object now has a series of useful properties such as:

  • molecule.smile: allows the user to check the SMILE at any time
  • molecule.superclasses: displays all the superclasses to which the input SMILE belongs
  • molecule.features: retrieves simple and explainable features that can be used on prediction tasks or dataset characterization
  • molecule.kingdom: informs on whether the molecule is organic or inorganic

Bulk analysis

For superclass computation, instead of directly invoking the DrugTax class, it is possible to use retrieve_taxonomic_class on several different inputs. The example below shows an example using only a SMILEs list, however, it is also possible to feed a drugs list - in which case DrugTax leverages pubchempy to retrieve the isomeric SMILEs - or a file. This function outputs a table with the SMILEs and their respective taxonomy, as well as a summary table detailing how many of which superclass combinations are present on the dataset.

smiles_table, summary_table = drugtax.retrieve_taxonomic_class(["CCNO","CCC"], input_mode = "smiles_list", output_name = "testing", write_values = True)

The retrieve_taxonomic_class function has different arguments that can be used to pick input and output information for bulk analysis submission. These are:

  • input_data: this is the only mandatory argument, corresponding to either a smiles list, a drugs names list or a file.
  • input_mode: depending on the input_data this argument needs to be changed. The default mode is file, which requires an input .csv file. This argument needs to be coupled with target_column, specifying the name of the column containing the input SMILEs. To input a list of SMILE, input_mode needs to be changed to smiles_list. To input a list of drug names from which isomeric SMILEs are to be retrieved with the aid of pubchempy, the user needs to change input_mode to drugs_list.
  • target_column: this argument needs to be specified when using the file input mode.
  • output_name: if the user wishes to save the file, he should specify this argument.
  • write_values: with default False, the user needs to change this argument to True if he wishes to save the output tables.
  • input_sep: if the input mode is file, the user can change this argument depending on the column separator on the input file.

Plotting

In order to visualize the data retrieved from bulk analysis, DrugTax leverages UpSetPlot, a package designed to allow the visualization of a large number of intersecting sets. This computation requires a file generated in the above Bulk Analysis sections. When writing the files, the summary table will be the one with the termination *_assess.csv, the beginning of the name depends on the users chosen output_name. This file is the one that can be fed to the plot_categories function.

drugtax.plot_categories("testing_assess.csv", output_name = "plot")

The plot_categories function has three arguments:

  • input_file: the name of the *_assess.csv previously retrieved.
  • output_name: a name for the output *.png file.
  • threshold: with default 1, this argument triggers an aggregation of low populated superclass combinations to their above counterpart. threshold is the minimum number of entries in the file for it to be aggregated.
  • element_size: with default 100, this argument defines the size of labels and titles on the plot.

Scientific Publication

If you use this work, please cite:

A.J.Preto, Paulo C. Correia & Irina S. Moreira, DrugTax: package for drug taxonomy identification and explainable feature extraction, Journal of Cheminformatics, 14(73): 2022. https://jcheminf.biomedcentral.com/articles/10.1186/s13321-022-00649-w

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

drugtax-1.0.14.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

drugtax-1.0.14-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file drugtax-1.0.14.tar.gz.

File metadata

  • Download URL: drugtax-1.0.14.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for drugtax-1.0.14.tar.gz
Algorithm Hash digest
SHA256 77ca97726098c54dd291f90e5dc506d67e3d712720b616082343727abd1af786
MD5 5733ad96cefbe3a394628a690df2d8ae
BLAKE2b-256 c2ba8b81a4d511dd4fc979f46477f64d47c4e4d70167950835e5841398f5b516

See more details on using hashes here.

File details

Details for the file drugtax-1.0.14-py3-none-any.whl.

File metadata

  • Download URL: drugtax-1.0.14-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for drugtax-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 16f524ba2252caeff4bb7c693843676c0a9dae72ac04b95c5a9da43f195f7758
MD5 fdfd4cf7927e4b463cd993e4804bf675
BLAKE2b-256 ceeb3cb5e477429e39f044b2398aa1aca47ab255fb2bdab52d007506da16048a

See more details on using hashes here.

Supported by

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