Skip to content

Commit 74acf9d

Browse files
committed
Minor changes.
1 parent 4718cb3 commit 74acf9d

File tree

11 files changed

+197
-338
lines changed

11 files changed

+197
-338
lines changed

api/models/canola_nssnp.py

100755100644
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Optional
22
from api import db
3-
# from sqlalchemy.ext.declarative import declarative_base
43

54

65
# CanolaBase = declarative_base()

api/models/homologs_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class homologs(db.Model):
55
__bind_key__ = "homologs_db"
6-
__tablename__ = 'homologs'
6+
__tablename__ = "homologs"
77

88
homologs_id: db.Mapped[int] = db.mapped_column(db.Integer(), primary_key=True, autoincrement=True)
99
search_protein_name: db.Mapped[str] = db.mapped_column(db.String(45), nullable=False)

api/resources/snps.py

100755100644
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
)
2020
from api.models.canola_nssnp import (
2121
CanolaProteinReference as CanolaProteinReference,
22-
CanolaSnpsToProtein as CanolaSnpsToProtein
22+
CanolaSnpsToProtein as CanolaSnpsToProtein,
2323
)
2424
from api.models.homologs_db import homologs as HomologsDB
2525
from api.utils.bar_utils import BARUtils
@@ -557,13 +557,14 @@ def get(self, search_species="", search_gene="", target_species=""):
557557
gene_id = escape(search_gene)
558558
target_species = escape(target_species)
559559
supported = ["arabidopsis", "canola"]
560+
560561
if (search_species not in supported) or (target_species not in supported):
561562
return BARUtils.error_exit("Species not supported"), 400
562-
elif (search_species == "arabidopsis" and BARUtils.is_arabidopsis_gene_valid(gene_id)) or (search_species == "canola" and BARUtils.is_canola_gene_valid(gene_id)):
563+
elif (search_species == "arabidopsis" and BARUtils.is_arabidopsis_gene_valid(gene_id)) or (
564+
search_species == "canola" and BARUtils.is_canola_gene_valid(gene_id)
565+
):
563566
results = HomologsDB.query.filter_by(
564-
search_protein_name=gene_id,
565-
search_species_name=search_species,
566-
result_species_name=target_species
567+
search_protein_name=gene_id, search_species_name=search_species, result_species_name=target_species
567568
).all()
568569
if not results:
569570
return BARUtils.error_exit("No homologs found for the given query"), 400
@@ -575,7 +576,7 @@ def get(self, search_species="", search_gene="", target_species=""):
575576
"result_species_name": target_species,
576577
"result_protein_name": homolog.result_protein_name,
577578
"Percent_id": float(homolog.Percent_id),
578-
"e_score": float(homolog.e_score)
579+
"e_score": float(homolog.e_score),
579580
}
580581
for homolog in results
581582
]

api/utils/bar_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ def is_cannabis_gene_valid(gene):
8686
@staticmethod
8787
def is_canola_gene_valid(gene):
8888
"""This function verifies if canola gene (BnaC07g42830D) is valid
89-
:param gene:
90-
:return:
91-
"""
89+
:param gene:
90+
:return:
91+
"""
9292
if re.search(r"^Bna[AC]\d{2}g\d{5}[A-D]?$", gene, re.I):
9393
return True
9494
else:

api/utils/docking_utils.py

100755100644
File mode changed.

config/BAR_API.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SQLALCHEMY_BINDS = {
1515
'arachis': 'mysql://root:root@localhost/arachis',
1616
'brassica_rapa': 'mysql://root:root@localhost/brassica_rapa',
1717
'cannabis': 'mysql://root:root@localhost/cannabis',
18+
'canola_nssnp' : 'mysql://root:root@localhost/canola_nssnp',
1819
'dna_damage': 'mysql://root:root@localhost/dna_damage',
1920
'embryo': 'mysql://root:root@localhost/embryo',
2021
'eplant2': 'mysql://root:root@localhost/eplant2',
@@ -24,6 +25,7 @@ SQLALCHEMY_BINDS = {
2425
'eplant_tomato' : 'mysql://root:root@localhost/eplant_tomato',
2526
'fastpheno' : 'mysql://root:root@localhost/fastpheno',
2627
'germination': 'mysql://root:root@localhost/germination',
28+
'homologs_db' : 'mysql://root:root@localhost/homologs_db',
2729
'kalanchoe': 'mysql://root:root@localhost/kalanchoe',
2830
'klepikova': 'mysql://root:root@localhost/klepikova',
2931
'llama3': 'mysql://root:root@localhost/llama3',
@@ -40,8 +42,5 @@ SQLALCHEMY_BINDS = {
4042
'striga' : 'mysql://root:root@localhost/striga',
4143
'tomato_nssnp' : 'mysql://root:root@localhost/tomato_nssnp',
4244
'tomato_sequence' : 'mysql://root:root@localhost/tomato_sequence',
43-
'triphysaria' : 'mysql://root:root@localhost/triphysaria',
44-
'canola_nssnp' : 'mysql://root:root@localhost/canola_nssnp',
45-
'homologs_db' : 'mysql://root:root@localhost/homologs_db'
46-
45+
'triphysaria' : 'mysql://root:root@localhost/triphysaria'
4746
}

config/databases/canola_nssnp.sql

100755100644
Lines changed: 98 additions & 183 deletions
Large diffs are not rendered by default.

config/databases/homologs_db.sql

100755100644
Lines changed: 63 additions & 117 deletions
Large diffs are not rendered by default.

config/init.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ mysql -u $DB_USER -p$DB_PASS < ./config/databases/arabidopsis_ecotypes.sql
1414
mysql -u $DB_USER -p$DB_PASS < ./config/databases/arachis.sql
1515
mysql -u $DB_USER -p$DB_PASS < ./config/databases/brassica_rapa.sql
1616
mysql -u $DB_USER -p$DB_PASS < ./config/databases/cannabis.sql
17+
mysql -u $DB_USER -p$DB_PASS < ./config/databases/canola_nssnp.sql
1718
mysql -u $DB_USER -p$DB_PASS < ./config/databases/dna_damage.sql
1819
mysql -u $DB_USER -p$DB_PASS < ./config/databases/embryo.sql
1920
mysql -u $DB_USER -p$DB_PASS < ./config/databases/eplant2.sql
@@ -23,6 +24,7 @@ mysql -u $DB_USER -p$DB_PASS < ./config/databases/eplant_soybean.sql
2324
mysql -u $DB_USER -p$DB_PASS < ./config/databases/eplant_tomato.sql
2425
mysql -u $DB_USER -p$DB_PASS < ./config/databases/fastpheno.sql
2526
mysql -u $DB_USER -p$DB_PASS < ./config/databases/germination.sql
27+
mysql -u $DB_USER -p$DB_PASS < ./config/databases/homologs_db.sql
2628
mysql -u $DB_USER -p$DB_PASS < ./config/databases/kalanchoe.sql
2729
mysql -u $DB_USER -p$DB_PASS < ./config/databases/klepikova.sql
2830
mysql -u $DB_USER -p$DB_PASS < ./config/databases/llama3.sql
@@ -40,9 +42,6 @@ mysql -u $DB_USER -p$DB_PASS < ./config/databases/striga.sql
4042
mysql -u $DB_USER -p$DB_PASS < ./config/databases/tomato_nssnp.sql
4143
mysql -u $DB_USER -p$DB_PASS < ./config/databases/tomato_sequence.sql
4244
mysql -u $DB_USER -p$DB_PASS < ./config/databases/triphysaria.sql
43-
mysql -u $DB_USER -p$DB_PASS < ./config/databases/canola_nssnp.sql
44-
mysql -u $DB_USER -p$DB_PASS < ./config/databases/homologs_db.sql
45-
4645

4746
echo "Data are now loaded. Preparing API config"
4847
echo "Please manually edit config file!"

requirements.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
aniso8601==10.0.0
22
async-timeout==5.0.1
3-
attrs==25.1.0
3+
attrs==25.3.0
44
black==25.1.0
55
blinker==1.9.0
66
cachelib==0.9.0
77
certifi==2025.1.31
88
charset-normalizer==3.4.1
99
click==8.1.8
10-
coverage==7.6.10
10+
coverage==7.7.1
1111
Deprecated==1.2.18
12-
flake8==7.1.1
12+
flake8==7.2.0
1313
Flask==3.1.0
14-
Flask-Caching==2.3.0
15-
Flask-Cors==5.0.0
16-
Flask-Limiter==3.10.1
14+
Flask-Caching==2.3.1
15+
flask-cors==5.0.1
16+
Flask-Limiter==3.12
1717
flask-marshmallow==1.3.0
1818
flask-restx==1.3.0
1919
Flask-SQLAlchemy==3.1.1
2020
greenlet==3.1.1
2121
idna==3.10
2222
importlib_resources==6.5.2
23-
iniconfig==2.0.0
23+
iniconfig==2.1.0
2424
itsdangerous==2.2.0
25-
Jinja2==3.1.5
25+
Jinja2==3.1.6
2626
jsonschema==4.23.0
2727
jsonschema-specifications==2024.10.1
28-
limits==4.0.1
28+
limits==4.4.1
2929
markdown-it-py==3.0.0
3030
MarkupSafe==3.0.2
3131
marshmallow==3.26.1
@@ -36,24 +36,24 @@ mysqlclient==2.2.7
3636
ordered-set==4.1.0
3737
packaging==24.2
3838
pathspec==0.12.1
39-
platformdirs==4.3.6
39+
platformdirs==4.3.7
4040
pluggy==1.5.0
41-
pycodestyle==2.12.1
42-
pyflakes==3.2.0
41+
pycodestyle==2.13.0
42+
pyflakes==3.3.0
4343
Pygments==2.19.1
4444
pyrsistent==0.20.0
45-
pytest==8.3.4
45+
pytest==8.3.5
4646
python-dateutil==2.9.0.post0
47-
pytz==2025.1
47+
pytz==2025.2
4848
redis==5.2.1
4949
referencing==0.36.2
5050
requests==2.32.3
5151
rich==13.9.4
52-
rpds-py==0.22.3
53-
setuptools==75.8.0
52+
rpds-py==0.24.0
53+
setuptools==78.1.0
5454
six==1.17.0
55-
SQLAlchemy==2.0.38
56-
typing_extensions==4.12.2
55+
SQLAlchemy==2.0.40
56+
typing_extensions==4.13.0
5757
urllib3==2.3.0
5858
Werkzeug==3.1.3
5959
wheel==0.45.1

0 commit comments

Comments
 (0)