Skip to content

Commit 85c25b8

Browse files
committed
Check if score set has variants before mapping, return error if no variants
1 parent 8d55408 commit 85c25b8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/dcd_mapping/main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,20 @@ async def map_scoreset_urn(
321321
_logger.critical(msg)
322322
click.echo(f"Error: {msg}")
323323
raise e
324+
325+
if not records:
326+
_emit_info("Score set contains no variants to map", silent, logging.ERROR)
327+
final_output = write_scoreset_mapping_to_json(
328+
urn,
329+
ScoresetMapping(
330+
metadata=metadata,
331+
error_message="Score set contains no variants to map",
332+
),
333+
output_path,
334+
)
335+
_emit_info(f"Score set mapping output saved to: {final_output}.", silent)
336+
return
337+
324338
await map_scoreset(
325339
metadata, records, output_path, vrs_version, prefer_genomic, silent
326340
)

0 commit comments

Comments
 (0)