-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjusting filters for the BindingConcatenated, etc addition
- Loading branch information
Showing
11 changed files
with
341 additions
and
144 deletions.
There are no files selected for viewing
46 changes: 7 additions & 39 deletions
46
yeastregulatorydb/regulatory_data/api/filters/BindingConcatenatedFilter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,20 @@ | ||
import django_filters | ||
from django.db.models import Q | ||
|
||
from ...models import Binding, BindingConcatenated, BindingManualQC | ||
from yeastregulatorydb.regulatory_data.models import BindingConcatenated | ||
|
||
|
||
class BindingConcatenatedFilter(django_filters.rest_framework.FilterSet): | ||
id = django_filters.NumberFilter() | ||
genomic_inserts = django_filters.NumberFilter() | ||
mito_inserts = django_filters.NumberFilter() | ||
plasmid_inserts = django_filters.NumberFilter() | ||
notes = django_filters.CharFilter(lookup_expr="iexact") | ||
|
||
# Filter fields for related bindings | ||
regulator = django_filters.NumberFilter(field_name="bindings__regulator") | ||
regulator = django_filters.NumberFilter(field_name="regulator") | ||
regulator_locus_tag = django_filters.CharFilter( | ||
field_name="bindings__regulator__genomicfeature__locus_tag", lookup_expr="iexact" | ||
field_name="regulator__genomicfeature__locus_tag", lookup_expr="iexact" | ||
) | ||
regulator_symbol = django_filters.CharFilter( | ||
field_name="bindings__regulator__genomicfeature__symbol", lookup_expr="iexact" | ||
) | ||
batch = django_filters.CharFilter(field_name="bindings__batch", lookup_expr="iexact") | ||
replicate = django_filters.NumberFilter(field_name="bindings__replicate") | ||
source = django_filters.NumberFilter(field_name="bindings__source") | ||
source_orig_id = django_filters.CharFilter(field_name="bindings__source_orig_id", lookup_expr="iexact") | ||
strain = django_filters.CharFilter(field_name="bindings__strain", lookup_expr="iexact") | ||
condition = django_filters.ChoiceFilter(field_name="bindings__condition", choices=Binding.CONDITION_CHOICES) | ||
lab = django_filters.CharFilter(field_name="bindings__source__lab", lookup_expr="iexact") | ||
assay = django_filters.CharFilter(field_name="bindings__source__assay", lookup_expr="iexact") | ||
workflow = django_filters.CharFilter(field_name="bindings__source__workflow", lookup_expr="iexact") | ||
regulator_symbol = django_filters.CharFilter(field_name="regulator__genomicfeature__symbol", lookup_expr="iexact") | ||
source = django_filters.NumberFilter(field_name="source") | ||
source_name = django_filters.CharFilter(field_name="source__name", lookup_expr="iexact") | ||
|
||
class Meta: | ||
model = BindingConcatenated | ||
fields = [ | ||
"id", | ||
"genomic_inserts", | ||
"mito_inserts", | ||
"plasmid_inserts", | ||
"notes", | ||
"regulator", | ||
"regulator_locus_tag", | ||
"regulator_symbol", | ||
"batch", | ||
"replicate", | ||
"source", | ||
"condition", | ||
"source_orig_id", | ||
"strain", | ||
"lab", | ||
"assay", | ||
"workflow", | ||
] | ||
fields = ["id", "regulator", "regulator_locus_tag", "regulator_symbol", "source", "source_name"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.