Skip to content

Commit 2813d84

Browse files
committed
Do not map score sets without variants in API function
1 parent 85c25b8 commit 2813d84

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/api/routers/map.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ async def map_scoreset(urn: str) -> ScoresetMapping:
4949
msg = f"Unable to acquire resource from MaveDB: {e}"
5050
raise HTTPException(status_code=500, detail=msg) from e
5151

52+
if not records:
53+
return JSONResponse(
54+
content=ScoresetMapping(
55+
metadata=metadata,
56+
error_message="Score set contains no variants to map",
57+
).model_dump(exclude_none=True)
58+
)
59+
5260
try:
5361
alignment_result = align(metadata, True)
5462
except BlatNotFoundError as e:

0 commit comments

Comments
 (0)