smartsexplore.smarts.routes module¶
Routes for retrieving SMARTS and SMARTS-SMARTS relationship data stored in the database, as well as image representations of these objects using the SMARTSViewer visual language [Schomburg2010].
-
smartsexplore.smarts.routes.attach_to_blueprint(blueprint: flask.blueprints.Blueprint)¶ Attaches all available routes to the given
flask.Blueprintobject.- Parameters
blueprint – The blueprint object to attach the commands to.
-
smartsexplore.smarts.routes.data()¶ A route for getting the graph data, which includes all SMARTS stored in the database and all edges whose
spsimproperty falls within the given range[spsim_min, spsim_max], given as POSTed JSON parameters.Returns 400 Bad Request if
spsim_minorspsim_maxare not given in the request.- Returns
Rendered JSON, as described above.
- Return type
str
-
smartsexplore.smarts.routes.deliver_smartssubset(id: int)¶ A route that delivers a static SMARTScompareViewer image, i.e. an SVG rendering of the directed comparison of two SMARTS (DirectedEdge object), with matched nodes highlighted by connecting lines, given the integer ID of that DirectedEdge object.
- Parameters
id (int) – The ID of the DirectedEdge object to retrieve the SVG image of.
- Returns
A file response if the file exists, otherwise a 404 response.
-
smartsexplore.smarts.routes.deliver_smartsview(id: int)¶ A route that delivers a static SMARTSview image, i.e., an SVG rendering of a single SMARTS object, given the integer ID of that SMARTS object.
Does not verify existence of the SMARTS object itself, but will return a 404 response if the image for the SMARTS object does not exist.
- Parameters
id (int) – The ID of the SMARTS object to retrieve the SVG image of.
- Returns
A file response if the file exists, otherwise a 404 response.