Skip to main content

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

Metadata

Release files for drugtax 1.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drugtax 1.0.14
File Size Uploaded
drugtax-1.0.14.tar.gz 3.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for drugtax 1.0.14
File Interpreter ABI Platform
drugtax-1.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 3.4 MB

Release files / drugtax-1.0.14.tar.gz

Download URL drugtax-1.0.14.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
77ca97726098c54dd291f90e5dc506d67e3d712720b616082343727abd1af786
BLAKE2b-256 checksum
How to use checksums
c2ba8b81a4d511dd4fc979f46477f64d47c4e4d70167950835e5841398f5b516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / drugtax-1.0.14-py3-none-any.whl

Download URL drugtax-1.0.14-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16f524ba2252caeff4bb7c693843676c0a9dae72ac04b95c5a9da43f195f7758
BLAKE2b-256 checksum
How to use checksums
ceeb3cb5e477429e39f044b2398aa1aca47ab255fb2bdab52d007506da16048a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.0.14 This release

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page