simplified variant data into activity

parent 3ff0bb9f
Pipeline #125542 canceled with stages
......@@ -27,6 +27,7 @@ from chembl_core_model.models import MoleculeDictionary
from chembl_core_model.models import TargetDictionary
from chembl_core_model.models import Source
from chembl_core_model.models import LigandEff
from chembl_core_model.models import VariantSequences
from chembl_webservices.core.fields import monkeypatch_tastypie_field
......@@ -119,8 +120,9 @@ class ActivityResource(ChemblModelResource):
ligand_efficiency = fields.ForeignKey('chembl_webservices.resources.activities.LigandEfficiencyResource',
'ligandeff', full=True, null=True, blank=True)
activity_properties = fields.ToManyField('chembl_webservices.resources.activities.ActivityPropertiesResource', 'activityproperties_set', full=True, null=True, blank=True)
variant_sequence = fields.ForeignKey('chembl_webservices.resources.variant_sequences.VariantSequenceResource',
'assay__variant', full=True, null=True, blank=True)
assay_variant_accession = fields.CharField('assay__variant__accession', null=True, blank=True)
assay_variant_mutation = fields.CharField('assay__variant__mutation', null=True, blank=True)
class Meta(ChemblResourceMeta):
queryset = Activities.objects.all()
......@@ -147,7 +149,7 @@ class ActivityResource(ChemblModelResource):
Prefetch('data_validity_comment',
queryset=DataValidityLookup.objects.only('description', 'data_validity_comment')),
Prefetch('activityproperties_set'),
Prefetch('assay__variant'),
Prefetch('assay__variant', queryset=VariantSequences.objects.only('accession', 'mutation')),
]
fields = (
'activity_comment',
......@@ -187,7 +189,8 @@ class ActivityResource(ChemblModelResource):
'uo_units',
'upper_value',
'value',
'variant_sequence',
'assay_variant_accession',
'assay_variant_mutation',
)
filtering = {
'activity_properties': ALL_WITH_RELATIONS,
......@@ -228,7 +231,8 @@ class ActivityResource(ChemblModelResource):
'upper_value': NUMBER_FILTERS,
'value': NUMBER_FILTERS,
'ligand_efficiency': ALL_WITH_RELATIONS,
'variant_sequence': ALL_WITH_RELATIONS
'assay_variant_accession': CHAR_FILTERS,
'assay_variant_mutation': CHAR_FILTERS
}
ordering = [field for field in list(filtering.keys()) if not ('comment' in field or 'description' in field or
'canonical_smiles' in field)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment