Skip to content

Commit

Permalink
dry out import
Browse files Browse the repository at this point in the history
  • Loading branch information
RoriCremer committed Jan 22, 2025
1 parent 0e8a5e7 commit ed7a304
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import argparse
import logging
import sys
import Bio.Seq
from Bio.Seq import reverse_complement

vat_nirvana_positions_dictionary = {
"position": "position", # required
Expand Down Expand Up @@ -239,8 +239,9 @@ def make_annotated_json_row(row_position, row_ref, row_alt, variant_line, transc
## TODO add clinvar star rating!!!
for clinvar_obj in clinvar_objs:
# get only the clinvar objs with right variant and the id that starts with RCV
if (((clinvar_obj.get("refAllele") == var_ref) and (clinvar_obj.get("altAllele") == var_alt)) or
((clinvar_obj.get("refAllele") == Bio.Seq.reverse_complement(variant_line["refAllele"])) and (clinvar_obj.get("altAllele") == Bio.Seq.reverse_complement(variant_line["altAllele"])))) and (clinvar_obj.get("id")[:3] == "RCV"):
if (((clinvar_obj.get("refAllele") == var_ref) and (clinvar_obj.get("altAllele") == var_alt)) \
or ((clinvar_obj.get("refAllele") == reverse_complement(variant_line["refAllele"])) and (clinvar_obj.get("altAllele") == reverse_complement(variant_line["altAllele"])))) \
and (clinvar_obj.get("id")[:3] == "RCV"):
clinvar_ids.append(clinvar_obj.get("id"))
significance_values.extend([x.lower() for x in clinvar_obj.get("significance")])
updated_dates.append(clinvar_obj.get("lastUpdatedDate"))
Expand Down

0 comments on commit ed7a304

Please sign in to comment.