Export to Excel StarDrop script
The Export to Excel script provides a quick and easy way to transfer the contents of a data set straight…
This example code shows how to write a custom model using Python. This example can be used to make in-house or third party models available to all StarDrop users because the model will appear within the StarDrop interface.
StarDrop supports two types of custom model – continuous and category – both of which can be built using this example by following the comments in the code. This example will work without modification and installation instructions along with a copy of the code is provided below.
To install this model:
Below you can find a copy of the code in the downloadable file. Left as it is it will provide an example continuous model. however, following the comments below it can easily be changed into a categorical model instead.
from implugin import IMPlugin # this is required for all models
## Comment out the line below if this is a category model
from modeldescriptions import ContModelDescription
## Uncomment the line below if this is acategory model
# from modeldescriptions import CatModelDescription
class Plugin (IMPlugin):
def __init__(self):
## Comment out these 8 lines to make this a category model
model = ContModelDescription(‘MOD_CONT’,
0.0, # minimum possible value of prediction
1000.0, # maximum possible value of prediction
interactive = True,
header=’Cont’,
shortName = ‘name’,
longName = ‘a continuous model’,
description = ‘This is an example’)
## Uncomment these 7 lines to make this a category model
# model = CatModelDescription(‘MOD_CAT’,
# [‘low’,’medium’,’high’], # possible result categories
# interactive=True,
# header=’3Cat’,
# shortName=’3-category model’,
# longName=’a three category model’,
# description=’An example category model’)
IMPlugin.__init__(self, model)
# The predict function is where you need to add the custom code
# for calculation or to call out to other applications. The molecule
# is appsed to this function as a SMILES string
def predict(self, smiles, extra):
# implement model calculation here
## Comment out the lne below is this is a category model
return [7.2, 0.5] # [prediction, standard deviation]
## Uncomment the line below if this is a category model
# return [0.3,0.1,0.6] # probability of each category (listed above)
## For category models the “predicted category” is the one with the
## highest probability (in this case ‘high’)
The Export to Excel script provides a quick and easy way to transfer the contents of a data set straight…
This script provides a method for calculating Ligand Efficiency in StarDrop; a simple quantifiable metric for assessing whether a ligand derives…
Baell and Holloway published a set of substructure filters for removal of what they termed “Pan Assay Interference Compounds (PAINS)” from…