-
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.
- Loading branch information
Showing
33 changed files
with
458 additions
and
165 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 3.2.12 on 2022-08-29 11:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("clinvar", "0007_alter_clinvar_details"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="clinvar", old_name="point_rating", new_name="gold_stars", | ||
), | ||
migrations.RemoveField(model_name="clinvar", name="pathogenicity_summary",), | ||
migrations.AddField( | ||
model_name="clinvar", name="origin", field=models.CharField(max_length=32, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", name="rcv", field=models.CharField(max_length=32, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="variation_id", | ||
field=models.CharField(max_length=32, null=True), | ||
), | ||
] |
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,72 @@ | ||
# Generated by Django 3.2.15 on 2022-09-08 14:30 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("clinvar", "0008_auto_20220829_1132"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField(model_name="clinvar", name="gold_stars",), | ||
migrations.RemoveField(model_name="clinvar", name="origin",), | ||
migrations.RemoveField(model_name="clinvar", name="pathogenicity",), | ||
migrations.RemoveField(model_name="clinvar", name="rcv",), | ||
migrations.RemoveField(model_name="clinvar", name="review_status",), | ||
migrations.RemoveField(model_name="clinvar", name="variation_id",), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="clinvar_version", | ||
field=models.CharField(max_length=512, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", name="set_type", field=models.CharField(max_length=32, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_clinvar_gold_stars", | ||
field=models.IntegerField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_clinvar_pathogenicity", | ||
field=django.contrib.postgres.fields.ArrayField( | ||
base_field=models.CharField(max_length=32), null=True, size=None | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_clinvar_pathogenicity_label", | ||
field=models.CharField(max_length=512, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_clinvar_review_status_label", | ||
field=models.CharField(max_length=512, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_paranoid_gold_stars", | ||
field=models.IntegerField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_paranoid_pathogenicity", | ||
field=django.contrib.postgres.fields.ArrayField( | ||
base_field=models.CharField(max_length=32), null=True, size=None | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_paranoid_pathogenicity_label", | ||
field=models.CharField(max_length=512, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="clinvar", | ||
name="summary_paranoid_review_status_label", | ||
field=models.CharField(max_length=512, null=True), | ||
), | ||
] |
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,54 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.20 on 2019-04-16 14:00 | ||
from __future__ import unicode_literals | ||
|
||
from django.conf import settings | ||
from django.db import migrations | ||
|
||
operations = [] | ||
|
||
|
||
if not settings.IS_TESTING: | ||
operations.append( | ||
migrations.RunSQL( | ||
""" | ||
DROP MATERIALIZED VIEW IF EXISTS clinvar_clinvarpathogenicgenes; | ||
CREATE MATERIALIZED VIEW clinvar_clinvarpathogenicgenes | ||
AS | ||
SELECT | ||
ROW_NUMBER() OVER () AS id, | ||
symbol, | ||
geneinfo_hgnc.ensembl_gene_id, | ||
geneinfo_refseqtohgnc.entrez_id, | ||
pathogenic_count, | ||
likely_pathogenic_count | ||
FROM ( | ||
SELECT | ||
unnest(symbols) as symbol, | ||
SUM(CASE WHEN summary_clinvar_pathogenicity @> ARRAY['pathogenic'::varchar] THEN 1 ELSE 0 END) AS pathogenic_count, | ||
SUM(CASE WHEN summary_clinvar_pathogenicity @> ARRAY['likely pathogenic'::varchar] THEN 1 ELSE 0 END) AS likely_pathogenic_count | ||
FROM clinvar_clinvar | ||
GROUP BY symbol | ||
HAVING | ||
SUM(CASE WHEN summary_clinvar_pathogenicity @> ARRAY['pathogenic'::varchar] THEN 1 ELSE 0 END) > 0 OR | ||
SUM(CASE WHEN summary_clinvar_pathogenicity @> ARRAY['likely pathogenic'::varchar] THEN 1 ELSE 0 END) > 0 | ||
) AS clinvar_pathogenic_counts | ||
LEFT OUTER JOIN geneinfo_hgnc USING (symbol) | ||
LEFT OUTER JOIN geneinfo_refseqtohgnc USING (hgnc_id) | ||
WITH DATA; | ||
""", | ||
""" | ||
DROP MATERIALIZED VIEW clinvar_clinvarpathogenicgenes; | ||
""", | ||
) | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("clinvar", "0009_auto_20220908_1430"), | ||
("geneinfo", "0005_auto_20190104_1554"), | ||
("geneinfo", "0007_refseqtohgnc"), | ||
] | ||
operations = operations |
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
Empty file.
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,27 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
PATHO_MAP = { | ||
"benign": -2, | ||
"likely benign": -1, | ||
"uncertain significance": 0, | ||
"likely pathogenic": 1, | ||
"pathogenic": 2, | ||
} | ||
|
||
|
||
@register.filter | ||
def clinvar_patho_rank(entry): | ||
if entry.summary_pathogenicity_label: | ||
return PATHO_MAP.get(entry.summary_pathogenicity_label, -1) + 1 | ||
else: | ||
return 0 | ||
|
||
|
||
@register.filter | ||
def clinvar_gold_stars(entry): | ||
if entry.summary_gold_stars: | ||
return entry.summary_gold_stars + 1 | ||
else: | ||
return 0 |
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.