Skip to content

Commit

Permalink
fix: preventing infinite loop in ACMG predictions (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Feb 6, 2024
1 parent ecefe37 commit 212cfaf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions backend/app/api/internal/endpoints/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def acmg(request: Request):
client = httpx_client_wrapper()
backend_req = client.build_request(method="GET", url=url)
backend_resp = await client.send(backend_req)
if backend_resp.status_code != 200:
if backend_resp.is_error:
return Response(status_code=backend_resp.status_code, content=backend_resp.content)

try:
Expand Down Expand Up @@ -178,9 +178,10 @@ async def cnv_acmg(request: Request):
data={"chromosome": chromosome, "start": start, "end": end, "func": func, "error": 0},
)
backend_resp = await client.send(backend_req)
if backend_resp.status_code != 200:
if backend_resp.is_error:
return Response(status_code=backend_resp.status_code, content=backend_resp.content)
return JSONResponse(backend_resp.json())
else:
return JSONResponse(backend_resp.json())


@router.get("/pubtator3-api/{path:path}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const fontColor = computed(() => {

/** Re-compute ACMG rating from InterVar when the sequence variant changed. */
watch(
() => [props.seqvar, acmgRatingStore.storeState],
() => [props.seqvar],
async () => {
if (props.seqvar?.genomeBuild === 'grch37') {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const calculateAcmgScore = computed((): number => {

/** Fetch ACMG rating of SV from server when it changed. */
watch(
() => [props.strucvar, acmgRatingStore.storeState],
() => [props.strucvar],
async () => {
if (props.strucvar) {
await acmgRatingStore.fetchAcmgRating(props.strucvar)
Expand Down

0 comments on commit 212cfaf

Please sign in to comment.