Skip to content

Commit

Permalink
issue #1018 - be able to load MT from ClinGenAllele registry
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Apr 10, 2024
1 parent 95153f5 commit 9fa681d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions snpdb/models/models_clingen_allele.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ def _get_raw_hgvs_and_data(self, transcript_accession, match_version=True) -> tu
return t_hgvs, ta
return None, None

@staticmethod
def filtered_genomic_alleles(genomic_alleles, genome_build: GenomeBuild):
return [ga for ga in genomic_alleles if ga.get("referenceGenome") == genome_build.name]

def get_g_hgvs(self, genome_build: GenomeBuild):
invalid_contigs = Contig.objects.none()
valid_contigs = genome_build.contigs
Expand All @@ -177,15 +173,19 @@ def get_g_hgvs(self, genome_build: GenomeBuild):

invalid_contigs = set()
unknown_contigs = set()
for ga in self.filtered_genomic_alleles(genomic_alleles, genome_build):
# Work on the contig level as AlleleRegistry only has MT for "GRCh38" (even though contigs are the same)
for ga in genomic_alleles:
for h in ga["hgvs"]:
contig = h.split(":", 1)[0]
if contig in refseq_contigs:
return h
if contig in refseq_invalid_contigs:
invalid_contigs.add(contig)
else:
unknown_contigs.add(contig)

# Only report bad ones for this genome build
if ga.get("referenceGenome") == genome_build.name:
if contig in refseq_invalid_contigs:
invalid_contigs.add(contig)
else:
unknown_contigs.add(contig)

if invalid_contigs:
ic_msg = "settings.LIFTOVER_TO_CHROMOSOMES_ONLY=True disabled liftover to non-chrom contigs"
Expand Down

0 comments on commit 9fa681d

Please sign in to comment.