Commit dc0d5974 authored by Cyril  NERIN's avatar Cyril NERIN
Browse files

FIX #90

parent d1490469
...@@ -288,6 +288,35 @@ class ProjectLocalManhattanMethodView(MethodView): ...@@ -288,6 +288,35 @@ class ProjectLocalManhattanMethodView(MethodView):
abort(500) abort(500)
@blp_projects.route("/<project_id>/heatmap/<chromosome>/<region>")
class ProjectLocalHeatmapMethodView(MethodView):
def get(self, project_id, chromosome, region):
try:
return (
Project(id=project_id).get_project_local_heatmap_data(
chromosome, region
),
200,
{"Content-Type": "text/plain; charset=utf-8"},
)
except FileNotFoundError:
status = Project(id=project_id).status
if status == Project.DOES_NOT_EXIST:
return (
f"project {project_id} does not exist",
404,
{"Content-Type": "text/plain; charset=utf-8"},
)
elif status["worktable"] == Project.CREATING:
return (
"data not ready yet",
202,
{"Content-Type": "text/plain; charset=utf-8"},
)
else:
abort(500)
@blp_projects.route("/<project_id>/zoom_manhattan") @blp_projects.route("/<project_id>/zoom_manhattan")
class ProjectZoomManhattanMethodView(MethodView): class ProjectZoomManhattanMethodView(MethodView):
def get(self, project_id): def get(self, project_id):
......
Supports Markdown
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