Skip to content

Commit

Permalink
tweak tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
MattWellie committed Jan 17, 2024
1 parent beeaebf commit 4932adf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions reanalysis/query_panelapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ def overwrite_new_status(gene_dict: PanelApp, new_genes: set[str]):

for gene, gene_data in gene_dict.genes.items():
if gene in new_genes:
gene_data.new = [panel_id]
else:
gene_data.new = []
gene_data.new = {panel_id}


@click.command()
Expand Down Expand Up @@ -394,6 +392,7 @@ def main(panels: str | None, out_path: str, dataset: str | None = None):
with to_path(out_path).open('w') as out_file:
out_file.write(PanelApp.model_validate(gene_dict).model_dump_json(indent=4))

# Only save here if we have a historic location in config
save_new_historic(old_data, dataset=dataset, prefix='panel_')


Expand Down
3 changes: 3 additions & 0 deletions reanalysis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,9 @@ def save_new_historic(
"""

directory = get_cohort_seq_type_conf(dataset).get('historic_results')
if directory is None:
get_logger().info('No historic data folder, no saving')
return

new_file = to_path(directory) / f'{prefix}{TODAY}.json'
with new_file.open('w') as handle:
Expand Down

0 comments on commit 4932adf

Please sign in to comment.