Skip to content

Commit

Permalink
Handle GeneSymbolAliases in Internal Data export
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMadBug committed Jul 10, 2024
1 parent 5f0cc0d commit db48dbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classification/views/exports/classification_export_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
DiscordanceReport, ClinicalContext, ImportedAlleleInfo, ClinVarExport
from classification.models.classification_utils import classification_gene_symbol_filter
from flags.models import FlagsMixin, Flag, FlagComment
from genes.models import GeneSymbolAlias
from genes.signals.gene_symbol_search import GENE_SYMBOL_PATTERN
from library.utils import batch_iterator, local_date_string, http_header_date_now
from snpdb.clingen_allele import get_clingen_allele
Expand Down Expand Up @@ -215,7 +216,10 @@ def classification_export_user_string_to_q(user_input: str, genome_build: Genome
clingen_allele = get_clingen_allele(user_input)
return Q(classification__allele_info__allele__clingen_allele=clingen_allele)
elif GENE_SYMBOL_PATTERN.match(user_input):
if gene_match := classification_gene_symbol_filter(user_input):
gene_symbol = user_input
if gene_symbol_alias := GeneSymbolAlias.objects.filter(alias=user_input).first():
gene_symbol = gene_symbol_alias.gene_symbol
if gene_match := classification_gene_symbol_filter(gene_symbol):
return gene_match
if vc := VariantCoordinate.from_string(user_input, genome_build):
variant_qs = get_variant_queryset_for_latest_annotation_version(genome_build)
Expand Down

0 comments on commit db48dbf

Please sign in to comment.