Skip to content

Commit

Permalink
fix(data-pipeline): update tqdm status bar upon recoverable errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed Nov 7, 2024
1 parent cf6f7ef commit be906f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions data-pipeline/src/data_pipeline/datasets/clinvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _parse_submission(submission_element, trait_mapping_list_element):
return submission


def _parse_variant(variant_element):
def _parse_variant(variant_element, tqdm_pbar=None):
variant = {}

if variant_element.find("./ClassifiedRecord") is None:
Expand All @@ -129,9 +129,8 @@ def _parse_variant(variant_element):
if chromosome == "Un":
variant["locations"] = {}
allele_element = variant_element.findall("./ClassifiedRecord/SimpleAllele")
print(
f' Skipping variant with Allele ID: {allele_element[0].attrib["AlleleID"]} due to anomalous Chromosome value of "Un"' # noqa
)
if tqdm_pbar is not None:
tqdm_pbar.set_postfix_str(f'Skipped AlleleID: {allele_element[0].attrib["AlleleID"]} (Chr: Un)')
break

variant["locations"][element.attrib["Assembly"]] = {
Expand Down

0 comments on commit be906f9

Please sign in to comment.