Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model correction #351

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 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 @@ -343,7 +341,7 @@ def main(panels: str | None, out_path: str, dataset: str | None = None):

# store the list of genes currently on the core panel
if twelve_months:
twelve_months = set(gene_dict['genes'])
twelve_months = set(gene_dict.genes)

# if participant panels were provided, add each of those to the gene data
panel_list = set()
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