Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ce04355
original docking_utils.py file
Oct 26, 2023
ffe6b47
Add constant for hex execution path
Oct 26, 2023
470fd96
redirect hex output to a text file, add function to parse hex output
Nov 2, 2023
ed5a58e
Add classes for refactoring of docking_utils.py file
dien-n-nguyen Nov 21, 2023
be00a1a
Add methods for each class
dien-n-nguyen Jan 17, 2024
9001a04
Fix styling issues and add more documentation
dien-n-nguyen Jan 18, 2024
b927131
Merge branch 'dev' of https://github.com/BioAnalyticResource/BAR_API …
dien-n-nguyen Jan 18, 2024
4195dc1
change paths to match the BAR's file structure
dien-n-nguyen Feb 1, 2024
6756ff4
add code for mapping sdf names to number
dien-n-nguyen Feb 1, 2024
740cce9
Replace docking_utils.py and remove old version
dien-n-nguyen Feb 2, 2024
d9bf054
convert sdf_mapping to OOP and move to docking_utils.py file
dien-n-nguyen Feb 8, 2024
4c208ce
Fix bug to prevent creating results folder for invalid protein or ligand
dien-n-nguyen Feb 16, 2024
39b13eb
Add regex check to process bigger receptor
Feb 20, 2024
a30f117
Add unittests and files for testing
Feb 20, 2024
1fdf2f6
Move test_docking_utils.py to tests/utils/ folder
Feb 27, 2024
4bec80a
Add regex matching to separate coordinates in docking results pdb
Mar 19, 2024
cc2fe32
Merge remote-tracking branch 'upstream/dev' into dev
Mar 19, 2024
a7ad94e
Add timestamp to final energies json
Mar 21, 2024
35bb983
Fix styling issues
Mar 21, 2024
be5d74a
Fix styling issues
Mar 22, 2024
203f547
Fix test for testing docking that already exists
Mar 22, 2024
0e4f104
Make changes to test file to skip in gitbuh environment
Mar 28, 2024
88b92f0
Add code to skip test in CI
Mar 28, 2024
1a20055
Fix code to skip test if not running on BAR
Mar 28, 2024
6853a15
Fix styling
Mar 28, 2024
dbd55fc
Add tests for SDFMapping
Apr 4, 2024
d7483d3
Fix tests to skip when not running on the BAR
Apr 4, 2024
bfea1ac
Add skip tags for tests and remove print statements
Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions api/resources/snps.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from api.utils.hotspot_utils import HotspotUtils
import sys
from api import db, cache, limiter
from api.utils.docking_utils import Docker


snps = Namespace("SNPs", description="Information about SNPs", path="/snps")
Expand All @@ -47,6 +48,35 @@
)


@snps.route("/docking/<receptor>/<ligand>")
class Docking(Resource):
decorators = [limiter.limit("2/minute")]

@snps.param("receptor", _in="path", default="bri1")
@snps.param("ligand", _in="path", default="brass")
def get(self, receptor, ligand):
receptor = escape(receptor)
ligand = escape(ligand)
docking_pdb_path = "/DATA/HEX_API/RESULTS/"

if not BARUtils.is_arabidopsis_gene_valid(receptor):
return BARUtils.error_exit("Invalid arapbidopsis pdb gene id"), 400

matched = re.search("[a-z]", ligand)
if matched is None:
return BARUtils.error_exit("Invalid ligand name"), 400

# start function to initiate docking_utils file

final_json = Docker.start(receptor, ligand, docking_pdb_path)
if final_json == "Receptor file not found":
return BARUtils.error_exit("There are no data found for the given gene"), 400
elif final_json == "Ligand file not found":
return BARUtils.error_exit("There are no data found for the given ligand"), 400
else:
return BARUtils.success_exit(final_json)


@snps.route("/phenix/<fixed_pdb>/<moving_pdb>")
class Phenix(Resource):
@snps.param("fixed_pdb", _in="path", default="Potri.016G107900.1")
Expand Down
Loading