Skip to content

Commit

Permalink
Merge pull request #39 from shiyu22/main
Browse files Browse the repository at this point in the history
Update molsearch README
  • Loading branch information
jaelgu authored May 30, 2022
2 parents bfd0ea9 + b06882c commit 7966921
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 172 deletions.
45 changes: 2 additions & 43 deletions chemical/molecular_search/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Molecular Search

This molecular search example mainly consists of two notebooks, and two python files about "how to load large molecular formula" and "start an online service".
Drug discovery, as the source of medical innovation, is an important part of new medicine research and development. Drug discovery is implemented by target selection and confirmation. In order to discover available compounds in the fragment space from billion-scale compound libraries, chemical fingerprint is usually retrieved for substructure search and similarity search.



I think everyone can learn the basic operations of Molecular Search System through the [**getting started notebook**](./1_build_molecular_search_engine.ipynb). And the [**deep dive notebook**](./2_deep_dive_molecular_search.ipynb) will show you how to deploy the service.

[**load.py**](./load.py) is used to import your large-scale data, and [**server.py**](./server.py) will start a FastAPI-based service.
This example will show you how to find the similar, sub or super molecular formula. It mainly consists of two notebooks, I think everyone can learn the basic operations of Molecular Search System through the [**getting started notebook**](./1_build_molecular_search_engine.ipynb). And the [**deep dive notebook**](./2_deep_dive_molecular_search.ipynb) will show you how to deploy the service.

## Learn from Notebook

Expand All @@ -17,42 +15,3 @@ In this notebook you will get the prerequisites, how to complete a simple molecu
- [Deep Dive](./2_deep_dive_molecular_search.ipynb)

In this notebook you will learn how to improve system stability, and finally show you how to start the FastAPI service.

## Load Large-scale Data

I think you already know from previous notebooks that a very important step in molecular search is loading the data. If you have large-scale data, you can try running with `exception_safe` in [load.py](./load.py), which make the import process safer.

> You can load your own data in this script.
```bash
$ python load.py
Collection number: 10000
```

## Deploy with FastAPI

After the data is loaded, you can start the search service for molecular search, and also support inserting data services.

```bash
$ python server.py
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```

Next you can test the service with the following command.

```bash
# search the similar molecular
$ curl -X POST "http://0.0.0.0:8000/similarity" --data "Cn1ccc(=O)nc1"

# search the superstructure molecular
$ curl -X POST "http://0.0.0.0:8000/superstructure" --data "Cn1ccc(=O)nc1"

# search the substructure molecular
$ curl -X POST "http://0.0.0.0:8000/substructure" --data "Cn1ccc(=O)nc1"

# insert a molecular
$ curl -X POST "http://0.0.0.0:8000/insert" --data "Cn1ccc(=O)nc1"

# count the collection
$ curl -X POST "http://0.0.0.0:8000/count"
```
39 changes: 0 additions & 39 deletions chemical/molecular_search/load.py

This file was deleted.

90 changes: 0 additions & 90 deletions chemical/molecular_search/server.py

This file was deleted.

0 comments on commit 7966921

Please sign in to comment.