@@ -40,8 +40,9 @@ covers CPU wheels, the optional CUDA package and Docker images. The |
40 | 40 |
|
41 | 41 | ## Quick start |
42 | 42 |
|
43 | | -Each example finds benzene in phenol, then computes their MCS. Run the commands |
44 | | -from the repository root. |
| 43 | +Each example finds benzene in phenol, then computes the MCS of |
| 44 | +N-methylacetamide and propanamide. Neither contains the other; they share the |
| 45 | +four atoms of C–C(=O)–N. Run the commands from the repository root. |
45 | 46 |
|
46 | 47 | ### C++ |
47 | 48 |
|
@@ -52,12 +53,14 @@ Save this as `example.cpp`: |
52 | 53 | #include <iostream> |
53 | 54 |
|
54 | 55 | int main() { |
55 | | - const auto query = smsd::parseSMILES("c1ccccc1"); // benzene |
56 | | - const auto target = smsd::parseSMILES("c1ccc(O)cc1"); // phenol |
57 | | - const bool embedded = !smsd::Substructure::find(query).match(target).matches.empty(); |
| 56 | + const auto benzene = smsd::parseSMILES("c1ccccc1"); |
| 57 | + const auto phenol = smsd::parseSMILES("c1ccc(O)cc1"); |
| 58 | + const bool embedded = !smsd::Substructure::find(benzene).match(phenol).matches.empty(); |
| 59 | + const auto query = smsd::parseSMILES("CC(=O)NC"); // N-methylacetamide |
| 60 | + const auto target = smsd::parseSMILES("CCC(=O)N"); // propanamide |
58 | 61 | const auto result = smsd::MCS::find(query).match(target); |
59 | 62 | if (!embedded || !result.optimal || result.matches.empty() |
60 | | - || result.matches.front().atomMapping.size() != 6) { |
| 63 | + || result.matches.front().atomMapping.size() != 4) { |
61 | 64 | return 1; |
62 | 65 | } |
63 | 66 | std::cout << "MCS atoms: " << result.matches.front().atomMapping.size() << '\n'; |
@@ -88,11 +91,11 @@ needs: |
88 | 91 | <dependency> |
89 | 92 | <groupId>com.bioinceptionlabs</groupId> |
90 | 93 | <artifactId>smsd</artifactId> |
91 | | - <version>8.0.2</version> |
| 94 | + <version>8.0.3</version> |
92 | 95 | </dependency> |
93 | 96 | ``` |
94 | 97 |
|
95 | | -In Gradle, write `implementation("com.bioinceptionlabs:smsd:8.0.2")`. The |
| 98 | +In Gradle, write `implementation("com.bioinceptionlabs:smsd:8.0.3")`. The |
96 | 99 | example below also parses SMILES, which needs `org.openscience.cdk:cdk-smiles:2.13`; |
97 | 100 | the [Java module](java/README.md#installation) lists the optional additions and |
98 | 101 | the `smsd-cli` artefact. Save this as `QuickStart.java`: |
@@ -108,13 +111,15 @@ import org.openscience.cdk.smiles.SmilesParser; |
108 | 111 | public class QuickStart { |
109 | 112 | public static void main(String[] args) throws Exception { |
110 | 113 | SmilesParser parser = new SmilesParser(SilentChemObjectBuilder.getInstance()); |
111 | | - IAtomContainer query = parser.parseSmiles("c1ccccc1"); // benzene |
112 | | - IAtomContainer target = parser.parseSmiles("c1ccc(O)cc1"); // phenol |
113 | | - boolean embedded = Substructure.find(query).match(target).found(); |
| 114 | + IAtomContainer benzene = parser.parseSmiles("c1ccccc1"); |
| 115 | + IAtomContainer phenol = parser.parseSmiles("c1ccc(O)cc1"); |
| 116 | + boolean embedded = Substructure.find(benzene).match(phenol).found(); |
| 117 | + IAtomContainer query = parser.parseSmiles("CC(=O)NC"); // N-methylacetamide |
| 118 | + IAtomContainer target = parser.parseSmiles("CCC(=O)N"); // propanamide |
114 | 119 | SearchResult result = MCS.find(query).withTimeout(1000).match(target); |
115 | 120 | if (!embedded || !result.optimal() || !result.found() |
116 | | - || result.matches().get(0).atomCount() != 6) { |
117 | | - throw new IllegalStateException("Expected a proved six-atom match"); |
| 121 | + || result.matches().get(0).atomCount() != 4) { |
| 122 | + throw new IllegalStateException("Expected a proved four-atom MCS"); |
118 | 123 | } |
119 | 124 | System.out.println("MCS atoms: " + result.matches().get(0).atomCount()); |
120 | 125 | } |
@@ -125,8 +130,8 @@ Compile with Java 25 and run on Java 8 or later, here against the self-contained |
125 | 130 | JAR of the build, which includes CDK and `cdk-smiles`: |
126 | 131 |
|
127 | 132 | ```bash |
128 | | -javac --release 8 -cp java/cli/target/smsd-cli-8.0.2-jar-with-dependencies.jar QuickStart.java |
129 | | -java -cp "java/cli/target/smsd-cli-8.0.2-jar-with-dependencies.jar:." QuickStart |
| 133 | +javac --release 8 -cp java/cli/target/smsd-cli-8.0.3-jar-with-dependencies.jar QuickStart.java |
| 134 | +java -cp "java/cli/target/smsd-cli-8.0.3-jar-with-dependencies.jar:." QuickStart |
130 | 135 | ``` |
131 | 136 |
|
132 | 137 | With a Java 8 compiler, omit `--release 8`. On Windows, separate the classpath |
@@ -144,11 +149,11 @@ python -m pip install -e . |
144 | 149 | ```python |
145 | 150 | import smsd |
146 | 151 |
|
147 | | -query = "c1ccccc1" # benzene |
148 | | -target = "c1ccc(O)cc1" # phenol |
149 | | -assert smsd.Substructure.find(query).match(target).found |
| 152 | +assert smsd.Substructure.find("c1ccccc1").match("c1ccc(O)cc1").found # benzene in phenol |
| 153 | +query = "CC(=O)NC" # N-methylacetamide |
| 154 | +target = "CCC(=O)N" # propanamide |
150 | 155 | result = smsd.MCS.find(query).match(target) |
151 | | -assert result.optimal and result.best.atom_count == 6 |
| 156 | +assert result.optimal and result.best.atom_count == 4 |
152 | 157 | print("MCS atoms:", result.best.atom_count) |
153 | 158 | ``` |
154 | 159 |
|
@@ -180,7 +185,7 @@ On Linux x86_64 with an NVIDIA GPU, install `smsd-cuda` next to `smsd` of the |
180 | 185 | same version. Your code does not change: |
181 | 186 |
|
182 | 187 | ```bash |
183 | | -python -m pip install "smsd==8.0.2" "smsd-cuda==8.0.2" |
| 188 | +python -m pip install "smsd==8.0.3" "smsd-cuda==8.0.3" |
184 | 189 | ``` |
185 | 190 |
|
186 | 191 | ECFP4 screens of a prepared `TargetCorpus` then run on the GPU where that has |
@@ -190,15 +195,15 @@ corpora, other screens and all matching run on the CPU. Scores and hit order |
190 | 195 | are the same as on the CPU, and a GPU error falls back to the CPU. See |
191 | 196 | [CUDA screening](docs/PYTHON.md#optional-cuda-screening) for the details. |
192 | 197 |
|
193 | | -The [8.0.2 release](https://github.com/asad/SMSD/releases/tag/v8.0.2) also has |
| 198 | +The [8.0.3 release](https://github.com/asad/SMSD/releases/tag/v8.0.3) also has |
194 | 199 | the GPU package as a wheel and a GPU Docker image, |
195 | | -`smsd-8.0.2-cuda-linux-amd64.tar.xz`, with Python, `smsd`, `smsd-cuda` and the |
| 200 | +`smsd-8.0.3-cuda-linux-amd64.tar.xz`, with Python, `smsd`, `smsd-cuda` and the |
196 | 201 | CUDA runtime. The image needs the NVIDIA Container Toolkit, also under WSL2 on |
197 | 202 | Windows: |
198 | 203 |
|
199 | 204 | ```bash |
200 | | -docker load -i smsd-8.0.2-cuda-linux-amd64.tar.xz |
201 | | -docker run --rm --gpus all smsd:8.0.2-cuda12.8 -c "import smsd; print(smsd.gpu_device_info())" |
| 205 | +docker load -i smsd-8.0.3-cuda-linux-amd64.tar.xz |
| 206 | +docker run --rm --gpus all smsd:8.0.3-cuda12.8 -c "import smsd; print(smsd.gpu_device_info())" |
202 | 207 | ``` |
203 | 208 |
|
204 | 209 | The [installation guide](docs/HOWTO-INSTALL.md#docker) covers the CPU images |
@@ -209,7 +214,7 @@ for amd64 and arm64. |
209 | 214 | The Java build also produces the command-line tool, as a self-contained JAR: |
210 | 215 |
|
211 | 216 | ```bash |
212 | | -java -jar java/cli/target/smsd-cli-8.0.2-jar-with-dependencies.jar \ |
| 217 | +java -jar java/cli/target/smsd-cli-8.0.3-jar-with-dependencies.jar \ |
213 | 218 | --Q SMI --q "c1ccccc1" --T SMI --t "c1ccc(O)cc1" --json - |
214 | 219 | ``` |
215 | 220 |
|
@@ -235,6 +240,9 @@ and SDF files as batch targets. |
235 | 240 | Python. Batch searches can use every processor core. Optional NVIDIA CUDA |
236 | 241 | screening is provided separately by `smsd-cuda`; matching runs on the CPU. |
237 | 242 | See [CUDA screening](docs/PYTHON.md#optional-cuda-screening) for its scope. |
| 243 | + Native C++ source builds on macOS also offer [opt-in Metal fingerprint |
| 244 | + screening](docs/CPP.md#optional-metal-fingerprint-screening), with automatic |
| 245 | + selection disabled. |
238 | 246 | - **Utilities**, including R-group decomposition, MOL and SDF input, |
239 | 247 | SVG depiction (C++ and Python) and molecular standardisation (Java). |
240 | 248 |
|
|