genui.compounds.extensions.chembl package

Subpackages

Submodules

genui.compounds.extensions.chembl.admin module

class genui.compounds.extensions.chembl.admin.ChEMBLActivitiesAdmin(model, admin_site)[source]

Bases: ActivitySetAdmin

property media
class genui.compounds.extensions.chembl.admin.ChEMBLCompoundsAdmin(model, admin_site)[source]

Bases: MolSetAdmin

property media

genui.compounds.extensions.chembl.apps module

class genui.compounds.extensions.chembl.apps.ChemblConfig(app_name, app_module)[source]

Bases: AppConfig

name = 'genui.compounds.extensions.chembl'

genui.compounds.extensions.chembl.genuisetup module

genuisetup

Created by: Martin Sicho On: 4/28/20, 9:38 AM

genui.compounds.extensions.chembl.genuisetup.setup(*args, **kwargs)[source]

genui.compounds.extensions.chembl.initializers module

chembl

Created by: Martin Sicho On: 18-12-19, 14:38

class genui.compounds.extensions.chembl.initializers.ChEMBLSetInitializer(instance: ChEMBLCompounds, progress_recorder=None, targets=(), max_per_target=None)[source]

Bases: MolSetInitializer

createMolecule(entity, molecule_class, create_kwargs=None)[source]
initActivities()[source]
populateInstance()[source]
updateInstance()[source]

genui.compounds.extensions.chembl.models module

class genui.compounds.extensions.chembl.models.ChEMBLActivities(id, polymorphic_ctype, name, description, created, updated, project, molecules, activityset_ptr)[source]

Bases: ActivitySet

class ChEMBLActivitySetSummary(activitySet: ActivitySet)[source]

Bases: ActivitySetSummary

getTypeInfo()[source]
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
cleanForModelling(activity_type)[source]

A procedure that returns molecules as Molecule instances and their activities to be used by QSAR and other models. This is a very basic implementation and should be overridden in children.

Returns

Tuple of list objects (same length) -> Molecule instances and their associated activity values for models

getSummary()[source]
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.compounds.extensions.chembl.models.ChEMBLActivity(id, polymorphic_ctype, value, type, units, source, molecule, parent, activity_ptr, relation, assay, target, comment)[source]

Bases: Activity

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

activity_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.

activity_ptr_id
assay

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.

assay_id
comment

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
relation

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

target

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.

target_id
class genui.compounds.extensions.chembl.models.ChEMBLAssay(id, assayID)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

assayID

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

chemblactivity_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.

id

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

objects = <django.db.models.manager.Manager object>
class genui.compounds.extensions.chembl.models.ChEMBLCompounds(id, polymorphic_ctype, name, description, created, updated, project, molset_ptr)[source]

Bases: MolSet

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

molset_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.

molset_ptr_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
targets

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

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.compounds.extensions.chembl.models.ChEMBLMolecule(id, polymorphic_ctype, entity, molecule_ptr, chemblID)[source]

Bases: Molecule

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

chemblID

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

molecule_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.

molecule_ptr_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
class genui.compounds.extensions.chembl.models.ChEMBLTarget(id, targetID)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

chemblactivity_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.

chemblcompounds_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

id

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

objects = <django.db.models.manager.Manager object>
targetID

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

genui.compounds.extensions.chembl.serializers module

serializers

Created by: Martin Sicho On: 4/27/20, 8:47 PM

class genui.compounds.extensions.chembl.serializers.ChEMBLAssaySerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('assayID',)
model

alias of ChEMBLAssay

class genui.compounds.extensions.chembl.serializers.ChEMBLSetInitSerializer(*args, **kwargs)[source]

Bases: ChEMBLSetSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'maxPerTarget', 'taskID', 'targets', 'activities')
model

alias of ChEMBLCompounds

read_only_fields = ('created', 'updated', 'taskID', 'targets', 'activities')
create(validated_data)[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.compounds.extensions.chembl.serializers.ChEMBLSetSerializer(*args, **kwargs)[source]

Bases: MolSetSerializer

class Meta[source]

Bases: object

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

alias of ChEMBLCompounds

read_only_fields = ('created', 'updated')
class genui.compounds.extensions.chembl.serializers.ChEMBLSetUpdateSerializer(*args, **kwargs)[source]

Bases: MolSetUpdateSerializer

class Meta[source]

Bases: object

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

alias of ChEMBLCompounds

read_only_fields = ('created', 'updated', 'activities', 'files')
class genui.compounds.extensions.chembl.serializers.ChEMBLTargetSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('targetID',)
model

alias of ChEMBLTarget

genui.compounds.extensions.chembl.tests module

class genui.compounds.extensions.chembl.tests.ChEMBLMolSetTestCase(methodName='runTest')[source]

Bases: CompoundsMixIn, APITestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_activity_summary()[source]

genui.compounds.extensions.chembl.urls module

urls

Created by: Martin Sicho On: 4/27/20, 10:25 PM

genui.compounds.extensions.chembl.views module

class genui.compounds.extensions.chembl.views.ChEMBLAssayViewSet(**kwargs)[source]

Bases: RetrieveModelMixin, GenericViewSet

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

alias of ChEMBLAssaySerializer

suffix = None
class genui.compounds.extensions.chembl.views.ChEMBLSetViewSet(**kwargs)[source]

Bases: BaseMolSetViewSet

basename = None
description = None
detail = None
get_initializer_additional_arguments(validated_data)[source]

This needs to return a JSON-parsable object.

Parameters

validated_data

Returns

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)

initializer_class

alias of ChEMBLSetInitializer

name = None
queryset
serializer_class

alias of ChEMBLSetSerializer

suffix = None
class genui.compounds.extensions.chembl.views.ChEMBLTargetViewSet(**kwargs)[source]

Bases: RetrieveModelMixin, GenericViewSet

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

alias of ChEMBLTargetSerializer

suffix = None

Module contents