-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove old filter features (#739)
- Loading branch information
Showing
46 changed files
with
63 additions
and
2,022 deletions.
There are no files selected for viewing
Git LFS file not shown
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,6 +0,0 @@ | ||
from django.contrib import admin | ||
|
||
from .models import HgmdPublicLocus | ||
|
||
# Register your models here. | ||
admin.site.register(HgmdPublicLocus) | ||
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated by Django 3.2.25 on 2024-05-15 11:35 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hgmd", "0004_auto_20190830_1126"), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name="HgmdPublicLocus", | ||
), | ||
] |
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,39 +0,0 @@ | ||
"""Models for ``HGMD`` annotation in VarFish. | ||
At the moment (and for the forseeable future), only the ``HGMD_PUBLIC`` dump | ||
from ENSEMBL can be imported. | ||
""" | ||
|
||
from django.db import models | ||
from postgres_copy import CopyManager | ||
|
||
|
||
class HgmdPublicLocus(models.Model): | ||
"""Representation of an interval on the genome that has a HGMD_PUBLIC annotation. | ||
The positions are 0-based as this comes from a BED file. | ||
""" | ||
|
||
#: The genome release, e.g., ``"GRCh37"``. | ||
release = models.CharField(max_length=32) | ||
#: The chromosomal, e.g., ``"1"``. | ||
chromosome = models.CharField(max_length=32) | ||
#: The start position, 0-based. | ||
start = models.IntegerField() | ||
#: The end position, 0-based. | ||
end = models.IntegerField() | ||
#: The UCSC bin. | ||
bin = models.IntegerField() | ||
#: The ``variation_name`` column from ENSEMBL variation table. | ||
variation_name = models.CharField(max_length=32) | ||
|
||
#: Enable bulk-import. | ||
objects = CopyManager() | ||
|
||
class Meta: | ||
indexes = [models.Index(fields=["release", "chromosome", "start", "end"])] | ||
|
||
def __str__(self): | ||
"""String representation, e.g., used in Django admin.""" | ||
values = (self.release, self.chromosome, self.start, self.end, self.variation_name) | ||
return "HgmdPublicLocus({})".format(", ".join(map(repr, values))) | ||
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,26 +0,0 @@ | ||
"""Factory Boy factory classes for ``hgmd``.""" | ||
|
||
import binning | ||
import factory | ||
|
||
from ..models import HgmdPublicLocus | ||
|
||
|
||
class HgmdPublicLocusFactory(factory.django.DjangoModelFactory): | ||
"""Factory for ``HgmdPublicLocus`` records.""" | ||
|
||
class Meta: | ||
model = HgmdPublicLocus | ||
|
||
release = "GRCh37" | ||
chromosome = factory.Iterator((list(map(str, range(1, 23))) + ["X", "Y"])) | ||
start = factory.Sequence(lambda n: (n + 1) * 100 - 1) | ||
end = factory.LazyAttribute(lambda o: o.start + 1) | ||
bin = 0 | ||
|
||
variation_name = factory.Sequence(lambda n: "CD12345%d" % n) | ||
|
||
@factory.post_generation | ||
def fix_bins(obj, *args, **kwargs): | ||
obj.bin = binning.assign_bin(obj.start - 1, obj.end) | ||
obj.save() | ||
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
28 changes: 28 additions & 0 deletions
28
variants/migrations/0104_remove_hgmd_dbsnp_filter_from_query_settings.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 3.2.25 on 2024-05-15 12:50 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def clear_query_settings(apps, schema_editor): | ||
SmallVariantQuery = apps.get_model("variants", "SmallVariantQuery") | ||
for s in SmallVariantQuery.objects.all(): | ||
save = False | ||
if "remove_if_in_dbsnp" in s.query_settings: | ||
del s.query_settings["remove_if_in_dbsnp"] | ||
save = True | ||
if "require_in_hgmd_public" in s.query_settings: | ||
del s.query_settings["require_in_hgmd_public"] | ||
save = True | ||
if save: | ||
s.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("variants", "0103_presetset_default_presetset"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(clear_query_settings, lambda _x, _y: None), | ||
] |
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.