semvec/pypi-packages huggingface dataset:
R2SAScore 0.1.0
Reaction and Resource-aware SAScore
License: MIT
Requires Python: >=3.6

# R2SAScore
Implementation of R2SAScore developed by Prof. Yousung Jung group at Seoul National University (contact: yousung@gmail.com).

## Contents
- [Developer](#developer)
- [OS Requirements](#os-requirements)
- [Python Dependencies](#python-dependencies)
- [Installation Guide](#installation-guide)
- [Usage](#usage)
- [Data](#data)
- [Reproduce the results](#reproduce-the-results)
- [Publication](#publication)
- [License](#license)

## Developer
Shuan Chen (shuan.micc@gmail.com)<br>

## OS Requirements
This repository has been tested on both **Linux** and **Windows** operating systems.

## Python Dependencies
* Python (version >= 3.6)
* Numpy (version >= 1.16.4)
* rdkit (version >= 2019)

## Installation Guide
### From pip
```
pip install R2SAScore
```

### From Github
```
git clone https://github.com/snu-micc/R2SAScore.git
cd R2SAScore
pip install -e .
```

## Usage
```
from R2SAScore import R2SAScorer
scorer = R2SAScorer()
smi = 'CC(OC1=CC=CC=C1C(O)=O)=O' # Aspirin
score, contribution = scorer.calculateScore(smi)
```
The expected output of `score` should be
```
0.8789047205405656
```
See `Demo.ipynb` for the examples of estimating the synthetic accessibility of 18 structurally complex molecules shown in the paper.


## Data
#### USPTO reaction dataset
The reactions of of the training reactions `train_data.csv` are downloaded from the Dropbox link available at the GitHub repo of [GLN](https://github.com/Hanjun-Dai/GLN), originally from [Figshare](https://doi.org/10.6084/m9.figshare.25046471.v1).

#### Building blocks
The zip file of eMolecules building blocks `origin_dict.csv` can be downloaded from the Dropbox link available the GitHub repo of [Retro*](https://github.com/binghong-ml/retro_star).

## Reproduce the results
### [1] Download reaction and building-block data
Downlaod the data can put them in `./data/` and rename them to `uspto.csv` and `emolecules.csv` with column titled `reactants>reagents>production` and `SMILES`.

Feel free to change the (atom-mapped) reaction data and building blocks data as long as the data is correctly formatted.
If the reaction data is not atom-mapped, we recommend to use [LocalMapper](https://github.com/snu-micc/LocalMapper/tree/main) to prepare high-quality the atom-mappings for your reactions.

### [2] Prepare the R2Scores from reaction and building-block data
Prepare the R2SAScores by
```
python scripts/prepare_R2Scores.py -r uspto -b emolecules
```

### [3] Use R2SAScocre
```
from R2SAScore import R2SAScorer
reaction_from = 'uspto'
buildingblock_from = 'emolecules'
scorer = R2SAScorer(reaction_from=reaction_from, buildingblock_from=buildingblock_from)
```
To use the R2SAScore on you own data, replace the `reaction_from` and `reaction_from`

## Publication
In review

## License
This project is covered under the **MIT Liscence**.
strawberry_persisted_queries 1.1.0
Apollo-compatible persisted queries for Strawberry
License: MIT
Requires Python: <4.0,>=3.10

# 🍓Strawberry Persisted Queries

[![PyPI](https://img.shields.io/pypi/v/strawberry_persisted_queries?logo=pypi&logoColor=white&style=for-the-badge)](https://pypi.org/project/strawberry_persisted_queries/)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/catgirlinspace?style=for-the-badge&logo=githubsponsors)](https://github.com/sponsors/catgirlinspace)

Apollo-compatible persisted queries for Strawberry. 

## Usage

Add `PersistedQueriesExtension()` to your extensions.

```python
import strawberry
from strawberry_persisted_queries import PersistedQueriesExtension

schema = strawberry.Schema(
    query=Query,
    extensions=[
        PersistedQueriesExtension(),
    ],
)
```

### Django

For Django users, a Django cache backend is available. This uses the default cache set in Django. 
```python
from strawberry_persisted_queries.django_cache import DjangoPersistedQueryCache

PersistedQueriesExtension(cache_backend=DjangoPersistedQueryCache())
```

### Safelisted Queries

`DictSafelist` can be used to require persisted queries to already be saved.
This can be used with a build tool to ensure only queries used within an app are available.

```python
from strawberry_persisted_queries.safelisting import DictSafelist

PersistedQueriesExtension(safelist=DictSafelist({
    'sha256Hash': 'query {...}',
}))
```

## Custom Cache Backends

Custom cache backends allow using another cache for persisted queries, such as memcached or a database.
Custom cache backends can inherit from `strawberry_persisted_queries.PersistedQueryCache`. 

```python
from strawberry_persisted_queries.cache import PersistedQueryCache

class MyCache(PersistedQueryCache):
    def get(self, query_hash):
        return cache.get(query_hash)

    def set(self, query_hash, value):
        cache.set(query_hash, value)

PersistedQueriesExtension(cache_backend=MyCache())
```