Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main branch #215

Merged
merged 41 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 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
686e6fc
Merge pull request #209 from dien-n-nguyen/dev
asherpasha Apr 25, 2024
c2ec1cd
Linting...
asherpasha Apr 25, 2024
e2b8045
Minor updates.
asherpasha Apr 26, 2024
2c4bace
Should work this time.
asherpasha Apr 26, 2024
0ac725d
Merge pull request #210 from asherpasha/dev
asherpasha Apr 26, 2024
37a3a04
Updated dependancies.
asherpasha Apr 26, 2024
114b5e4
Update GitHub Actions and Docker stuff (not tested).
asherpasha Apr 26, 2024
02e6446
Working on readthedocs.
asherpasha Apr 26, 2024
f16eb4e
Added readthedocs.yaml
asherpasha Apr 26, 2024
0590c92
Merge pull request #211 from asherpasha/dev
asherpasha Apr 26, 2024
50bacc6
Working on documentation.
asherpasha Apr 26, 2024
1a9ac7c
Don't fail on warning.
asherpasha Apr 26, 2024
a7d7db5
Merge pull request #214 from asherpasha/dev
asherpasha Apr 26, 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
2 changes: 1 addition & 1 deletion .github/workflows/bar-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8, 3.9, 3.10.13, 3.11, 3.12]
python-version: [3.8, 3.9, 3.10.14, 3.11, 3.12]

services:
redis:
Expand Down
31 changes: 31 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
1 change: 1 addition & 0 deletions api/resources/fastpheno.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Author: Vince L
Fastpheno endpoint for retrieving tree data
"""

from flask_restx import Namespace, Resource
from api import db
from api.models.fastpheno import Sites, Trees, Band, Height
Expand Down
1 change: 1 addition & 0 deletions api/resources/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Sequence endpoint that returns the amino acid sequence of a given protein, with additional options
for predicted sequences (Phyre2) that we host
"""

from flask_restx import Namespace, Resource
from api.utils.bar_utils import BARUtils
from markupsafe import escape
Expand Down
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
Loading