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

Add source code link #42

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
venv
.idea
logs
data
Classifier/models_folder/models/CLASS
Classifier/models_folder/models/PATHWAY
Classifier/models_folder/models/SUPERCLASS
Classifier/models_folder/models/*.hdf5
Classifier/models_folder/models/models.zip
Classifier/models_folder/models/models.config
5 changes: 3 additions & 2 deletions Classifier/models_folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

What we need to do is convert keras hdf5 model to tensor flow model.

1. Download Model with get_models.sh
1. Make sure you have tensorflow installed
1. Download Model with . ./get_models.sh
1. Create folder SUPERCLASS/000001
1. Create folder CLASS/000001
1. Create folder PATHWAY/000001
Expand All @@ -11,4 +12,4 @@ What we need to do is convert keras hdf5 model to tensor flow model.
1. Place model in appropriate folder also in versioned folder CLASS/000001
1. Place model in appropriate folder also in versioned folder PATHWAY/000001

Note: to get the model metadata, go to ```/model/metadata```
Note: to get the model metadata, go to ```/model/metadata```
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

![production-integration](https://github.com/mwang87/NP-Classifier/workflows/production-integration/badge.svg)

We typitcally will deploy this locally. To bring everything up
We typically will deploy this locally. To bring everything up,
you need docker and docker-compose.

```server-compose```
If you didn't do it already, you will need a network.

```shell
docker network create nginx-net
```

```shell
make server-compose
```

### Checking Model Metadata

Expand Down
25 changes: 13 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
dbc.NavItem(dbc.NavLink("Report Feedback", href="https://docs.google.com/forms/d/e/1FAIpQLSf1-sw-P0SQGokyeaOpEmLda0UPJW93qkrI8rfp7D46fHVi6g/viewform?usp=sf_link")),
dbc.NavItem(dbc.NavLink("Preprint Publication", href="https://chemrxiv.org/articles/preprint/NPClassifier_A_Deep_Neural_Network-Based_Structural_Classification_Tool_for_Natural_Products/12885494/1")),
dbc.NavItem(dbc.NavLink("API", href="https://ccms-ucsd.github.io/GNPSDocumentation/api/#structure-np-classifier")),
dbc.NavItem(dbc.NavLink("Source code", href="https://github.com/mwang87/NP-Classifier"))
],
navbar=True)
],
Expand Down Expand Up @@ -101,7 +102,7 @@ def display_page(pathname):
else:
return "CC1C(O)CC2C1C(OC1OC(COC(C)=O)C(O)C(O)C1O)OC=C2C(O)=O"

# This function will rerun at any
# This function will rerun at any
@app.callback(
[Output('classification_table', 'children'), Output('structure', 'children')],
[Input('smiles_string', 'value')],
Expand Down Expand Up @@ -162,7 +163,7 @@ def handle_smiles(smiles_string):

return [table_fig, img_obj]

# This function will rerun at any
# This function will rerun at any
@app.callback(
[Output('usage_summary', 'children')],
[Input('url', 'pathname')],
Expand Down Expand Up @@ -237,16 +238,16 @@ def classify_structure(smiles):
pathway_result = []

# Voting on Answer
pathway_result, superclass_result, class_result, isglycoside = prediction_voting.vote_classification(n_path,
n_class,
n_super,
pathway_result, superclass_result, class_result, isglycoside = prediction_voting.vote_classification(n_path,
n_class,
n_super,
pred_class,
pred_super,
path_from_class,
path_from_superclass,
isglycoside,
pred_super,
path_from_class,
path_from_superclass,
isglycoside,
ontology_dictionary)

return isglycoside, class_result, superclass_result, pathway_result, path_from_class, path_from_superclass, n_path, fp1, fp2


Expand All @@ -264,7 +265,7 @@ def _process_full_classification(smiles_string):
respond_dict["superclass_results"] = superclass_results
respond_dict["pathway_results"] = pathway_results
respond_dict["isglycoside"] = isglycoside

respond_dict["fp1"] = fp1
respond_dict["fp2"] = fp2

Expand All @@ -277,7 +278,7 @@ def _process_full_classification(smiles_string):
)
except:
pass

return respond_dict


Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ itsdangerous==1.1.0
Jinja2==2.11.2
libarchive-c==2.8
MarkupSafe==1.1.1
numpy==1.18.3
pandas==1.0.3
numpy==1.19.3
pandas==1.1.5
plotly==4.6.0
pycosat==0.6.3
pycparser==2.19
Expand All @@ -30,9 +30,9 @@ python-dateutil==2.8.1
pytz==2019.3
requests==2.22.0
retrying==1.3.3
ruamel-yaml==0.15.46
six==1.12.0
ruamel-yaml==0.17.9
six==1.15.0
tqdm==4.32.1
urllib3==1.24.2
Werkzeug==1.0.1
peewee
peewee