[drug] SMARTS

用于形容更细节的关于这个原子的状态,比如 C;H3+ represent a carbon atom with three explicit hydrogens and a positive charge, 还有 N;H1;+1 describes a nitrogen atom that must have exactly one hydrogen and

[]

用于形容更细节的关于这个原子的状态,比如[C;H3+] represent a carbon atom with three explicit hydrogens and a positive charge, 还有[N;H1;+1] describes a nitrogen atom that must have exactly one hydrogen and a positive charge. 分号; 类似于AND,[]里需要满足所有的形容。

()

分叉,比如CC(C)C 主要的chain是 CC-C 然后第二个C分了个岔, methyl group

bond

用- 或者= 表示

ring

苯环,c1ccccc1,两个1表示首尾相连。

n1cccc1, 有N的五边形环。

什么时候用[]什么时候不用

这些原子(B, C, N, O, P, S, F, Cl, Br, I),如果没有特殊要求,不需要用[],比如C(=O)-N-C, 也可以C(=O)[N]-[C;h3],这里C和N的键没有明说。

$

exact match, treated as a complete unit

比如[N]-[([C;h3]);([C;h3]);(CNC(=O)C@HCc1cccc2ccccc12)], N连接的部分,分号前面要求是一个C,分号后面要求是一个具体的substructure

Code

read

acid_pattern = Chem.MolFromSmarts('C(=O)[O;h1]')

replace

new_bb = AllChem.ReplaceSubstructs(bb_mol, acid_pattern, Chem.MolFromSmarts('C(=O)[N]-[C;h3]'))[0]