Skip to content

Commit

Permalink
add more CLI logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Oct 3, 2024
1 parent 3e500e1 commit f83569c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pgscatalog.core/src/pgscatalog/core/cli/combine_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _combine(
liftover_kwargs: dict,
) -> ScoreLog:
"""This function normalises a single scoring file to a consistent structure and returns a summary log generated from the score header and variant statistics"""
logger.info(f"Processing {scorefile.pgs_id}")
logger.info(f"Started processing {scorefile.pgs_id}")
dumped_variants: Optional[list[dict]] = None
is_compatible: bool = True
try:
Expand All @@ -40,14 +40,17 @@ def _combine(
# it's important to create the list here to raise EffectTypeErrors
# for the largest scoring files this can use quite a lot of memory (~16GB)
dumped_variants = list(x.model_dump(include=fields) for x in normalised_score)
logger.info(f"Finished processing {scorefile.pgs_id}")
except EffectTypeError:
logger.warning(
f"Unsupported non-additive effect types in {scorefile=}, skipping"
)
is_compatible = False
else:
logger.info("Writing variants to file")
writer = TextFileWriter(compress=compress_output, filename=out_path)
writer.write(dumped_variants)
logger.info("Finished writing")
finally:
log: ScoreLog = ScoreLog(
header=scorefile.header,
Expand All @@ -58,6 +61,7 @@ def _combine(
logger.warning(
f"{log.variant_count_difference} fewer variants in output compared to original file"
)
logger.info("Normalisation complete, returning score log")
return log


Expand Down

0 comments on commit f83569c

Please sign in to comment.