Skip to content

Commit

Permalink
Merge pull request #217 from SABS-Group-2-2021-22/docking_merge
Browse files Browse the repository at this point in the history
main merge with docking backend - approved
  • Loading branch information
SanazKaz authored Dec 11, 2023
2 parents 19f2acc + c2c6db1 commit 88fba32
Show file tree
Hide file tree
Showing 5,000 changed files with 3,899,969 additions and 2,506 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file removed .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,7 @@ scratch.py
# output files
out

src/saved_data/*
src/saved_data/*

#misc
DS_Store
23 changes: 20 additions & 3 deletions api/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import json
from src.user import User

from glob import glob

from flask import Flask, jsonify, request
from flask import Flask, jsonify, request, send_from_directory, send_file
from flask_cors import CORS

# import api.backend.backend_api as api
import api.backend as api

import os

app = Flask(__name__)

cors = CORS(
Expand Down Expand Up @@ -336,3 +336,20 @@ def sketcher_getspiderdata():
check_user(username)
session_chosen_mol = sessions[username].get_chosen_molecule()
return api.sketcher_return_spider_data(session_chosen_mol)

@app.route("/docking-<path:filename>")
def serve_pdb_file(filename):
# def serve_pdb_file(pdb_filename):
"""API call for running serve_pdb_file() function.
Pass PDB filename as query: /docking-pdb_filename.
:param pdb_filename: PDB file of docked molecule, eg. '6lu7.pdb'
:type r_group_id: String
:return: Image and stats of R Group in a json dict.
Access image bytestream with `img_html` key and stats with 'stats'
:rtype: json dict
"""
filepath = '../static/ligand_docks/' + filename
return send_file(filepath)

Loading

0 comments on commit 88fba32

Please sign in to comment.