ilkhamfy commited on
Commit
38680a7
·
verified ·
1 Parent(s): 51b64c1

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -5
README.md CHANGED
@@ -1,10 +1,54 @@
1
  ---
2
- title: Rascore Api
3
- emoji: 📉
4
- colorFrom: green
5
- colorTo: green
6
  sdk: docker
 
7
  pinned: false
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: RAScore API
 
 
 
3
  sdk: docker
4
+ app_port: 7860
5
  pinned: false
6
+ license: mit
7
  ---
8
 
9
+ # RAScore micro-service (isolated)
10
+
11
+ A small, CORS-enabled REST service that returns the **Retrosynthetic Accessibility
12
+ score (RAScore)** for a list of SMILES. RAScore (Thakkar et al., *Chem. Sci.* 2021,
13
+ [10.1039/D0SC05401A](https://doi.org/10.1039/D0SC05401A)) is the probability that a
14
+ computer-aided synthesis-planning tool (AiZynthFinder) can find a route to the
15
+ molecule: **0 = hard / no route found, 1 = readily synthesizable**. It is a fast,
16
+ learned make-ability signal that complements the Ertl SA score.
17
+
18
+ ## Why this is a separate Space
19
+
20
+ RAScore's pretrained XGBoost model only unpickles under 2020-era pins
21
+ (Python 3.7, scikit-learn 0.22.1, xgboost 1.0.2), which are **incompatible with the
22
+ modern ADMET-AI / Chemprop stack**. Running it in its own container means it can
23
+ never destabilise the ADMET endpoint. (The `Dockerfile` installs RAScore with
24
+ `--no-deps` so it does not pull TensorFlow, which is only needed for the unused
25
+ neural-net model.)
26
+
27
+ ## API
28
+
29
+ ```
30
+ POST /score
31
+ Content-Type: application/json
32
+ { "smiles": ["CCO", "c1ccccc1", ...] } # up to 1000 per request
33
+
34
+ -> { "results": [ { "smiles": "CCO", "RAScore": 0.97 }, ... ] }
35
+ ```
36
+
37
+ `GET /health` returns `{ "status": "ok" }`.
38
+
39
+ ## Deploy
40
+
41
+ 1. Create a new Hugging Face Space, **SDK = Docker**.
42
+ 2. Add `Dockerfile` and `app.py` from this folder.
43
+ 3. Wait for the build (first build is slow; the legacy pins are finicky — if it
44
+ fails, check the logs, usually a numpy / scikit-learn ABI mismatch).
45
+ 4. The Space serves at `https://<user>-<space>.hf.space`.
46
+
47
+ Local alternative: `docker build -t rascore . && docker run -p 7860:7860 rascore`.
48
+
49
+ ## Point MolParetoLab at it
50
+
51
+ In the app, click **"Make-ability score (RAScore)"** in the sidebar and paste your
52
+ Space URL when prompted (stored in `localStorage`). The app fetches `RAScore` for
53
+ every loaded molecule and exposes it as a Pareto objective (maximize) and an axis
54
+ under "Make-ability & cost".