Skip to content
Snippets Groups Projects
Commit 0ad77c74 authored by Cyril  NERIN's avatar Cyril NERIN
Browse files

FIX #92 FEAT #93 FEAT #94

parent 0741ece9
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ class LocalProjectParamsSchema(ma.Schema): ...@@ -40,6 +40,7 @@ class LocalProjectParamsSchema(ma.Schema):
chromosome = ma.fields.Integer() chromosome = ma.fields.Integer()
start = ma.fields.Integer() start = ma.fields.Integer()
end = ma.fields.Integer() end = ma.fields.Integer()
to_init = ma.fields.Integer()
class ProjectStatusSchema(ma.Schema): class ProjectStatusSchema(ma.Schema):
...@@ -120,6 +121,7 @@ class LocalProjectCreateMethodView(MethodView): ...@@ -120,6 +121,7 @@ class LocalProjectCreateMethodView(MethodView):
str(parameters["chromosome"]), str(parameters["chromosome"]),
str(parameters["start"]), str(parameters["start"]),
str(parameters["end"]), str(parameters["end"]),
str(parameters["to_init"]),
) )
...@@ -396,6 +398,45 @@ class ProjectZoomPlotMethodView(MethodView): ...@@ -396,6 +398,45 @@ class ProjectZoomPlotMethodView(MethodView):
abort(500) abort(500)
@blp_projects.route("/<project_id>/gene_exon")
class ProjectGeneExonMethodView(MethodView):
def get(self, project_id):
try:
return (
Project(id=project_id).get_project_gene_exon_data(),
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>/error_msg")
class ProjectErrorMsgMethodView(MethodView):
def get(self, project_id):
return Project(id=project_id).get_error_msg()
@blp_projects.route("/<project_id>/dispo_gene_exon")
class ProjectDispoGeneExonMethodView(MethodView):
def get(self, project_id):
return Project(id=project_id).get_dispo_gene_exon()
class JassApp(Flask): class JassApp(Flask):
""" """
JassApp builds the JASS Flask application JassApp builds the JASS Flask application
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment