Repository for python utilities related with DENOPTIM: the software for De Novo OPTimization of In/organic Molecules (see https://github.com/denoptim-project/DENOPTIM).
Here is an overview of the tools included here:
scoringservice
run a socket server that provides scores to DENOPTIM's SocketProvidedDescriptor. The sever allows low-latency communication between DENOPTIM and scoring functions written in python. In particular, it allows to by-pass the overhead needed to startup a python process from within DENOPTIM's fitness providers.
Example of usage:
from dnptools import scoringservice
def scoring_function(json_msg):
smiles_string = json_msg[scoringservice.JSON_KEY_SMILES]
score = ...do something to get the score from processing smiles_string...
return score
scoringservice.start(scoring_function, 'localhost', 3863)
Note that localhost
and port number 3863 are just parameters that can be choosen freely, but should be consistent with the settings of any client that wants to communicate with such server. The server is a threading server that can deal with multiple clients, like parallel threads running a fitness providing task each.
When you do not need the scoring service any more, use the following to stop the server:
scoringservice.stop('localhost',3863)
Logging can be controlled as follows:
scoringservice.logger.setLevel(logging.DEBUG)
The package is available on pypi and anaconda, so install it with
pip install dnptools
or
conda install -c denoptim-project dnptools
GNU Affero General Public License v3 or later (AGPLv3+)
The Research Council of Norway is acknowledge for funding.