GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Keep the documentation to what users need and show fingerprint screening · asad/SMSD@4c535cb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • README.md
  • benchmarks
    • README.md
    • data
      • README.md
  • cpp
    • README.md
    • tests
      • test_mces_contract_regression.cpp
  • docs
    • ALGORITHMS.md
    • CPP.md
    • EXAMPLES.md
    • HOWTO-INSTALL.md
    • JAVA.md
    • PYTHON.md
    • RELEASE_NOTES.md
    • VALIDATION_8.0.0.md
  • java
    • README.md
  • python
    • README.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+50-56Lines changed: 50 additions & 56 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,15 @@ at its timeout, and maps atoms by their zero-based indices in the input molecule
2626

2727
## Installation
2828

29-
This page describes version 8.0.0. It is distributed as `smsd` on
30-
[PyPI](https://pypi.org/project/smsd/), as `com.bioinceptionlabs:smsd`
31-
(library) and `com.bioinceptionlabs:smsd-cli` (command-line tool) on
32-
[Maven Central](https://central.sonatype.com/artifact/com.bioinceptionlabs/smsd)
33-
and as release files on the
34-
[GitHub releases page](https://github.com/asad/SMSD/releases), and it can be
35-
built from this repository. The [release notes](docs/RELEASE_NOTES.md) list the
36-
release files and their platform requirements.
37-
38-
The C++ and Python builds need a C++17 compiler, and the Python package supports
39-
Python 3.9 or later. The Java build uses Maven and a JDK, with Java 25 LTS
40-
preferred. The [installation guide](docs/HOWTO-INSTALL.md) covers platform
41-
requirements, Python wheels,
42-
[Java CLI installers](docs/HOWTO-INSTALL.md#java-cli-installers), Docker and
43-
test commands.
29+
| Language | Package | Requirements |
30+
| --- | --- | --- |
31+
| Python | `smsd` on [PyPI](https://pypi.org/project/smsd/) | Python 3.9 or later (wheels for CPython 3.14); RDKit optional |
32+
| Java | `com.bioinceptionlabs:smsd` (library) and `com.bioinceptionlabs:smsd-cli` (command-line tool) on [Maven Central](https://central.sonatype.com/artifact/com.bioinceptionlabs/smsd) | Java 8 or later; CDK 2.13 |
33+
| C++ | Header-only library in `cpp/include` | A C++17 compiler |
34+
35+
Release files are on the [GitHub releases page](https://github.com/asad/SMSD/releases).
36+
The [installation guide](docs/HOWTO-INSTALL.md) covers platform requirements,
37+
downloads and source builds.
4438

4539
## Quick start
4640

@@ -159,6 +153,25 @@ print("MCS atoms:", result.best.atom_count)
159153
See the [Python package](python/README.md), the [Python guide](docs/PYTHON.md)
160154
and the [Python examples](docs/EXAMPLES.md).
161155

156+
### Screening
157+
158+
Rank a library by ECFP4 similarity, then search it by substructure as a
159+
prepared corpus; the search can use every core:
160+
161+
```python
162+
import smsd
163+
164+
library = ["CC(=O)Oc1ccccc1", "OC(=O)c1ccccc1O", "CC(=O)Nc1ccc(O)cc1", "c1ccccc1"]
165+
ranked = smsd.batch_similarity("CC(=O)Oc1ccccc1C(=O)O", library) # aspirin
166+
corpus = smsd.TargetCorpus.from_smiles(library)
167+
corpus.prewarm()
168+
acids = smsd.Substructure.smarts("C(=O)[OX2H1]").match_many(corpus, num_threads=0)
169+
print([library[i] for i, _ in ranked][:2], sum(r.found for r in acids))
170+
```
171+
172+
The [Python examples](docs/EXAMPLES.md#screening) screen a library of 2,744
173+
molecules and filter by MCS similarity before computing the MCS.
174+
162175
### Command line
163176

164177
The Java build also produces the command-line tool, as a self-contained JAR:
@@ -183,10 +196,13 @@ and SDF files as batch targets.
183196
ring membership, stereo and tautomers.
184197
- **Prepared queries** that can be searched against many targets, in turn or on
185198
several threads.
186-
- **Fingerprints** and similarity metrics for screening. The native library
187-
screens batches with OpenMP where available and, in source builds, can use optional CUDA and
188-
Apple Metal backends (`SMSD_BUILD_CUDA`, `SMSD_BUILD_METAL`).
189-
- **Further tools**, including R-group decomposition, MOL and SDF input,
199+
- **Fingerprints for screening:** circular (ECFP and FCFP), path,
200+
topological-torsion and structural-key fingerprints, including the 166 MACCS
201+
keys, configured once with `FingerprintOptions` (rings, ring sizes, R/S and
202+
E/Z, fragments, Murcko framework) and giving the same bits in C++, Java and
203+
Python. Batch searches can use every processor core, and C++ source builds
204+
can screen by MCS similarity on CUDA or Apple Metal.
205+
- **Utilities**, including R-group decomposition, MOL and SDF input,
190206
SVG depiction (C++ and Python) and molecular standardisation (Java).
191207

192208
### Search calls
@@ -199,50 +215,28 @@ and SDF files as batch targets.
199215
| All optimal MCS mappings, or all substructure embeddings, up to a limit (default 1,000) | `matchAll(target, limit)` | `match_all(target, limit)` |
200216
| Independent searches over a collection of targets | `matchMany(targets)` | `match_many(targets)` |
201217

202-
`MCS` defaults to a connected MCIS. Without atom weights, MCIS preserves both
203-
edges and non-edges between the mapped atoms and maximises atoms, then bonds.
204-
MCES selects compatible common edges and maximises bonds, then their incident
205-
atoms. A search that reaches its timeout can still return a valid mapping;
206-
check the optimality and completion flags before treating it as a proved optimum.
207-
208-
## Performance
209-
210-
No performance figures are published for 8.0.0 on this page. The
211-
[benchmark guide](benchmarks/README.md) defines how they are produced: shared
212-
prepared-query workloads for C++, Java and Python; independent validation of
213-
every returned mapping before any timing is analysed; and separate reporting of
214-
completed, stopped and timed-out searches. Release checks for 8.0.0 are recorded
215-
in the [validation record](docs/VALIDATION_8.0.0.md) as they complete.
218+
`MCS` defaults to a connected MCIS. Without atom weights, MCIS maximises mapped
219+
atoms, then bonds; MCES maximises common bonds, then their atoms. A search that
220+
reaches its timeout can still return a valid mapping, so check the completion
221+
and optimality flags before treating it as a proved optimum.
216222

217223
## Documentation
218224

219225
| Guide | Contents |
220226
| --- | --- |
221-
| [Installation](docs/HOWTO-INSTALL.md) | Platform requirements, installers and source builds |
227+
| [Installation](docs/HOWTO-INSTALL.md) | Platform requirements, downloads and source builds |
222228
| [C++ guide](docs/CPP.md) | Header-only library, chemistry options and file input |
223229
| [Java guide](docs/JAVA.md) | CDK molecules, search, fingerprints, R-groups and the command-line tool |
224230
| [Python guide](docs/PYTHON.md) | Search, results, chemistry options and RDKit integration |
225-
| [Python examples](docs/EXAMPLES.md) | Fingerprints, depiction, layout, stereo, files and R-groups |
226-
| [Search algorithms](docs/ALGORITHMS.md) | Search stages, result semantics and differences between the languages |
227-
| [Benchmarks](benchmarks/README.md) | Workloads, mapping validation and measurement protocol |
231+
| [Python examples](docs/EXAMPLES.md) | Fingerprints, screening, depiction, layout, stereo, files and R-groups |
232+
| [Search algorithms](docs/ALGORITHMS.md) | Search guarantees, result semantics and differences between the languages |
233+
| [Benchmarks](benchmarks/README.md) | How to run the benchmarks and report results |
228234
| [Validation record](docs/VALIDATION_8.0.0.md) | Release checks for 8.0.0 |
229-
| [Release notes](docs/RELEASE_NOTES.md) | Highlights, downloads, platform requirements and upgrade notes for 8.0.0 |
230-
| [Changelog](CHANGELOG.md) | What 8.0.0 provides: API, search behaviour, chemistry, fingerprints and packaging |
231-
232-
The [Java guide](docs/JAVA.md#api-reference) explains how to
233-
generate the Javadoc reference from this checkout.
234-
235-
To run every Python, Java and C++ code block in these guides, build the
236-
current source, then run:
237-
238-
```bash
239-
python scripts/check_examples.py \
240-
--jar java/cli/target/smsd-cli-8.0.0-jar-with-dependencies.jar \
241-
--report build/example-check.json
242-
```
235+
| [Release notes](docs/RELEASE_NOTES.md) | Highlights, downloads and upgrade notes for 8.0.0 |
236+
| [Changelog](CHANGELOG.md) | Changes in 8.0.0 |
243237

244-
Use `--languages python` to check one language. Examples that need RDKit are
245-
skipped when it is not installed, and the report lists every failure.
238+
The [Java guide](docs/JAVA.md#api-reference) explains how to generate the
239+
Javadoc reference.
246240

247241
## Licence
248242

@@ -251,9 +245,9 @@ apply to academic and commercial use, with no fee or registration. Redistributio
251245
must include the [LICENSE](LICENSE) and [NOTICE](NOTICE) files and retain the
252246
copyright notices; the NOTICE file also sets out the trademark terms. Bundled
253247
dependencies carry their own licence notices. The Java CLI JAR with
254-
dependencies, the portable CLI archive, the CLI installers and the Docker image
255-
bundle CDK under the [LGPL-2.1](licenses/cdk/README.md); for the runtimes that Python
256-
wheels can bundle, see the [LLVM OpenMP](licenses/libomp/LICENSE.TXT),
248+
dependencies, the portable CLI archive and the Docker image bundle CDK under
249+
the [LGPL-2.1](licenses/cdk/README.md); for the runtimes that Python wheels can
250+
bundle, see the [LLVM OpenMP](licenses/libomp/LICENSE.TXT),
257251
[GCC OpenMP](licenses/libgomp/README.md) and
258252
[Microsoft C++ and OpenMP](licenses/msvc/README.md) notices.
259253

Collapse file

‎benchmarks/README.md‎

Copy file name to clipboard
+52-65Lines changed: 52 additions & 65 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# SMSD benchmarks
22

3-
Run these tools from the repository root. Use the same molecules, chemistry
4-
options and search budgets when comparing results, and check returned mappings.
5-
The [8.0.0 validation record](../docs/VALIDATION_8.0.0.md) covers the release
6-
checks; the measurement protocol below governs every reported result.
3+
This guide shows how to run the benchmarks and how to report their results.
4+
Run every command from the repository root, after building the current source.
5+
The [data guide](data/README.md) lists the input files, their sources and
6+
licences.
77

88
## Prepared-query APIs
99

10-
Build the source before running these workloads. The three runners read
11-
`search_api_cases.tsv` and
12-
write JSON Lines containing every measurement, parsed graph, atom and selected
13-
bond mapping, fragments, stopping status and proof flags.
10+
The C++, Java and Python runners read `search_api_cases.tsv`, whose rows set
11+
the search, chemistry, budget, limits and batch size of each case. They write
12+
JSON Lines holding every measurement, mapping, stopping status and proof flag.
1413

1514
| Phase | Work inside the timer |
1615
| --- | --- |
@@ -19,13 +18,7 @@ bond mapping, fragments, stopping status and proof flags.
1918
| `end_to_end` | Parse both inputs, prepare the query and search |
2019
| `batch` | Search a collection of pre-parsed targets sequentially |
2120

22-
The corpus includes MCIS and MCES, connected and disconnected results,
23-
weighted MCIS, molecule and SMARTS substructure, capped enumeration and batch
24-
calls. Chemistry, budgets, limits and batch sizes are explicit in each row.
25-
The `any` profile compares elements and ignores bond order; other profiles
26-
exercise strict chemistry, rings, stereo and tautomer matching.
27-
28-
From the repository root, run the Python and native workloads:
21+
Python and C++:
2922

3023
```bash
3124
mkdir -p build/search-benchmarks
@@ -37,7 +30,7 @@ build/search-benchmarks/native --cases benchmarks/search_api_cases.tsv \
3730
--output build/search-benchmarks/cpp.jsonl --warmup 2 --repeats 5
3831
```
3932

40-
For Java, compile the runner against the current source-built dependency JAR:
33+
Java, against the source-built dependency JAR:
4134

4235
```bash
4336
mvn -f java/pom.xml package -DskipTests
@@ -48,34 +41,23 @@ java -cp "build/search-benchmarks:java/cli/target/smsd-cli-8.0.0-jar-with-depend
4841
--output build/search-benchmarks/java.jsonl --warmup 2 --repeats 5
4942
```
5043

51-
Use a semicolon instead of a colon in the Java classpath on Windows. With
52-
Java 8, replace `--release 8` with `-source 8 -target 8`. All runners accept
44+
On Windows, separate classpath entries with `;`. With a Java 8 compiler,
45+
replace `--release 8` with `-source 8 -target 8`. Every runner accepts
5346
`--case ID` and `--phase PHASE` to select a workload.
5447

55-
Validate the recorded results before analysing timings:
48+
Validate the results before analysing any timing; the validator checks every
49+
returned mapping and compares completed results across the languages:
5650

5751
```bash
5852
python benchmarks/search_api_validation.py --cases benchmarks/search_api_cases.tsv \
5953
--results build/search-benchmarks/cpp.jsonl build/search-benchmarks/java.jsonl \
6054
build/search-benchmarks/python.jsonl --output build/search-benchmarks/validation.json
6155
```
6256

63-
The independent validator checks returned mappings, selected components and
64-
completed cross-language results. Small eligible graphs also use exhaustive
65-
objective checks. It reports predicates and graph sizes outside its independent
66-
oracle scope explicitly; language regression tests cover those contracts.
67-
Raw embeddings are compared after accounting for parser atom order.
68-
69-
Keep preparation and warm search results separate. Use several fresh processes
70-
in a balanced order, record compiler, runtime, source and power conditions, and
71-
retain every observation. Timing ratios require the same objective and matching
72-
rules with completed proofs. A timeout with a valid incumbent is a separate
73-
quality outcome. Run coverage and builds outside the timing window.
74-
75-
## Python
57+
## Python and RDKit
7658

7759
Install SMSD and RDKit in the same environment. These short runs check the
78-
benchmark tools; they do not measure the full corpus:
60+
scripts rather than measure the full inputs:
7961

8062
```bash
8163
python benchmarks/benchmark_python.py \
@@ -90,37 +72,23 @@ python benchmarks/benchmark_bindings.py \
9072
--output build/local-benchmarks/bindings-smoke.json
9173
```
9274

93-
Remove `--limit 1` for the full external corpus. Use `--resume` with the same
94-
arguments and environment to continue an interrupted run. Results record the
95-
imported package paths and versions.
75+
Remove `--limit 1` to run every external pair, and add `--resume` with the
76+
same arguments and environment to continue an interrupted run.
9677

97-
| Tool | Measures |
78+
| Script | Measures |
9879
|---|---|
99-
| `benchmark_python.py` | The 20 curated MCS pairs in `data/mcs_pairs.tsv` and 20 substructure cases |
100-
| `run_external_benchmarks.py` | Random and neighbouring pairs, tautomer pairs, stress cases and SMARTS |
80+
| `benchmark_python.py` | The curated MCS pairs in `data/mcs_pairs.tsv` and substructure cases |
81+
| `run_external_benchmarks.py` | Random and nearest-neighbour pairs, tautomer pairs, stress cases and SMARTS |
10182
| `benchmark_bindings.py` | Parsing, RDKit conversion, scalar calls and batch overhead |
10283

103-
The external MCS runner checks mappings and records completion and stopping
104-
status. Stopped searches are excluded from speed ratios.
105-
10684
| Policy | Matching rules |
10785
|---|---|
10886
| `any` | Matching elements, with any bond order |
109-
| `strict` | Exact bonds, charge, ring membership and aromatic atoms; RDKit uses a Python comparator |
110-
| `fmcs` | SMSD strict bond order with flexible aromaticity; RDKit uses `CompareOrder` |
111-
112-
Different MCS edge and aromaticity rules can produce different results. The
113-
mapping checks of the external MCS runner, above, are in `mcs_protocol.py`, and
114-
the comparison limits under [Prepared-query APIs](#prepared-query-apis) apply.
115-
The [data guide](data/README.md) records corpus sources and counts. The derived
116-
Dalke-style pairs are separate from the original Dalke benchmark.
87+
| `strict` | Exact bonds, charge, ring membership and aromatic atoms |
88+
| `fmcs` | Strict bond order with flexible aromaticity; RDKit uses `CompareOrder` |
11789

11890
## Java and C++
11991

120-
Build the Java CLI with Maven and a JDK. Java 25 LTS is preferred for the
121-
build, and the JAR runs on Java 8 or later. C++ benchmarks require a C++17
122-
compiler.
123-
12492
```bash
12593
mvn -f java/pom.xml package -DskipTests
12694
python benchmarks/benchmark_leaderboard.py --mode integration
@@ -131,14 +99,33 @@ c++ -std=c++17 -O3 -Icpp/include benchmarks/benchmark_primitives.cpp \
13199
build/local-benchmarks/primitives assignment
132100
```
133101

134-
The integration driver measures the Java CLI, including its start-up time,
135-
against RDKit on the curated MCS pairs, and Java substructure matching against
136-
RDKit and CDK on `substructure_pairs.tsv`. The C++ shell benchmark compiles
137-
the SMSD headers and measures the supplied stress pairs. The primitive
138-
benchmark times native assignment and general matching (`assignment`, with an
139-
optional repeat multiplier), NLF3 construction and a complete-subgraph MCS
140-
(`primitives`) and cold-target matcher set-up (`setup`); each selector prints
141-
checksums that must agree between builds. These timings have different
142-
set-up costs from the Python benchmarks.
143-
144-
For opt-in Java corpus tests, see the [build guide](../docs/HOWTO-INSTALL.md).
102+
The integration driver times the Java CLI, including its start-up, against
103+
RDKit on the curated MCS pairs, and Java substructure search against RDKit and
104+
CDK on `substructure_pairs.tsv`; its results are not engine rankings.
105+
`benchmark_cpp.sh` builds and times C++ MCS search on the stress pairs.
106+
`benchmark_primitives` takes the selector `assignment`, `primitives` or
107+
`setup` and prints checksums that must agree between builds.
108+
109+
The Java benchmark tests are off by default. To run them:
110+
111+
```bash
112+
mvn -f java/pom.xml -pl core test -Dslow.tests.exclude=nothing \
113+
'-Dtest=BenchmarkSuiteTest*,ExternalBenchmarkTest*,JavaCdkVsSmsdBenchmarkTest' \
114+
-Dbenchmark=true -Dsmsd.benchmark=true
115+
```
116+
117+
The system properties `smsd.benchmark.timeoutMillis` (default `1000`),
118+
`smsd.benchmark.rounds` (default `1`) and `smsd.benchmark.warmup` (default `0`)
119+
set the run, and results go to `build/local-benchmarks/java` unless
120+
`smsd.benchmark.outputDir` names another directory.
121+
122+
## Reporting results
123+
124+
- Validate every returned mapping before analysing timings.
125+
- Report each phase separately, and keep preparation apart from warm searches.
126+
- Use several fresh processes in a balanced order and retain every observation.
127+
- Record the compiler, runtime, source revision and power conditions.
128+
- Compare timings only for the same objective, chemistry and matching rules,
129+
and only between completed searches; report stopped and timed-out searches,
130+
even with a valid mapping, as separate outcomes.
131+
- Keep builds and coverage runs outside the timing window.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.