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
Install the latest version of amberNPS with pip:
pip install amberNPSIt 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 amberNPSImport 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.3932936005597203You can also render the image of the structure (this may or may not work depending on IDE):
a.structureThe API reference is available at https://ambernps-api.readthedocs.io/en/latest/amberNPS.html#module-amberNPS.
- Feature ideas and bug reports are welcome on the Issue Tracker.
- Fork the source code on GitHub, make changes and file a pull request.
PubChemPy is licensed under the MIT license.
