Example 2.4 — SMILES vs SMARTS queries (4-chloroaniline)

Conversation

👤 User

Find compounds with a 4-chloroaniline group. What changes if I require a free NH2 (primary amine)?


🧠 Assistant

Whether you require a free NH2 makes a 75-fold difference:

Query Written as What it means Matching compounds
Nc1ccc(Cl)cc1 SMILES a nitrogen on a ring carbon para to a chlorine, with any substitution on the N 21,350
[NX3;H2]c1ccc(Cl)cc1 SMARTS the same, but the N must carry exactly two hydrogens (a free -NH2) 283

So about 99% of the 4-chloroaniline hits have the nitrogen built into something larger: an amide, a urea, a ring or a secondary amine.

SMILES query: the best-studied matches (most measurements first):

Compound Measurements Targets structureSMILES
Sorafenib (Nexavar) 1,731 434 CNC(=O)c1cc(ccn1)Oc2ccc(cc2)NC(=O)Nc3ccc(c(c3)C(F)(F)F)ClCNC(=O)c1cc(ccn1)Oc2ccc(cc2)NC(=O)Nc3ccc(c(c3)C(F)(F)F)Cl
Vatalanib (PTK787) 856 385 Clc1ccc(Nc2nnc(Cc3ccncc3)c3ccccc23)cc1Clc1ccc(Nc2nnc(Cc3ccncc3)c3ccccc23)cc1
Clozapine (Clozaril) 635 89 CN1CCN(CC1)C2=Nc3cc(ccc3Nc4c2cccc4)ClCN1CCN(CC1)C2=Nc3cc(ccc3Nc4c2cccc4)Cl
Bosutinib 585 386 CN1CCN(CC1)CCCOc2cc3c(cc2OC)c(c(cn3)C#N)Nc4cc(c(cc4Cl)Cl)OCCN1CCN(CC1)CCCOc2cc3c(cc2OC)c(c(cn3)C#N)Nc4cc(c(cc4Cl)Cl)OC
Clozapine (Leponex) 413 101 CN1CCN(C2=c3ccccc3=Nc3ccc(Cl)cc3N2)CC1CN1CCN(C2=c3ccccc3=Nc3ccc(Cl)cc3N2)CC1
Rimonabant (Acomplia) 271 33 Cc1c(nn(c1-c1ccc(Cl)cc1)-c1ccc(Cl)cc1Cl)C(=O)NN1CCCCC1Cc1c(nn(c1-c1ccc(Cl)cc1)-c1ccc(Cl)cc1Cl)C(=O)NN1CCCCC1
Efavirenz (EFV) 254 23 c1cc2c(cc1Cl)[C@@](OC(=O)N2)(C#CC3CC3)C(F)(F)Fc1cc2c(cc1Cl)[C@@](OC(=O)N2)(C#CC3CC3)C(F)(F)F
Diazepam 139 54 CN1c2ccc(cc2C(=NCC1=O)c3ccccc3)ClCN1c2ccc(cc2C(=NCC1=O)c3ccccc3)Cl

In every one of these the nitrogen is substituted. It is part of a urea (sorafenib), a ring or carbamate (clozapine, diazepam, efavirenz), or a secondary amine (vatalanib, bosutinib). In rimonabant the matching "N" is even an aromatic pyrazole nitrogen. Clozapine appears twice, as two BindingDB entries (Clozaril and Leponex), the second drawn as another tautomer.

SMARTS query: free NH2 only:

Compound Measurements Targets structureSMILES
MLS000042514 19 12 Nc1c(cc(Cl)c2nonc12)N1CCCC1Nc1c(cc(Cl)c2nonc12)N1CCCC1
CHEMBL4087260 11 11 Nc1ccc(Cl)cc1-c1cnc2ccc(Cl)nn12Nc1ccc(Cl)cc1-c1cnc2ccc(Cl)nn12
CHEMBL4067477 11 11 CC[C@@H](CO)Nc1ccc2ncc(-c3cc(Cl)ccc3N)n2n1CC[C@@H](CO)Nc1ccc2ncc(-c3cc(Cl)ccc3N)n2n1
CHEMBL4861912 11 7 CN1CCN(CC1)c1ccc(cc1NC(=O)c1cc(N)c(F)c(C)c1Cl)-n1cc(nn1)C(=O)NCCCN1CCOCC1CN1CCN(CC1)c1ccc(cc1NC(=O)c1cc(N)c(F)c(C)c1Cl)-n1cc(nn1)C(=O)NCCCN1CCOCC1
MLS000763081 8 6 CN(C)c1cc(Cl)c2nonc2c1NCN(C)c1cc(Cl)c2nonc2c1N
CHEMBL6148436 8 8 Cc1c(F)c(N)cc(C(=O)Nc2cc(-c3ccc(NC(=O)CCCCCCC(=O)NO)cc3)ccc2N2CCN(C)CC2)c1ClCc1c(F)c(N)cc(C(=O)Nc2cc(-c3ccc(NC(=O)CCCCCCC(=O)NO)cc3)ccc2N2CCN(C)CC2)c1Cl
CHEMBL6133389 8 8 Cc1c(F)c(N)cc(C(=O)Nc2cc(-c3ccc(C(=O)NCc4ccc(/C=C/C(=O)NO)cc4)cc3)ccc2N2CCN(C)CC2)c1ClCc1c(F)c(N)cc(C(=O)Nc2cc(-c3ccc(C(=O)NCc4ccc(/C=C/C(=O)NO)cc4)cc3)ccc2N2CCN(C)CC2)c1Cl
US9040534, 91 6 3 C[C@H]1Cn2c(nnc2-c2cnccn2)C(=O)N1Cc1cc(N)ccc1ClC[C@H]1Cn2c(nnc2-c2cnccn2)C(=O)N1Cc1cc(N)ccc1Cl

These are smaller and much less studied. The best-studied has only 19 measurements, compared with 1,731 for sorafenib. A free aromatic NH2 is uncommon in optimized drugs.

Lesson: SMILES describes a molecule, SMARTS describes a pattern. When you search with a SMILES string, the server matches it as a pattern made of the heavy atoms and bonds you wrote. Hydrogen counts are ignored, so N (or even [NH2]) matches a nitrogen with any number of substituents. To make a property part of the query, write SMARTS, which lets you state it per atom:

With query_type="auto" the server falls back to SMARTS when a query is not valid SMILES. If you need H counts enforced, set query_type="smarts" yourself.

How this was answered

  1. substructure_search with Nc1ccc(Cl)cc1 (SMILES) and count_only=true: 21,350 compounds.
  2. substructure_search with [NX3;H2]c1ccc(Cl)cc1, query_type="smarts" and count_only=true: 283 compounds.
  3. The same two searches with limit=8: example compounds, ranked by number of measurements. A listing is capped by limit (and scans the 100,000 best-measured compounds), so it shows the best-studied matches, not a random sample.

Try next