genui.compounds package
Subpackages
- genui.compounds.exporters package
- genui.compounds.extensions package
- Subpackages
- genui.compounds.extensions.chembl package
- Subpackages
- Submodules
- genui.compounds.extensions.chembl.admin module
- genui.compounds.extensions.chembl.apps module
- genui.compounds.extensions.chembl.genuisetup module
- genui.compounds.extensions.chembl.initializers module
- genui.compounds.extensions.chembl.models module
- genui.compounds.extensions.chembl.serializers module
- genui.compounds.extensions.chembl.tests module
- genui.compounds.extensions.chembl.urls module
- genui.compounds.extensions.chembl.views module
- Module contents
- genui.compounds.extensions.csvimports package
- Subpackages
- Submodules
- genui.compounds.extensions.csvimports.admin module
- genui.compounds.extensions.csvimports.apps module
- genui.compounds.extensions.csvimports.genuisetup module
- genui.compounds.extensions.csvimports.initializer module
- genui.compounds.extensions.csvimports.models module
- genui.compounds.extensions.csvimports.parser module
- genui.compounds.extensions.csvimports.serializers module
- genui.compounds.extensions.csvimports.tests module
- genui.compounds.extensions.csvimports.urls module
- genui.compounds.extensions.csvimports.views module
- Module contents
- genui.compounds.extensions.fileimports package
- genui.compounds.extensions.generated package
- Subpackages
- Submodules
- genui.compounds.extensions.generated.admin module
- genui.compounds.extensions.generated.apps module
- genui.compounds.extensions.generated.genuisetup module
- genui.compounds.extensions.generated.initializers module
- genui.compounds.extensions.generated.models module
- genui.compounds.extensions.generated.serializers module
- genui.compounds.extensions.generated.tests module
- genui.compounds.extensions.generated.urls module
- genui.compounds.extensions.generated.views module
- Module contents
- genui.compounds.extensions.sdf package
- Subpackages
- Submodules
- genui.compounds.extensions.sdf.admin module
- genui.compounds.extensions.sdf.apps module
- genui.compounds.extensions.sdf.exporters module
- genui.compounds.extensions.sdf.genuisetup module
- genui.compounds.extensions.sdf.initializer module
- genui.compounds.extensions.sdf.models module
- genui.compounds.extensions.sdf.parser module
- genui.compounds.extensions.sdf.serializers module
- genui.compounds.extensions.sdf.tests module
- genui.compounds.extensions.sdf.urls module
- genui.compounds.extensions.sdf.views module
- Module contents
- genui.compounds.extensions.chembl package
- Module contents
- Subpackages
- genui.compounds.initializers package
- Submodules
- genui.compounds.initializers.base module
ChEMBLStandardizer
MolSetInitializer
MolSetInitializer.DuplicateChemicalEntityWarning
MolSetInitializer.addMoleculeFromSMILES()
MolSetInitializer.createChemicalEntity()
MolSetInitializer.createMolecule()
MolSetInitializer.getInstance()
MolSetInitializer.instance
MolSetInitializer.populateInstance()
MolSetInitializer.standardizeFromSMILES()
MolSetInitializer.updateInstance()
Standardizer
- genui.compounds.initializers.exceptions module
- Module contents
- genui.compounds.migrations package
- Submodules
- genui.compounds.migrations.0001_initial module
- genui.compounds.migrations.0002_auto_20200427_2039 module
- genui.compounds.migrations.0003_auto_20200512_0817 module
- genui.compounds.migrations.0004_molsetfile module
- genui.compounds.migrations.0005_extract_entity module
- genui.compounds.migrations.0006_auto_20200720_0915 module
- genui.compounds.migrations.0007_add_inchi module
- genui.compounds.migrations.0008_auto_20200723_1212 module
- genui.compounds.migrations.0009_auto_20200728_1326 module
- genui.compounds.migrations.0010_auto_20210428_1426 module
- genui.compounds.migrations.0011_alter_activity_polymorphic_ctype_and_more module
- Module contents
Submodules
genui.compounds.admin module
genui.compounds.apps module
genui.compounds.genuisetup module
genuisetup
Created by: Martin Sicho On: 4/28/20, 4:38 PM
genui.compounds.helpers module
helpers
Created by: Martin Sicho On: 02-03-20, 14:21
- genui.compounds.helpers.createPic(mol: Molecule, format: PictureFormat)[source]
genui.compounds.models module
- class genui.compounds.models.Activity(id, polymorphic_ctype, value, type, units, source, molecule, parent)[source]
Bases:
PolymorphicModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- chemblactivity
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 aReverseOneToOneDescriptor
instance.
- children
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.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- modelactivity
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 aReverseOneToOneDescriptor
instance.
- molecule
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.
- molecule_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 aForwardManyToOneDescriptor
instance.
- parent_id
- 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
- source
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.
- source_id
- type
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.
- type_id
- units
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.
- units_id
- value
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class genui.compounds.models.ActivitySet(id, polymorphic_ctype, name, description, created, updated, project, molecules)[source]
Bases:
TaskShortcutsMixIn
,TaskMixin
,DataSet
- class ActivitySetSummary(activitySet: ActivitySet)[source]
Bases:
object
- class ActivityTypeSummary(activityType: ActivityTypes, compounds: Molecule, occurences: Activity)[source]
Bases:
object
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- activities
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.
- chemblactivities
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 aReverseOneToOneDescriptor
instance.
- cleanForModelling(activity_type: ActivityTypes) tuple [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
- 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.
- drugexenvironmentscores
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 aReverseOneToOneDescriptor
instance.
- 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.
- modelactivityset
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 aReverseOneToOneDescriptor
instance.
- molecules
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.
- molecules_id
- name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <genui.utils.extensions.tasks.models.PolymorphicTaskManager object>
- 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 aForwardManyToOneDescriptor
instance.
- project_id
- qsartrainingstrategy_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.
- 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.
- 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.compounds.models.ActivityTypes(id, value)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- activity_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.
- 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>
- qsarmodel_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.
- qsartrainingstrategy_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.
- value
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class genui.compounds.models.ActivityUnits(id, value)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- activity_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.
- 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>
- qsarmodel_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.
- value
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class genui.compounds.models.ChemicalEntity(id, canonicalSMILES, inchi, inchiKey, rdMol, morganFP)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- canonicalSMILES
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property fingerprint
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inchi
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inchiKey
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- molecules
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.
- morganFP
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>
- rdMol
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class genui.compounds.models.MolSet(id, polymorphic_ctype, name, description, created, updated, project)[source]
Bases:
TaskShortcutsMixIn
,TaskMixin
,DataSet
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- activities
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.
- property allSmiles
- chemblcompounds
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 aReverseOneToOneDescriptor
instance.
- created
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- csvcompounds
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 aReverseOneToOneDescriptor
instance.
- description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- drugex_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.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- exports
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.
- files
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.
- generatedmolset
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 aReverseOneToOneDescriptor
instance.
- 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.
- maps
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.
- models
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.
- molecules
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 = <genui.utils.extensions.tasks.models.PolymorphicTaskManager object>
- 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 aForwardManyToOneDescriptor
instance.
- project_id
- sdfcompounds
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 aReverseOneToOneDescriptor
instance.
- 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.
- 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.compounds.models.MolSetExport(id, name, description, molset, exporter)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exporter
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.
- exporter_id
- files
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.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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
- 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>
- class genui.compounds.models.MolSetExporter(id, name, classPath)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- classPath
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.
- molsetexport_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.
- 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>
- class genui.compounds.models.MolSetFile(id, polymorphic_ctype, molset, file, export)[source]
Bases:
PolymorphicModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- export
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.
- export_id
- file
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)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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_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
- class genui.compounds.models.Molecule(id, polymorphic_ctype, entity)[source]
Bases:
PolymorphicModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- activities
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.
- property canonicalSMILES
- chemblmolecule
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 aReverseOneToOneDescriptor
instance.
- csvmolecule
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 aReverseOneToOneDescriptor
instance.
- entity
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.
- entity_id
- property fingerprint
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property inchi
- property inchiKey
- property mainPic
- pics
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.
- point_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.
- 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
- providers
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.
- property rdMol
- sdfmolecule
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 aReverseOneToOneDescriptor
instance.
- property smiles
A shorthand to get a nice human readable SMILES string directly from representation.
- class genui.compounds.models.MoleculePic(id, format, molecule, image)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- format
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.
- format_id
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- image
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- molecule
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.
- molecule_id
- objects = <django.db.models.manager.Manager object>
- class genui.compounds.models.PictureFormat(id, extension)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- FILE_TYPES = [('.png', 'PNG'), ('.svg', 'SVG')]
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- PNG = '.png'
- SVG = '.svg'
- extension
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_extension_display(*, field=<django.db.models.fields.CharField: extension>)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- moleculepic_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.
- objects = <django.db.models.manager.Manager object>
genui.compounds.serializers module
serializers
Created by: Martin Sicho On: 18-12-19, 10:27
- class genui.compounds.serializers.ActivitySerializer(*args, **kwargs)[source]
Bases:
GenericModelSerializerMixIn
,HyperlinkedModelSerializer
- class genui.compounds.serializers.ActivitySetSerializer(*args, **kwargs)[source]
Bases:
GenericModelSerializerMixIn
,HyperlinkedModelSerializer
- class genui.compounds.serializers.ActivitySetSummarySerializer(*args, **kwargs)[source]
Bases:
Serializer
- class genui.compounds.serializers.ActivityTypeSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class genui.compounds.serializers.ActivityUnitsSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class genui.compounds.serializers.MolSetExportSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class Meta[source]
Bases:
object
- fields = ('id', 'name', 'description', 'molset', 'files', 'exporter')
- model
alias of
MolSetExport
- read_only_fields = ('molset', 'files')
- 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.serializers.MolSetExporterSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class genui.compounds.serializers.MolSetFileSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class Meta[source]
Bases:
object
- fields = ('id', 'molset', 'file')
- model
alias of
MolSetFile
- read_only_fields = ('id',)
- 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.serializers.MolSetSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
- class genui.compounds.serializers.MolSetUpdateSerializer(*args, **kwargs)[source]
Bases:
MolSetSerializer
- class genui.compounds.serializers.MoleculePicSerializer(*args, **kwargs)[source]
Bases:
HyperlinkedModelSerializer
genui.compounds.signals module
signals
Created by: Martin Sicho On: 1/5/20, 5:40 PM
genui.compounds.tasks module
tasks
Created by: Martin Sicho On: 18-12-19, 13:14
genui.compounds.tests module
tests
Created by: Martin Sicho On: 4/28/20, 2:05 PM
- class genui.compounds.tests.CompoundsMixIn[source]
Bases:
ProjectMixIn
- class genui.compounds.tests.DuplicateEntitiesTest(methodName='runTest')[source]
Bases:
ProjectMixIn
,APITestCase
- class InitializerWithMultipleEntities(instance: MolSet, progress_recorder=None, standardizer=None)[source]
Bases:
MolSetInitializer
genui.compounds.urls module
urls
Created by: Martin Sicho On: 04-12-19, 15:01
genui.compounds.views module
- class genui.compounds.views.ActivityPagination[source]
Bases:
GenuiPagination
- page_size = 10
- class genui.compounds.views.ActivitySetViewSet(**kwargs)[source]
Bases:
FilterToProjectMixIn
,FilterToUserMixIn
,ListModelMixin
,RetrieveModelMixin
,DestroyModelMixin
,GenericViewSet
- basename = None
- description = None
- detail = None
- mols_param = {'description': 'Only return activities for the given molecule IDs.', 'in': 'query', 'items': {'type': 'integer'}, 'name': 'mols', 'type': 'array'}
- name = None
- owner_relation = 'project__owner'
- project_id_param = {'description': 'Return activity sets related to just this project.', 'in': 'query', 'name': 'project_id', 'type': 'number'}
- queryset
- serializer_class
alias of
ActivitySetSerializer
- suffix = None
- class genui.compounds.views.BaseMolSetViewSet(**kwargs)[source]
Bases:
FilterToProjectMixIn
,FilterToUserMixIn
,NestedViewSetMixin
,ModelViewSet
- class Schema(tags=None, operation_id_base=None, component_name=None)[source]
Bases:
AutoSchemaMixIn
,AutoSchema
- get_initializer_additional_arguments(validated_data)[source]
This needs to return a JSON-parsable object.
- Parameters
validated_data –
- Returns
- get_updater_additional_arguments(validated_data)[source]
This needs to return a JSON-parsable object.
- Parameters
validated_data –
- Returns
- gpu_support = False
- initializer_class = None
- owner_relation = 'project__owner'
- project_id_param = {'description': 'Return compound sets related to just the project with a given ID.', 'in': 'query', 'name': 'project_id', 'type': 'number'}
- schema
- updater_class = None
- class genui.compounds.views.MolSetExportViewSet(**kwargs)[source]
Bases:
NestedViewSetMixin
,ModelViewSet
- basename = None
- description = None
- detail = None
- model
alias of
MolSetExport
- name = None
- queryset
- serializer_class
alias of
MolSetExportSerializer
- suffix = None
- class genui.compounds.views.MolSetExporterViewSet(**kwargs)[source]
Bases:
GenericViewSet
,RetrieveModelMixin
,ListModelMixin
- basename = None
- description = None
- detail = None
- name = None
- queryset
- serializer_class
alias of
MolSetExporterSerializer
- suffix = None
- class genui.compounds.views.MolSetMoleculesView(**kwargs)[source]
Bases:
ListAPIView
- pagination_class
alias of
MoleculePagination
- queryset
- class genui.compounds.views.MolSetViewSet(**kwargs)[source]
Bases:
FilterToProjectMixIn
,FilterToUserMixIn
,RetrieveModelMixin
,ListModelMixin
,DestroyModelMixin
,GenericViewSet
- basename = None
- description = None
- detail = None
- name = None
- owner_relation = 'project__owner'
- project_id_param = {'description': 'Return compound sets related to just this project.', 'in': 'query', 'name': 'project_id', 'type': 'number'}
- queryset
- serializer_class
alias of
GenericMolSetSerializer
- suffix = None
- class genui.compounds.views.MoleculePagination[source]
Bases:
GenuiPagination
- page_size = 5
- class genui.compounds.views.MoleculeViewSet(**kwargs)[source]
Bases:
FilterToUserMixIn
,RetrieveModelMixin
,GenericViewSet
- 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)
- molset_id_param = {'description': 'Return only activities that belong to a certain activity set.', 'in': 'query', 'name': 'activity_set', 'type': 'number'}
- name = None
- owner_relation = 'providers__project__owner'
- pagination_class
alias of
MoleculePagination
- properties = {'description': 'Attach specified physchem properties to the response. You should be able to use all properties listed here: https://django-rdkit.readthedocs.io/en/latest/functions.html', 'in': 'query', 'items': {'type': 'string'}, 'name': 'properties', 'type': 'array'}
- queryset
- serializer_class
alias of
MoleculeSerializer
- suffix = None