Re: [Rdkit-discuss] delete a substructure

2017-03-11 Thread David Cosgrove
There's a bit more to it than that. If you're developing a SMARTS for a particular type of group, you can run it against a large file and see the false hits and false non-hits quickly and revise your SMARTS accordingly. And as you say, it is also available. Dave On Fri, 10 Mar 2017 at 20:53, Pete

Re: [Rdkit-discuss] delete a substructure

2017-03-10 Thread Peter S. Shenkin
Sounds like Daylight's "depictmatch", unfortunately no longer available on line -P. On Fri, Mar 10, 2017 at 1:28 PM, David Cosgrove wrote: > Hi, > In the RDKit source, under the 2d drawing code in the c++ part there's the > full source code for a QT program that will run one or more SMARTS

Re: [Rdkit-discuss] delete a substructure

2017-03-10 Thread David Cosgrove
Hi, In the RDKit source, under the 2d drawing code in the c++ part there's the full source code for a QT program that will run one or more SMARTS patterns against a set of molecules, split any matches and non-matches into 2 displays side by side and colour the atoms that the SMARTS match. It needs

Re: [Rdkit-discuss] delete a substructure

2017-03-09 Thread Chenyang Shi
Thank you Chris. I found that one too; it is quite convenient to visualize both SMARTS and SMILES strings. On Thu, Mar 9, 2017 at 11:28 AM, Chris Swain wrote: > I use SMARTSviewer at Univ of Hamburg > > http://www.zbh.uni-hamburg.de/en/bioinformatics-server.html > > Chris > > On 9 Mar 2017, at 1

Re: [Rdkit-discuss] delete a substructure

2017-03-09 Thread Chris Swain
I use SMARTSviewer at Univ of Hamburg http://www.zbh.uni-hamburg.de/en/bioinformatics-server.html Chris > On 9 Mar 2017, at 17:21, rdkit-discuss-requ...@lists.sourceforge.net wrote: > > One last question I have is do you guys have co

Re: [Rdkit-discuss] delete a substructure

2017-03-09 Thread Chenyang Shi
smarts.html > 4.4 > > -- > Hongbin Yang > > > *From:* Chenyang Shi > *Date:* 2017-03-09 01:32 > *To:* Greg Landrum > *CC:* rdkit-discuss ; 杨弘宾 > > *Subject:* Re: [Rdkit-discuss] delete a substructure > Dear Hongbin, > > I tried you

Re: [Rdkit-discuss] delete a substructure

2017-03-08 Thread 杨弘宾
romSmiles('[$(Oc)]'))    >>> ((10,),) Then only atom 10 will be matched and it won't interfere with other counts. Reference: http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html  4.4 Hongbin Yang   From: Chenyang ShiDate: 2017-03-09 01:32To: Greg LandrumCC: r

Re: [Rdkit-discuss] delete a substructure

2017-03-08 Thread Pavel Polishchuk
宾 *From:* Chenyang Shi <mailto:cs3...@columbia.edu> *Date:* 2017-03-06 14:04 *To:* Greg Landrum <mailto:greg.land...@gmail.com> *CC:* RDKit Discuss <mailto:rdkit-discuss@lists.sourceforge.net> *Subjec

Re: [Rdkit-discuss] delete a substructure

2017-03-06 Thread Brian Kelley
gt;> m.GetSubstructMatches(OH) >>> >> ((3,),) >>> m.GetSubstructMatchs(COOH) >>> >> ((1, 3, 2),) >>> >>> Since atom "3" has been already matched, it should be ignored. >>> So you can create a "set" to record the matched atoms t

Re: [Rdkit-discuss] delete a substructure

2017-03-06 Thread Chenyang Shi
; has been already matched, it should be ignored. >> So you can create a "set" to record the matched atoms to avoid >> repetitive count. >> >> -- >> Hongbin Yang 杨弘宾 >> >> >> *From:* Chenyang Shi >> >> *D

Re: [Rdkit-discuss] delete a substructure

2017-03-05 Thread Greg Landrum
ed, it should be ignored. > So you can create a "set" to record the matched atoms to avoid repetitive > count. > > -- > Hongbin Yang 杨弘宾 > > > *From:* Chenyang Shi > *Date:* 2017-03-06 14:04 > *To:* Greg Landrum > *CC:* RDKit Disc

Re: [Rdkit-discuss] delete a substructure

2017-03-05 Thread 杨弘宾
Hi, Chenyang,    You don't need to delete the substructure from the molecule. Just check whehter the mapped atoms have been matched. For example: m = Chem.MolFromSmiles('CC(=O)O')OH = Chem.MolFromSmarts('[OH]')COOH = Chem.MolFromSmarts('C(O)=O') m.GetSubstructMatches(OH)>> ((3,),)m.GetSubst

Re: [Rdkit-discuss] delete a substructure

2017-03-05 Thread Chenyang Shi
Hi Greg, Thanks for a prompt reply. I did try "GetSubstructMatches()" and it returns correct numbers of substructures for CH3COOH. The potential problem with this approach is that if the molecule is getting complicated, it will possibly generate duplicate numbers for certain functional groups. For

Re: [Rdkit-discuss] delete a substructure

2017-03-05 Thread Greg Landrum
Hi Chenyang, If you're really interested in counting the number of times the substructure appears, you can do that much quicker with `GetSubstructMatches()`: In [2]: m = Chem.MolFromSmiles('CC(C)CCO') In [3]: len(m.GetSubstructMatches(Chem.MolFromSmarts('[CH3;X4]'))) Out[3]: 2 Is that sufficient

[Rdkit-discuss] delete a substructure

2017-03-05 Thread Chenyang Shi
Hi everyone, I am new to rdkit but I am already impressed by its vibrant community. I have a question regarding deleting substructure. In the RDKIT documentation, this is a snippet of code describing how to delete substructure: >>>m = Chem.MolFromSmiles("CC(=O)O") >>>patt = Chem.MolFromSmarts("C(