genui.qsar package
Subpackages
- genui.qsar.extensions package
- genui.qsar.genuimodels package
- genui.qsar.migrations package
Submodules
genui.qsar.admin module
- class genui.qsar.admin.QSARModelAdmin(model, admin_site)[source]
Bases:
ModelAdmin
- inlines = [<class 'genui.qsar.admin.UnitsInline'>]
- property media
- readonly_fields = ['created', 'updated']
- class genui.qsar.admin.UnitsInline(parent_model, admin_site)[source]
Bases:
TabularInline
- property media
- model
alias of
QSARTrainingStrategy
genui.qsar.apps module
genui.qsar.genuisetup module
genuisetup
Created by: Martin Sicho On: 4/28/20, 4:57 PM
genui.qsar.models module
- class genui.qsar.models.DescriptorGroup(id, name, corePackage)[source]
Bases:
ImportableModelComponent
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- corePackage
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- mappingstrategy_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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- name
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>
- qsartrainingstrategy_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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class genui.qsar.models.ModelActivity(id, polymorphic_ctype, value, type, units, source, molecule, parent, activity_ptr)[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 aForwardOneToOneDescriptor
instance.
- activity_ptr_id
- polymorphic_primary_key_name = 'id'
- polymorphic_super_sub_accessors_replaced = False
- class genui.qsar.models.ModelActivitySet(id, polymorphic_ctype, name, description, created, updated, project, molecules, activityset_ptr, model)[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 aForwardOneToOneDescriptor
instance.
- activityset_ptr_id
- 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 aForwardManyToOneDescriptor
instance.
- model_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.qsar.models.QSARModel(id, polymorphic_ctype, name, description, created, updated, project, builder, model_ptr, molset, predictionsType, predictionsUnits)[source]
Bases:
Model
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- genuimodelscorer_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardOneToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- molset_id
- polymorphic_primary_key_name = 'id'
- polymorphic_super_sub_accessors_replaced = False
- predictions
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- predictionsType
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 aForwardManyToOneDescriptor
instance.
- predictionsType_id
- predictionsUnits
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 aForwardManyToOneDescriptor
instance.
- predictionsUnits_id
- 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.qsar.models.QSARTrainingStrategy(id, polymorphic_ctype, algorithm, mode, modelInstance, trainingstrategy_ptr, activityThreshold, activitySet, activityType)[source]
Bases:
TrainingStrategy
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- activitySet
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 aForwardManyToOneDescriptor
instance.
- activitySet_id
- activityThreshold
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- activityType
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 aForwardManyToOneDescriptor
instance.
- activityType_id
- descriptors
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardOneToOneDescriptor
instance.
- trainingstrategy_ptr_id
genui.qsar.serializers module
serializers
Created by: Martin Sicho On: 13-01-20, 11:07
- class genui.qsar.serializers.DescriptorGroupSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class genui.qsar.serializers.ModelActivitySetSerializer(*args, **kwargs)[source]
Bases:
ActivitySetSerializer
- class genui.qsar.serializers.QSARModelInitSerializer(*args, **kwargs)[source]
Bases:
QSARModelSerializer
- class Meta[source]
Bases:
object
- fields = ['id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID', 'molset', 'predictionsType', 'predictionsUnits']
- read_only_fields = ('id', 'created', 'updated', 'modelFile', 'taskID', 'predictions')
- 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.qsar.serializers.QSARModelSerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
- class Meta[source]
Bases:
object
- fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID', 'molset', 'predictions', 'predictionsType', 'predictionsUnits')
- read_only_fields = ('id', 'created', 'updated', 'modelFile', 'taskID', 'predictions')
- class genui.qsar.serializers.QSARTrainingStrategySerializer(*args, **kwargs)[source]
Bases:
TrainingStrategySerializer
genui.qsar.tasks module
tasks
Created by: Martin Sicho On: 29-11-19, 13:44
genui.qsar.tests module
- class genui.qsar.tests.ModelInitTestCase(methodName='runTest')[source]
Bases:
QSARModelInit
,APITestCase
- class genui.qsar.tests.QSARModelInit[source]
Bases:
CompoundsMixIn
genui.qsar.urls module
urls
Created by: Martin Sicho On: 02-12-19, 17:18
genui.qsar.views module
- class genui.qsar.views.DescriptorGroupsViewSet(**kwargs)[source]
Bases:
ListModelMixin
,RetrieveModelMixin
,GenericViewSet
- basename = None
- description = None
- detail = None
- name = None
- queryset
- serializer_class
alias of
DescriptorGroupSerializer
- suffix = None
- class genui.qsar.views.QSARAlgorithmViewSet(**kwargs)[source]
Bases:
AlgorithmViewSet
- basename = None
- description = None
- detail = None
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using
self.queryset
.This method should always be used rather than accessing
self.queryset
directly, asself.queryset
gets evaluated only once, and those results are cached for all subsequent requests.You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- name = None
- suffix = None
- class genui.qsar.views.QSARMetricsViewSet(**kwargs)[source]
Bases:
MetricsViewSet
- basename = None
- description = None
- detail = None
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using
self.queryset
.This method should always be used rather than accessing
self.queryset
directly, asself.queryset
gets evaluated only once, and those results are cached for all subsequent requests.You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- name = None
- suffix = None
- class genui.qsar.views.QSARModelViewSet(**kwargs)[source]
Bases:
PredictMixIn
,ModelViewSet
- basename = None
- build_task = <@task: BuildQSARModel of genui>
- builder_class
alias of
BasicQSARModelBuilder
- description = None
- detail = None
- init_serializer_class
alias of
QSARModelInitSerializer
- name = None
- predict_task = <@task: PredictWithQSARModel of genui>
- queryset
- serializer_class
alias of
QSARModelSerializer
- suffix = None