Skip to content

dpasin/amberNPS-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amberNPS-api

amperNPS-api is a convenient python API to make predictions lethal blood concentrations (LBC) of new psychoactive substances (NPS).

amberNPS is a streamlit application developed by Tarcisio Nascimento Correa. For further details please the publication at A QSAR-based application for the prediction of lethal blood concentration of new psychoactive substances

Installation

Install the latest version of amberNPS with pip:

pip install amberNPS

It is recommended to create a fresh environment using conda for stability and to avoid dependency issues (python 3.10+ currently supported):

conda create -n ambernps python==3.10
conda activate ambernps
pip install amberNPS

Example usage

Import the amberNPS class, instantiate it then call the predict method with the SMILES string:

>>> from amberNPS import amberNPS
>>> a = amberNPS()
>>> preds = a.predict("Brc1cc2C(=NCc3nnc(C)n3c2cc1)c4ccccc4") # bromazolam
>>> preds # LOLBC, LBC50 and HOLBC are in ng/mL
{'Drug Class': 'Benzodiazepines', 'LOLBC': 28.988149644904777,'LBC50': 151.32238377755087, 'HOLBC': 870.7153200659999}

Results are also stored as properties:

>>> a.LOLBC
28.988149644904777
>>> a.LBC50
151.32238377755087
>>> a.HOLBC
870.7153200659999
>>> a.drug_class
'Benzodiazepines'
>>> a.smiles
'Brc1cc2C(=NCc3nnc(C)n3c2cc1)c4ccccc4'

The raw predictions (log10 of concentrations above) can also be accessed.

As a list:

>>> a.lbc_preds # [pLOLBC, pLBC50, pHOLBC]
[1.0843620906924618, 0.36667941118940295, -0.3932936005597203]

Or using properties:

>>> a.pLOLBC
1.0843620906924618
>>> a.pLBC50
0.36667941118940295
>>> a.pHOLBC
0.3932936005597203

You can also render the image of the structure (this may or may not work depending on IDE):

a.structure

example structure

Documentation

The API reference is available at https://ambernps-api.readthedocs.io/en/latest/amberNPS.html#module-amberNPS.

Contributing

  • Feature ideas and bug reports are welcome on the Issue Tracker.
  • Fork the source code on GitHub, make changes and file a pull request.

License

PubChemPy is licensed under the MIT license.

About

amperNPS-api is a convenient python API to make predctions using amberNPS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages