genui.generators.extensions.genuidrugex package

Subpackages

Submodules

genui.generators.extensions.genuidrugex.admin module

genui.generators.extensions.genuidrugex.apps module

class genui.generators.extensions.genuidrugex.apps.GenuidrugexConfig(app_name, app_module)[source]

Bases: AppConfig

name = 'genui.generators.extensions.genuidrugex'

genui.generators.extensions.genuidrugex.genuisetup module

genuisetup

Created by: Martin Sicho On: 5/3/20, 6:36 PM

genui.generators.extensions.genuidrugex.genuisetup.setup(*args, **kwargs)[source]

genui.generators.extensions.genuidrugex.models module

class genui.generators.extensions.genuidrugex.models.ClippedScore(id, polymorphic_ctype, name, description, created, updated, project, scoremodifier_ptr, upper, lower, high, low, smooth)[source]

Bases: ScoreModifier

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

getInstance()[source]
high

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

low

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lower

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
scoremodifier_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

scoremodifier_ptr_id
smooth

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

static test(inputs, **kwargs)[source]
upper

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class genui.generators.extensions.genuidrugex.models.DrugEx(id, polymorphic_ctype, name, description, created, updated, project, generator_ptr, agent, molset, inputFile)[source]

Bases: Generator

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

agent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

agent_id
generator_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

generator_ptr_id
get(n_samples)[source]

All generators should override this. This should return a list of SMILES strings of size N.

Returns

list of SMILES strings

inputFile

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
molset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

molset_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
tasks

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

class genui.generators.extensions.genuidrugex.models.DrugExAgent(id, polymorphic_ctype, name, description, created, updated, project, builder, model_ptr, environment, explorationNet, exploitationNet)[source]

Bases: Model

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

environment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

environment_id
exploitationNet

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

exploitationNet_id
explorationNet

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

explorationNet_id
getDataSetFromMolset(molset, data_file, rewrite=True, n_proc=4)[source]
getGenerator()[source]
model_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

model_ptr_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
tasks

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

class genui.generators.extensions.genuidrugex.models.DrugExAgentTraining(id, polymorphic_ctype, algorithm, mode, modelInstance, trainingstrategy_ptr, explorer)[source]

Bases: TrainingStrategy

exception DoesNotExist

Bases: DoesNotExist

class ExplorerClass(value)[source]

Bases: TextChoices

An enumeration.

graph = 'GE'
smiles = 'SE'
smiles_molecules = 'SM'
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

explorer

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

getExplorerInstance(agent, env, mutate, epsilon, beta, batch_size=32)[source]
get_explorer_display(*, field=<django.db.models.fields.CharField: explorer>)
property modelClass
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
trainingstrategy_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

trainingstrategy_ptr_id
class genui.generators.extensions.genuidrugex.models.DrugExAgentValidation(id, polymorphic_ctype, modelInstance, validationstrategy_ptr, validSetSize)[source]

Bases: ValidationStrategy

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
validSetSize

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

validationstrategy_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

validationstrategy_ptr_id
class genui.generators.extensions.genuidrugex.models.DrugExEnvironment(id, polymorphic_ctype, name, description, created, updated, project, rewardScheme)[source]

Bases: DataSet

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

class RewardScheme(value)[source]

Bases: TextChoices

An enumeration.

paretoCrowding = 'PC'
paretoSimilarity = 'PS'
weightedSum = 'WS'
created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

drugexEnviron

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

getInstance(use_modifiers=True)[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)
get_rewardScheme_display(*, field=<django.db.models.fields.CharField: rewardScheme>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
rewardScheme

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

scorers

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

scores

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class genui.generators.extensions.genuidrugex.models.DrugExEnvironmentScores(id, polymorphic_ctype, name, description, created, updated, project, molecules, activityset_ptr, environment, modifiersOn)[source]

Bases: ActivitySet

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

activityset_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

activityset_ptr_id
environment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

environment_id
modifiersOn

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
tasks

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

class genui.generators.extensions.genuidrugex.models.DrugExNet(id, polymorphic_ctype, name, description, created, updated, project, builder, model_ptr, molset, parent)[source]

Bases: Model

CORPUS_FILE_TRAIN_NOTE = 'drugex_corpus_train'
CORPUS_FILE_VALID_NOTE = 'drugex_corpus_test'
exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

VOC_FILE_NOTE = 'drugex_voc'
property corpusFileTest
property corpusFileTrain
property corpusTest
property corpusTrain
createCorpusFile(note, name)[source]
drugexExploit

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

drugexExplore

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

drugexnet_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

getCorpus(_file)[source]
getDataSetFromMolset(molset, data_file, rewrite=True, n_proc=4)[source]
getDefaultVoc()[source]
getModel()[source]
model_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

model_ptr_id
molset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

molset_id
parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
prepareData(vocabulary=None, n_proc=4, chunk_size=1000)[source]
static standardize(smiles, n_proc=4)[source]
tasks

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

property vocFile
class genui.generators.extensions.genuidrugex.models.DrugExNetTraining(id, polymorphic_ctype, algorithm, mode, modelInstance, trainingstrategy_ptr, modelClass, inputType)[source]

Bases: TrainingStrategy

exception DoesNotExist

Bases: DoesNotExist

class ModelClass(value)[source]

Bases: TextChoices

An enumeration.

graphTrans = 'GT'
smilesRNNSingle = 'SS'
smilesTrans = 'ST'
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

class StructureInputType(value)[source]

Bases: TextChoices

An enumeration.

frags = 'FS'
molecules = 'MS'
get_inputType_display(*, field=<django.db.models.fields.CharField: inputType>)
get_modelClass_display(*, field=<django.db.models.fields.CharField: modelClass>)
inputType

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modelClass

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
processMetaData(metadata)[source]
trainingstrategy_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

trainingstrategy_ptr_id
class genui.generators.extensions.genuidrugex.models.DrugExNetValidation(id, polymorphic_ctype, modelInstance, validationstrategy_ptr, validSetSize)[source]

Bases: ValidationStrategy

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
validSetSize

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

validationstrategy_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

validationstrategy_ptr_id
class genui.generators.extensions.genuidrugex.models.DrugExScorer(id, polymorphic_ctype, name, description, created, updated, project, environment, modifier, method, threshold)[source]

Bases: DataSet

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

environment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

environment_id
getInstance(use_modifiers=True)[source]
getThreshold()[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

method

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

method_id
modifier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

modifier_id
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
threshold

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class genui.generators.extensions.genuidrugex.models.GenUIModelScorer(id, polymorphic_ctype, name, description, created, updated, project, scoringmethod_ptr, model)[source]

Bases: ScoringMethod

exception DoesNotExist

Bases: DoesNotExist

class ModelScorer(model, modifier=None)[source]

Bases: Scorer

getKey()[source]
getScores(mols, frags=None)[source]

Returns scores for the input molecules.

Args:

mols: molecules to score frags: input fragments

Returns:

scores (list): list of scores for “mols”

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

getInstance(modifier)[source]
model

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

model_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
scoringmethod_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

scoringmethod_ptr_id
class genui.generators.extensions.genuidrugex.models.ModelPerformanceDrugEx(id, polymorphic_ctype, metric, value, model, modelperformance_ptr, epoch, step, modelperfomancenn_ptr, isOnValidationSet, note)[source]

Bases: ModelPerfomanceNN

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

isOnValidationSet

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modelperfomancenn_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

modelperfomancenn_ptr_id
note

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
class genui.generators.extensions.genuidrugex.models.PropertyScorer(id, polymorphic_ctype, name, description, created, updated, project, scoringmethod_ptr, prop)[source]

Bases: ScoringMethod

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

getInstance(modifier)[source]
get_prop_display(*, field=<django.db.models.fields.CharField: prop>)
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
prop

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

scoringmethod_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

scoringmethod_ptr_id
class genui.generators.extensions.genuidrugex.models.ScoreModifier(id, polymorphic_ctype, name, description, created, updated, project)[source]

Bases: DataSet

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

clippedscore

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

drugexscorer_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

getInstance()[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
smoothhump

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

static test(inputs, **kwargs)[source]
updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class genui.generators.extensions.genuidrugex.models.ScoringMethod(id, polymorphic_ctype, name, description, created, updated, project)[source]

Bases: DataSet

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

drugexscorer_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

genuimodelscorer

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

getInstance(modifier)[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
propertyscorer

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class genui.generators.extensions.genuidrugex.models.SmoothHump(id, polymorphic_ctype, name, description, created, updated, project, scoremodifier_ptr, upper, lower, sigma)[source]

Bases: ScoreModifier

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

getInstance()[source]
lower

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
scoremodifier_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

scoremodifier_ptr_id
sigma

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

static test(inputs, **kwargs)[source]
upper

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

genui.generators.extensions.genuidrugex.serializers module

serializers

Created by: Martin Sicho On: 5/3/20, 6:43 PM

class genui.generators.extensions.genuidrugex.serializers.ClippedSerializer(*args, **kwargs)[source]

Bases: ModifierSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'upper', 'lower', 'high', 'low', 'smooth')
model

alias of ClippedScore

read_only_fields = ('id', 'created', 'updated')
class genui.generators.extensions.genuidrugex.serializers.DrugExAgentInitSerializer(*args, **kwargs)[source]

Bases: DrugExAgentSerializer

class Meta[source]

Bases: object

fields = ['id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID', 'environment', 'explorationNet', 'exploitationNet']
model

alias of DrugExAgent

read_only_fields = ['id', 'created', 'updated', 'modelFile', 'taskID']
create(validated_data, **kwargs)[source]

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class genui.generators.extensions.genuidrugex.serializers.DrugExAgentSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ['id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID', 'environment', 'explorationNet', 'exploitationNet']
model

alias of DrugExAgent

read_only_fields = ['id', 'created', 'updated', 'modelFile', 'taskID']
class genui.generators.extensions.genuidrugex.serializers.DrugExAgentTrainingStrategyInitSerializer(*args, **kwargs)[source]

Bases: TrainingStrategyInitSerializer

class Meta[source]

Bases: object

fields = ('algorithm', 'mode', 'parameters', 'explorer')
model

alias of DrugExAgentTraining

class genui.generators.extensions.genuidrugex.serializers.DrugExAgentTrainingStrategySerializer(*args, **kwargs)[source]

Bases: TrainingStrategySerializer

class Meta[source]

Bases: object

fields = ('algorithm', 'mode', 'parameters', 'explorer')
model

alias of DrugExAgentTraining

class genui.generators.extensions.genuidrugex.serializers.DrugExAgentValidationStrategyInitSerializer(*args, **kwargs)[source]

Bases: ValidationStrategyInitSerializer

class Meta[source]

Bases: object

fields = ('metrics', 'validSetSize')
model

alias of DrugExAgentValidation

class genui.generators.extensions.genuidrugex.serializers.DrugExAgentValidationStrategySerializer(*args, **kwargs)[source]

Bases: ValidationStrategySerializer

class Meta[source]

Bases: object

fields = ('metrics', 'validSetSize')
model

alias of DrugExAgentValidation

class genui.generators.extensions.genuidrugex.serializers.DrugExEnvironmentCalculationSerializer(*args, **kwargs)[source]

Bases: Serializer

class Meta[source]

Bases: object

fields = ('molsets', 'useModifiers', 'task')
read_only_fields = ('task',)
class genui.generators.extensions.genuidrugex.serializers.DrugExEnvironmentSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'rewardScheme', 'scorers')
model

alias of DrugExEnvironment

read_only_fields = ('id', 'created', 'updated', 'scorers')
class genui.generators.extensions.genuidrugex.serializers.DrugExGeneratorSerializer(*args, **kwargs)[source]

Bases: GeneratorSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'project', 'compounds', 'className', 'extraArgs', 'agent', 'molset')
model

alias of DrugEx

class genui.generators.extensions.genuidrugex.serializers.DrugExNetInitSerializer(*args, **kwargs)[source]

Bases: DrugExNetSerializer

class Meta[source]

Bases: object

fields = ['id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID', 'molset', 'parent']
model

alias of DrugExNet

read_only_fields = ['id', 'created', 'updated', 'modelFile', 'taskID']
create(validated_data, **kwargs)[source]

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class genui.generators.extensions.genuidrugex.serializers.DrugExNetSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ['id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID', 'molset', 'parent']
model

alias of DrugExNet

read_only_fields = ['id', 'created', 'updated', 'modelFile', 'taskID']
get_parent(obj)[source]
class genui.generators.extensions.genuidrugex.serializers.DrugExScorerSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'environment', 'modifier', 'method', 'threshold')
model

alias of DrugExScorer

read_only_fields = ('id', 'created', 'updated')
class genui.generators.extensions.genuidrugex.serializers.DrugExTrainingStrategyInitSerializer(*args, **kwargs)[source]

Bases: TrainingStrategyInitSerializer

class Meta[source]

Bases: object

fields = ('algorithm', 'mode', 'parameters', 'inputType', 'modelClass')
model

alias of DrugExNetTraining

class genui.generators.extensions.genuidrugex.serializers.DrugExTrainingStrategySerializer(*args, **kwargs)[source]

Bases: TrainingStrategySerializer

class Meta[source]

Bases: object

fields = ('algorithm', 'mode', 'parameters', 'inputType', 'modelClass')
model

alias of DrugExNetTraining

class genui.generators.extensions.genuidrugex.serializers.DrugExValidationStrategyInitSerializer(*args, **kwargs)[source]

Bases: ValidationStrategyInitSerializer

class Meta[source]

Bases: object

fields = ('metrics', 'validSetSize', 'validSetSize')
model

alias of DrugExNetValidation

class genui.generators.extensions.genuidrugex.serializers.DrugExValidationStrategySerializer(*args, **kwargs)[source]

Bases: ValidationStrategySerializer

class Meta[source]

Bases: object

fields = ('metrics', 'validSetSize')
model

alias of DrugExNetValidation

class genui.generators.extensions.genuidrugex.serializers.ModifierSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project')
model

alias of ScoreModifier

read_only_fields = ('id', 'created', 'updated')
class genui.generators.extensions.genuidrugex.serializers.ModifierTestSerializer(*args, **kwargs)[source]

Bases: Serializer

class Meta[source]

Bases: object

fields = ('inputs', 'params', 'results')
read_only_fields = ('results',)
class genui.generators.extensions.genuidrugex.serializers.PropertyScorerSerializer(*args, **kwargs)[source]

Bases: ScoringFunctionSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'prop')
model

alias of PropertyScorer

read_only_fields = ('id', 'created', 'updated')
class genui.generators.extensions.genuidrugex.serializers.QSARScorerSerializer(*args, **kwargs)[source]

Bases: ScoringFunctionSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'model')
model

alias of GenUIModelScorer

read_only_fields = ('id', 'created', 'updated')
class genui.generators.extensions.genuidrugex.serializers.ScoringFunctionSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project')
model

alias of ScoringMethod

read_only_fields = ('id', 'created', 'updated')
class genui.generators.extensions.genuidrugex.serializers.SmoothHumpSerializer(*args, **kwargs)[source]

Bases: ModifierSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'upper', 'lower', 'sigma')
model

alias of SmoothHump

read_only_fields = ('id', 'created', 'updated')

genui.generators.extensions.genuidrugex.tasks module

tasks

Created by: Martin Sicho On: 28-01-20, 13:52

genui.generators.extensions.genuidrugex.tests module

class genui.generators.extensions.genuidrugex.tests.DrugExFromFileTestCase(methodName='runTest')[source]

Bases: SetUpDrugExGeneratorsMixIn, APITestCase

test_create_from_files()[source]
class genui.generators.extensions.genuidrugex.tests.DrugExGeneratorInitTestCase(methodName='runTest')[source]

Bases: SetUpDrugExGeneratorsMixIn, APITestCase

test_all()[source]
class genui.generators.extensions.genuidrugex.tests.SetUpDrugExGeneratorsMixIn[source]

Bases: QSARModelInit

createDrugExAgent(url, exploit_net, explore_net, environ)[source]
createDrugExNet(create_url, initial=None)[source]
createGeneratedMolSet(generator)[source]
createGenerator(agent, molset)[source]
createModelScorer(model)[source]
createPropertyScorer(prop)[source]
createScoreModifier(url, settings)[source]
createScorer(environment, method, modifier, threshold)[source]
createTestEnvironment()[source]
getBuilder(instance: Model, builder_module)[source]
getPerformance(url)[source]
postDrugExModelFile(instance, data)[source]
class genui.generators.extensions.genuidrugex.tests.UseDefaultNetTestCase(methodName='runTest')[source]

Bases: SetUpDrugExGeneratorsMixIn, APITestCase

test_all()[source]

genui.generators.extensions.genuidrugex.torchutils module

torchutils

Created by: Martin Sicho On: 6/2/20, 9:13 AM

genui.generators.extensions.genuidrugex.torchutils.cleanup()[source]
genui.generators.extensions.genuidrugex.torchutils.dump_tensors(gpu_only=True)[source]

Prints a list of the Tensors being tracked by the garbage collector.

By user machinethink: https://forums.fast.ai/t/gpu-memory-not-being-freed-after-training-is-over/10265/7

genui.generators.extensions.genuidrugex.torchutils.pretty_size(size)[source]

Pretty prints a torch.Size object

By user machinethink: https://forums.fast.ai/t/gpu-memory-not-being-freed-after-training-is-over/10265/7

genui.generators.extensions.genuidrugex.urls module

urls

Created by: Martin Sicho On: 5/3/20, 6:51 PM

genui.generators.extensions.genuidrugex.views module

class genui.generators.extensions.genuidrugex.views.ClippedViewSet(**kwargs)[source]

Bases: ModifierViewSet

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of ClippedSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.DrugExAgentViewSet(**kwargs)[source]

Bases: ModelViewSet

basename = None
build_task = <@task: BuildDrugExModel of genui>
builder_class

alias of DrugExAgentBuilder

description = None
detail = None
get_builder_kwargs()[source]
init_serializer_class

alias of DrugExAgentInitSerializer

name = None
queryset
serializer_class

alias of DrugExAgentSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.DrugExNetViewSet(**kwargs)[source]

Bases: ModelViewSet

basename = None
build_task = <@task: BuildDrugExModel of genui>
builder_class

alias of DrugExNetBuilder

description = None
detail = None
get_builder_kwargs()[source]
init_serializer_class

alias of DrugExNetInitSerializer

name = None
queryset
serializer_class

alias of DrugExNetSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.EnvironmentViewSet(**kwargs)[source]

Bases: FilterToProjectMixIn, FilterToUserMixIn, ModelViewSet

basename = None
calculate(request, pk=None)[source]
calculation_serializer_class

alias of DrugExEnvironmentCalculationSerializer

description = None
detail = None
get_serializer_class()[source]

Return the class to use for the serializer. Defaults to using self.serializer_class.

You may want to override this if you need to provide different serializations depending on the incoming request.

(Eg. admins get full serialization, others get basic serialization)

name = None
owner_relation = 'project__owner'
queryset
serializer_class

alias of DrugExEnvironmentSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.GeneratorViewSet(**kwargs)[source]

Bases: FilterToProjectMixIn, FilterToUserMixIn, ModelViewSet

basename = None
description = None
detail = None
name = None
owner_relation = 'project__owner'
queryset
serializer_class

alias of DrugExGeneratorSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.HumpViewSet(**kwargs)[source]

Bases: ModifierViewSet

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of SmoothHumpSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.ModifierViewSet(**kwargs)[source]

Bases: FilterToProjectMixIn, FilterToUserMixIn, ModelViewSet

basename = None
description = None
detail = None
get_serializer_class()[source]

Return the class to use for the serializer. Defaults to using self.serializer_class.

You may want to override this if you need to provide different serializations depending on the incoming request.

(Eg. admins get full serialization, others get basic serialization)

name = None
owner_relation = 'project__owner'
permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
queryset
serializer_class

alias of ModifierSerializer

suffix = None
test(request)[source]
test_serializer_class

alias of ModifierTestSerializer

class genui.generators.extensions.genuidrugex.views.PropertyScorerViewSet(**kwargs)[source]

Bases: ScoringMethodViewSet

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of PropertyScorerSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.QSARScorerViewSet(**kwargs)[source]

Bases: ScoringMethodViewSet

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of QSARScorerSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.ScorerViewSet(**kwargs)[source]

Bases: FilterToProjectMixIn, FilterToUserMixIn, ModelViewSet

basename = None
description = None
detail = None
name = None
owner_relation = 'project__owner'
queryset
serializer_class

alias of DrugExScorerSerializer

suffix = None
class genui.generators.extensions.genuidrugex.views.ScoringMethodViewSet(**kwargs)[source]

Bases: FilterToProjectMixIn, FilterToUserMixIn, ModelViewSet

basename = None
description = None
detail = None
name = None
owner_relation = 'project__owner'
queryset
serializer_class

alias of ScoringFunctionSerializer

suffix = None

Module contents