Skip to content
Snippets Groups Projects
Commit 30e24490 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'resilience-to-failed-gencov' into 'master'

Handle corrupted worktable, and invalid gencov

See merge request !69
parents 0a3b07d0 811bc1ca
No related branches found
No related tags found
1 merge request!69Handle corrupted worktable, and invalid gencov
......@@ -64,10 +64,14 @@
<b>Test performed:</b>Omnibus
</v-col>
<v-col >
<v-card>
<v-card style="padding:16px">
Genetic covariance derived with <a href="https://www.nature.com/articles/ng.3406">the LDScore</a>
The value on the diagonal correspond to the heritability of the trait.
<div id="divCorrelationHeat" ref="divCorrelationHeat"><!-- Plotly chart will be drawn inside this DIV --></div>
<div v-if="this.gencov && 'error' in this.gencov">
<v-icon style="margin-top: -8px;" color="error">mdi-alert-octagon</v-icon>
Computation failure: <v-card-text style="white-space: pre;">{{gencov.error}}</v-card-text>
</div>
<div v-else id="divCorrelationHeat" ref="divCorrelationHeat"><!-- Plotly chart will be drawn inside this DIV --></div>
</v-card>
</v-col>
</v-row>
......@@ -615,9 +619,11 @@ methods:{
await this.$axios.$get('/projects/'+this.project.id+"/metadata").then((function (result4) {
this.metadata = result4;
}).bind(this));
}).bind(this));
}).bind(this)).catch(error => {
console.error(error.response.data.detail);
this.gencov = {'error': error.response.data.detail}
this.isready=true;
});
}
let keepFetching=true;
for (const step in result.status){
......
......@@ -7,6 +7,7 @@ from pathlib import Path
from typing import List
from starlette.responses import RedirectResponse, JSONResponse
from tables import HDF5ExtError
from jass import util
from jass.config import config
......@@ -88,7 +89,12 @@ def project_detail(project_id: str):
@app.get("/api/projects/{project_id}/gencov")
def project_gencov_view(project_id: str):
return load_project(project_id=project_id).get_project_gencov()
try:
return JSONResponse(load_project(project_id=project_id).get_project_gencov())
except ValueError as e:
raise HTTPException(status_code=500, detail=str(e))
except HDF5ExtError as e:
raise HTTPException(status_code=500, detail=str(e))
@app.get("/api/projects/{project_id}/metadata")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment