|
1 | 1 | --- |
2 | 2 | title: RDKit-rs |
3 | 3 | geekdocNav: true |
4 | | -# geekdocAlign: center |
5 | 4 | geekdocAnchor: false |
6 | 5 | --- |
7 | 6 |
|
8 | 7 | [](https://crates.io/crates/rdkit) |
9 | | -[](https://crates.io/crates/rdkit) |
| 8 | +[](https://crates.io/crates/rdkit) |
| 9 | +[](https://crates.io/crates/cheminee) |
10 | 10 |
|
11 | | -The power and speed of [RDKit](https://www.rdkit.org/), the safety of Rust! A combination of low level C++ bindings and useful high level Rust |
12 | | -constructs so you can |
| 11 | +**Chemistry infrastructure in Rust** — from molecular parsing to full-text structure search. |
13 | 12 |
|
14 | | - * Parse mol/molblocks |
15 | | - * Normalize |
16 | | - * Fingerprint |
17 | | - * Enumerate tautomers/canonicalize |
| 13 | +The rdkit-rs organization builds safe, fast, open-source tools for cheminformatics on top of [RDKit](https://www.rdkit.org/) and the Rust ecosystem. |
18 | 14 |
|
19 | | -How does it work? |
20 | 15 | --- |
21 | 16 |
|
22 | | -The rdkit-rs project provides two key libraries: `rdkit` and `rdkit-sys`. The sys package is a collection of low or zero-cost wrappers exposing a key subset of the RDKit C++ functionality. The `rdkit` package builds on top of the sys package, hiding pointers and providing idiomatic Rust interfaces (think: `Debug` and `Clone` implementations, smart borrowing behavior). |
| 17 | +## Projects |
23 | 18 |
|
24 | | -With the `rdkit` library you will never need to manually free memory or worry about accessing null pointers. You also get all the benefits of an optimizing compiler and will never wait for garbage collection. |
| 19 | +### [rdkit-rs](/docs/rdkit-rs/) |
25 | 20 |
|
26 | | -Example |
27 | | ---- |
28 | | - |
29 | | -in your Cargo.toml: |
30 | | - |
31 | | -``` |
32 | | -[dependencies] |
33 | | -rdkit = "*" |
34 | | -``` |
35 | | - |
36 | | -If you satisfy the requirements below, the following code should just compile! |
| 21 | +Safe Rust bindings for the RDKit C++ library. Parse SMILES and molblocks, normalize molecules, compute fingerprints, enumerate tautomers, calculate descriptors — all with Rust's memory safety guarantees and zero garbage collection overhead. |
37 | 22 |
|
38 | 23 | ```rust |
39 | 24 | use rdkit::{Properties, ROMol}; |
40 | 25 |
|
41 | | -pub fn main() { |
42 | | - let mol = ROMol::from_smile("c1ccccc1C(=O)NC").unwrap(); |
43 | | - let properties = Properties::new(); |
44 | | - let computed: HashMap<String, f64> = properties.compute_properties(&mol); |
45 | | - assert_eq!(*computed.get("NumAtoms").unwrap(), 19.0); |
46 | | -} |
| 26 | +let mol = ROMol::from_smile("c1ccccc1C(=O)NC").unwrap(); |
| 27 | +let properties = Properties::new(); |
| 28 | +let computed = properties.compute_properties(&mol); |
| 29 | +assert_eq!(*computed.get("NumAtoms").unwrap(), 19.0); |
47 | 30 | ``` |
48 | 31 |
|
49 | | -Browse more [rdkit-rs/rdkit examples](https://github.com/rdkit-rs/rdkit/tree/main/examples) |
| 32 | +### [Cheminee](/docs/cheminee/) |
50 | 33 |
|
51 | | -Requirements |
52 | | ---- |
| 34 | +A chemical structure search engine built on [Tantivy](https://github.com/quickwit-oss/tantivy) and rdkit-rs. Index millions of molecules and search by substructure, superstructure, exact match, or similarity. Ships as a REST API with Swagger UI, a CLI for batch operations, and a Docker image ready to run. |
53 | 35 |
|
54 | | -We support recent stable Rust versions. The limiting factor is whatever [our C++ bindings library, cxx-rs](https://crates.io/crates/cxx), supports. Check [the cxx Cargo.toml](https://github.com/dtolnay/cxx/blob/master/Cargo.toml#L6) to confirm what `rust-version` is supported. |
| 36 | +### [Roadmap: Quickwit Integration](/docs/roadmap/) |
55 | 37 |
|
56 | | -Requires a recent version of RDKit, tested against `2022.03.1`. Supports both static and dynamic linking, preferring static linking. |
57 | | -You can use a copy of RDKit installed either from [Mac homebrew](https://homebrew.sh) or [Conda Forge](https://anaconda.org/). We are working to |
58 | | -get Debian packages updated for the most recent RDKit and also including static libraries so we can build portable RDKit applications. |
| 38 | +We're working to make Cheminee a first-class plugin inside [Quickwit](https://quickwit.io), bringing S3-backed storage, elastic compute scaling, and the full Quickwit operational model to chemical search. |
59 | 39 |
|
60 | | - * brew install rdkit |
61 | | - * conda install -c conda-forge rdkit==2022.03.1 |
| 40 | +--- |
62 | 41 |
|
63 | | -Ubuntu support is coming soon. |
| 42 | +## Get Started |
64 | 43 |
|
65 | | -You will also need a compiler for building the sys package's C++ bridge. We recommend clang for the compilation speed. |
| 44 | +Install the Rust crate: |
66 | 45 |
|
67 | | -Why Rust? |
68 | | ---- |
| 46 | +```toml |
| 47 | +[dependencies] |
| 48 | +rdkit = "0.4" |
| 49 | +``` |
69 | 50 |
|
70 | | -Rust is a powerful systems level programming language, offering a smart static typing system, an integrated build system and package manager, and strong memory safety, among many other benefits. Read more about Rust in [the free Rust Book](https://doc.rust-lang.org/book/). |
| 51 | +Or run Cheminee in Docker: |
71 | 52 |
|
72 | | -Learn More |
73 | | ---- |
| 53 | +```bash |
| 54 | +docker run --rm -p 4001:4001 ghcr.io/rdkit-rs/cheminee:latest |
| 55 | +``` |
74 | 56 |
|
75 | | -Javier Pineda, PhD., presented on Cheminee at a Scientist Show And Tell, [see the slides](/javier-show-and-tell-2023-truncated.html) |
| 57 | +Then visit [localhost:4001](http://localhost:4001) for the Swagger UI. |
76 | 58 |
|
77 | | -Issues? |
78 | 59 | --- |
79 | 60 |
|
80 | | -Please [file an issue on GitHub](https://github.com/rdkit-rs/rdkit/issues) |
| 61 | +## Links |
| 62 | + |
| 63 | +- [GitHub Organization](https://github.com/rdkit-rs) |
| 64 | +- [rdkit on crates.io](https://crates.io/crates/rdkit) |
| 65 | +- [cheminee on crates.io](https://crates.io/crates/cheminee) |
| 66 | +- [Resources & Presentations](/docs/resources/) |
0 commit comments