When you want to replace a substituent or linker with a different structure, the 80-rule table built in Part 4 (Choosing Bioisostere Replacements from a Rule Table) can return textbook swaps, such as carboxylic acid to tetrazole, together with risk notes. But it cannot return a single transformation outside the 80 rules written in advance. Changing the ethyl group on the nitrogen of a quinolone to cyclopropyl, thiourea to cyanoguanidine, and an aromatic nitro group to methylsulfonyl are all well known from real drug discovery, yet this rule table matches zero rules for them.
CReM (Chemically Reasonable Mutations) is a method that replaces part of a molecule with another, chemically reasonable fragment to make analogs, based on precedents of substitutions actually observed in known compounds. I like this mechanism, which you could call the accumulated tacit knowledge of past medicinal chemists, and I often use it in practice. So this time I built CReM into ChemOmni so that it can pull “the substructures that appeared in the same surrounding environment, and how often” from about 1.67 million ChEMBL 37 molecules. I also added a mechanism that applies RDKit property filters before the candidates are trimmed to the top 20. The AI only chooses the CReM settings and never writes the SMILES of the replaced molecules. Using four transformations of real approved drugs, I sent the same request six times each to OpenAI’s gpt-6.1-terra and checked the results.
Source code: https://github.com/aurio9923/chemomni (MIT license)
Pulling candidates from ChEMBL precedent, and adjustments to the search
CReM, developed by Pavel Polishchuk, takes “when the surrounding structure looks like this, what group was actually attached there in real compounds?” from the ChEMBL record and turns it into replacement candidates. For example, when you select a carboxylic acid on an aromatic ring, CReM first removes that group and takes the structure within three bonds of the cut (the surrounding environment) as its reference. It then looks in the database for known molecules with the same surrounding environment, takes out the fragments actually attached there (chlorine, methoxy, tetrazole, and so on) together with how many times each was observed, and attaches them in place of the removed group. Those are the candidates. In the standard acyclic fragmentation mode (acyclic), single bonds outside rings are cut to make the fragments. Unlike matched molecular pair analysis such as mmpdb, it does not count “how many times one group was replaced by another”; it counts “how many times a combination of the same surrounding environment and a replacement fragment was observed in the database.” Because structures are assembled from combinations seen in known compounds, they tend to avoid impossible valences and hard-to-synthesize skeletons.
The search database was built from the latest ChEMBL 37 structures, filtered by drug-like conditions and a synthetic accessibility score (SA score 3.5 or lower, 6–35 heavy atoms, 8 or fewer rotatable bonds, no silicon). The resulting 1,665,459 molecules were fragmented in this acyclic mode, and only the fragments seen at least three times with the same surrounding environment were kept, in a 547 MB local SQLite file. The search runs entirely on the local PC, and the median search time measured on 15 real drugs is about 0.2 seconds.
Using the editor is the same as with the earlier tools: select the atoms you want to replace in Ketcher (a terminal substituent, a two-point linker, a single ring connected by a single bond, and so on) and ask in the chat, and a new tab opens with a grid of candidates. Connecting the CReM library as it is turned out to be hard to use in some situations, so I adjusted ChemOmni’s search behavior.
- Limiting the number with CReM’s own
max_replacementsmakes it sample at random internally when the candidates exceed the limit, so the candidates change every run. To keep the order fixed by frequency, ChemOmni takes the most frequent entries first on the SQLite side, merges duplicates by the same stereo-preserving canonical tautomer as in the previous post (Canonical Tautomers, Compound Numbers, and SDF Import and Export; a setting that keeps the sp3 stereocenters that RDKit’s default normalization would lose), and returns the top 20. - If you select a carboxylic acid or a nitro group and simply sort by frequency, the compound where only the selected group became hydrogen (that position left unsubstituted) comes first, so replacement by hydrogen alone (deleting the functional group) is excluded by default.
- The surrounding environment is searched at three bonds (
radius=3) by default, and falls back automatically to two bonds (radius=2) only when there are zero matches. When property or substructure conditions are given, RDKit applies them as a pre-filter to the whole candidate set before it is cut to 20, and then the top 20 are chosen.
Trying it on transformations of approved drugs
I prepared four source compounds in separate tabs, selected the substructure to replace in the editor, and asked gpt-6.1-terra in English, six times each (24 runs in total). The default size of the replacing fragment is from -3 to +4 heavy atoms relative to the selected part.
Example 1: From the carboxylic acid analog of losartan to losartan
First, as a case the 80 rules of Part 4 can also handle, I drew the antihypertensive losartan with its tetrazole ring replaced by a carboxylic acid (a biphenylcarboxylic acid-type analog), selected the three atoms of the carboxylic acid, and asked. Applying the 80 rules’ find_bioisosteres returns nine textbook bioisosteres of carboxylic acid: tetrazole and acyl sulfonamide, which keep the acidity, and primary sulfonamide and hydroxamic acid, which mimic it through hydrogen bonding and polarity.
Transform the selected part with CReM
Calling CReM on the same three atoms matched 228 fragments in the database. After removing hydrogen replacements and duplicates from the top 60, 58 candidates remained, and the top 20 were laid out in a new tab (Figure 1). The same 20 appeared in all six runs.
freq=675) the tetrazole analog, losartan, appears.The substituents at the top differ greatly from those of the hand-written rule table (Table 1). The tetrazole group (the product is losartan) comes in at rank 8 with 675 observations in this surrounding environment, but ranks 1 to 7 are taken by common aromatic substituents such as chloro, methoxy, and methyl. This is because CReM counts not “whether the group keeps the properties of a carboxylic acid” or “whether it was converted from a carboxylic acid,” but “which fragments were observed most often in combination with this surrounding environment (radius=3) of the biphenyl skeleton.” When you want to see the textbook equivalents in one pass, use the 80 rules; when you want to widen the substituents from precedent without preconceptions, CReM is the better fit.
| Rank | Replacement group | Fragment occurrences | MW | cLogP | TPSA (Ų) | Note |
|---|---|---|---|---|---|---|
| 1 | -Cl | 5,919 | 389.33 | 5.74 | 38.05 | Frequent aromatic substituent |
| 2 | -OCH3 | 5,782 | 384.91 | 5.10 | 47.28 | |
| 3 | -CH3 | 5,251 | 368.91 | 5.40 | 38.05 | |
| 4 | -F | 4,987 | 372.87 | 5.23 | 38.05 | |
| 5 | -OH | 3,260 | 370.88 | 4.79 | 58.28 | |
| 6 | -CF3 | 960 | 422.88 | 6.11 | 38.05 | |
| 7 | -OCH2CH3 | 800 | 398.93 | 5.49 | 47.28 | |
| 8 | Tetrazol-5-yl | 675 | 422.92 | 4.27 | 92.51 | Losartan (approved drug) |
| 15 | -SO2NH2 | 296 | 433.96 | 3.73 | 98.21 | Primary sulfonamide |
Table 1. Main candidates from transforming the carboxylic acid analog of losartan with CReM (r=3) (from the 58 obtained out of the top 60; “Fragment occurrences” is the number of times the combination of the same surrounding environment and fragment was observed in the database derived from filtered ChEMBL 37).
Example 2: From norfloxacin to ciprofloxacin
From here on, none of the transformations is among the 80 hand-written rules. I drew norfloxacin, a fluoroquinolone antibacterial, and selected the ethyl group (two carbons) on the N1 nitrogen of the quinolone ring. This is a place where the 80 rules match zero rules.
Transform the selected part with CReM
CReM returned 30 candidates from the 31 matched fragments, and the top 20 were laid out in the tab (Figure 2). At rank 1 (539 observations in this surrounding environment) came ciprofloxacin, in which changing the ethyl group to cyclopropyl raised the antibacterial activity. The same 20 appeared in all six runs.
freq=539).The cyclopropyl group ranks above the plain methyl group (rank 2, 323 observations) (Table 2). Counted across all compounds, ethyl and methyl groups should be far more common, but radius=3, which looks at the surrounding environment three bonds from the cut, searches with the atoms next to the quinolone skeleton fixed, so the cyclopropyl group that was made intensively in fluoroquinolones comes out on top. (Note that for a two-atom ethyl group the default size limit +4 lets fragments up to the six-atom phenyl group appear; to look for larger groups such as difluorophenyl, widen max_inc.)
| Rank | Substituent at N1 | Fragment occurrences | MW | cLogP | TPSA (Ų) |
|---|---|---|---|---|---|
| 1 | Cyclopropyl (ciprofloxacin) | 539 | 331.35 | 1.58 | 74.57 |
| 2 | Methyl | 323 | 305.31 | 0.79 | 74.57 |
| 3 | n-Butyl | 79 | 347.39 | 2.05 | 74.57 |
| 4 | Phenyl | 76 | 367.38 | 2.24 | 74.57 |
| 5 | tert-Butyl | 65 | 347.39 | 2.00 | 74.57 |
| 14 | Cyclobutyl | 12 | 345.37 | 1.97 | 74.57 |
Table 2. Main candidates from transforming the N1-ethyl group of norfloxacin with CReM (r=3) (out of 30 in total).
Example 3: From metiamide to cimetidine
In the development of histamine H2 receptor antagonists, agranulocytosis was reported in clinical trials of metiamide, which contains a thiourea, and cimetidine, in which the thiourea was replaced with cyanoguanidine, was developed and became an approved drug. Selecting these four thiourea atoms (NC(=S)N) and running CReM (r=3) without a property filter gives 96 database matches, and the top 20 are filled with low-polarity linkers such as methylene chains, amines, and ethers. The cyanoguanidine analog corresponding to cimetidine (12 fragment occurrences, TPSA 88.89 Ų) does not appear in the default top 20.
In practice, when the top ranks are all nonpolar groups like this, I dig deeper by adding polarity or molecular weight conditions in the chat with the AI. RDKit’s default TPSA does not include the contribution of sulfur, so the calculated value for the parent metiamide is 52.74 Ų, but as a guide for narrowing to candidates in which the thiourea has been replaced with a polar linker rich in nitrogen and oxygen, I added TPSA of 80 or more as an extra condition.
Transform the selected part with CReM, keeping only TPSA of 80 or more
The AI behaved appropriately in all six runs. With RDKit’s TPSA filter applied, only nine candidates line up in the tab (Figure 3, Table 3). Cimetidine, which had sunk to rank 28, comes out at rank 2 of the nine.
TPSA of 80 or more first narrows 87 candidates to nine, and cimetidine appears at rank 2 (freq=12). Even when the central linker is replaced, the light-blue highlight is only on the replaced atoms.| Rank | Rank before the filter | Replaced linker structure | Fragment occurrences | MW | cLogP | TPSA (Ų) |
|---|---|---|---|---|---|---|
| 1 | 7 | 2-Methyl-5-nitroimidazole ring | 78 | 281.34 | 2.06 | 89.64 |
| 2 | 28 | Cyanoguanidine (cimetidine) | 12 | 252.35 | 0.60 | 88.89 |
| 3 | 41 | Acylurea type (-NHC(=O)NHC(=O)-) | 7 | 256.33 | 0.80 | 86.88 |
| 4 | 45 | Isoxazolylamide type | 6 | 280.35 | 2.28 | 83.81 |
| 5 | 46 | Hydroxyurea type | 6 | 244.32 | 0.98 | 81.25 |
| 6 | 65 | Cyanoguanidine homolog (terminal ethyl) | 4 | 266.37 | 0.99 | 88.89 |
| 7 | 66 | Phosphodiester type | 4 | 294.31 | 2.49 | 84.44 |
| 8 | 80 | 1,3,4-Thiadiazolylamide type | 3 | 297.41 | 2.14 | 83.56 |
| 9 | 86 | Hydroxyurea homolog (N-isopropyl) | 3 | 272.37 | 1.76 | 81.25 |
Table 3. All nine candidates from transforming the thiourea of metiamide with CReM (r=3) with TPSA ≥ 80 Ų (with their ranks among all 87 candidates before the filter).
Example 4: From chloramphenicol to thiamphenicol
Chloramphenicol (MW 323.13, TPSA 112.70 Ų), an antibacterial with two stereocenters (1R,2R) in the side chain, was a concern because its aromatic nitro group is linked to the rare aplastic anemia, and thiamphenicol was developed by replacing it with a methylsulfonyl group (-SO2CH3), which keeps the electron-withdrawing character and polarity of the nitro group. For the three nitro atoms, the hand-written 80 rules match zero rules. In CReM without a filter (r=3, 1,911 matches), light, low-polarity groups such as -Cl, -F, -OCH3, and -CH3 occupy the top, and the methylsulfonyl group (5,052 fragment occurrences) comes in at rank 17.
So, as a compound condition to remove the light candidates that were replaced with small nonpolar groups poor in nitro-group bioisosterism, I added lower limits on molecular weight and TPSA, applied to the whole candidate molecule after replacement.
Transform the selected part with CReM, with molecular weight of 340 or more and TPSA of 100 or more
The AI specified the conditions appropriately in all six runs. Of the 148 candidates assembled from the top 150 by occurrence count, 123 were excluded, and the top 20 of the 25 that met the conditions lined up in the tab (Figure 4). Halogens and simple alkyl groups dropped out. The primary sulfonamide group -SO2NH2 (7,848 occurrences, MW 357.21, TPSA 129.72 Ų) came first, thiamphenicol with the methylsulfonyl group -SO2CH3 (5,052 occurrences, MW 356.23, cLogP 0.40, TPSA 103.70 Ų) second, the methanesulfonamide group -NHSO2CH3 (1,061 occurrences) third, and the dimethylsulfonamide group -SO2N(CH3)2 (640 occurrences) fourth. The two side-chain stereocenters (1R,2R) were also kept in all six runs.
Molecular weight of 340 or more, TPSA of 100 or more narrows the list to 25, and thiamphenicol appears at rank 2 (freq=5052).Checking the results
I checked the records of all 24 runs (four requests × six) with a verification script separate from the app. It does not load the app’s code; it re-enumerates the candidates from the same database with crem and RDKit.
In all 24 runs the AI called crem_bioisosteres exactly once, with no failures, and a new tab opened each time. All six runs of Example 3 passed tpsa_min: 80, and all six of Example 4 passed mw_min: 340, tpsa_min: 100. The order of all the candidates the tool returned and their SMILES including the stereo configuration (including the 1R,2R configuration of thiamphenicol in Example 4) matched the independent enumeration in all 24 runs, and there was no difference from the recalculated MW, cLogP, and TPSA.
For the chat answers as well, a number extraction with the verification script and a read-through of all 24 answers showed that the number of candidates shown, the number of database matches (mentioned in 18 of the 24 runs, all but Example 3), and the numbers hidden by the limit or the property filters (the tool’s not_shown and filtered_out: 38 not shown in Example 1, 10 not shown in Example 2, 9 shown and 78 excluded in Example 3, and 25 passed, 123 excluded, and 5 not shown in Example 4) agreed with the tool’s return values. In all 24 runs the answer also carried a note to the effect that “ChEMBL frequencies show precedent in a local environment and are not a prediction of activity or selectivity,” for example “ChEMBL frequencies indicate local chemical precedent, not predicted potency or selectivity.”
How fused rings are handled
Selecting a whole single ring connected by a single bond (such as a phenyl ring) and swapping it for a pyridine or thiazole ring can be done in this setup too, but while looking at pairs of real drugs I also found transformations it cannot produce. One example is piroxicam and tenoxicam, anti-inflammatory analgesics in which one benzene ring of a fused ring is replaced with a thiophene ring. CReM itself has a mode that handles bonds inside rings, but the database built for ChemOmni this time uses the acyclic mode (acyclic), which cuts only single bonds outside rings, so it cannot split a fused ring that shares an edge down the middle and swap only one side. It is limited to replacing the whole fused ring as one block with another skeleton within the database’s fragment limit (12 heavy atoms or fewer), and you need to know this when using it.
Design decisions
- The AI writes no replaced structures and only chooses the target and the filter conditions. CReM assembles the structures; RDKit calculates and filters the properties.
- Return results in a reproducible order, apply the property filter, and return them to the user. The candidates are always built in the same order from the top by occurrence count (up to 150 per surrounding environment when a filter is given), and the property conditions are applied first, before the top 20 are shown in the tab.
- Treat frequency as a count of precedents, separate from risk judgment. Occurrence counts say nothing about activity or safety, so the design leaves it to people to judge them together with the structural-alert column and the notes in the chat.
Summary
With this addition, ChemOmni now has three structural transformation tools: scan_positions (Part 2), which covers combinations of positions and substituents; the 80 hand-written rules (Part 4), which return textbook equivalents with risk notes; and CReM, which combines the fragment precedents of 1.67 million ChEMBL molecules with property filters to search beyond the 80 rules. You can now choose on the same screen: use the 80 rules to confirm the textbook options, and call CReM with property conditions to widen the search to substituents and linkers you would not think of.
Notes
- Model: OpenAI’s gpt-6.1-terra (Responses API, reasoning effort low, the app’s default). Figures 1–4 also show this model’s results.
- Language: the requests were sent in English, as quoted. The Japanese version of this article reports the same four requests sent in Japanese (24 runs); the candidate lists the tool returned were identical in the two languages.
- Repetition: each of the four requests was sent six times, re-selecting the target substructure each time, closing the tabs opened by the previous run, and starting a new chat (24 runs in total, response time 6.2–18.5 seconds).
- Parent structures: the carboxylic acid analog of losartan
CCCCc1nc(Cl)c(CO)n1Cc1ccc(-c2ccccc2C(=O)O)cc1, norfloxacinCCn1cc(C(=O)O)c(=O)c2cc(F)c(N3CCNCC3)cc21, metiamideCNC(=S)NCCSCc1nc[nH]c1C, and chloramphenicolO=C(N[C@H](CO)[C@H](O)c1ccc([N+](=O)[O-])cc1)C(Cl)Cl. - CReM database: a SQLite database (547 MB) built from ChEMBL 37 (CC BY-SA 3.0) by filtering with drug-like conditions and an SA score of 3.5 or lower, fragmenting the resulting 1,665,459 molecules with
crem0.3.2 (radius 1–3, at most 12 heavy atoms in a replaced fragment, acyclic single-bond cleavageacyclic), and keeping the fragments observed three or more times with the same surrounding environment. By default the replacing fragment has-3to+4heavy atoms relative to the selected part, and the candidates are assembled from the top 60 occurrence counts per surrounding environment without a filter and the top 150 with a filter. - Cross-check: without using the app’s code, I enumerated and recalculated independently with
crem0.3.2 and RDKit 2026.09.1 (a TautomerEnumerator that keeps sp3 and double-bond stereo on structures neutralized with the Uncharger, Descriptors.MolWt, Crippen.MolLogP, the default CalcTPSA that excludes sulfur, and SA_Score) and compared the results of all 24 runs.