On Jan 28, 2011, at 3:06 AM, Craig A. James wrote:
> However, OpenBabel seems to fall flat on SMARTS like this: [CH2,CH3,CH4]
>
> $ echo "OCO" | obgrep '[CH2,CH3,CH4]'
> $ echo "O[CH2]O" | obgrep '[CH2,CH3,CH4]'
> OCO
>
> Both of these should return the same answer since the input molecule
Dear all,
I want to thank you again: combining Andrew and Craig answer, I was
able to go a step further and convert e.g. a urea into :
[CH3][CH2][C,N,O][C,N,O][C,N,O]
which is exactly the kind of smarts I wanted for my analogs search. At
least at this stage of my reflexion :)
Regards,
Pascal
-
> On Jan 26, 2011, at 11:54 AM, Chris Morley wrote:
> As may have been discussed here earlier, maybe this option should output
> explicit hydrogen as [H] rather than a hydrogen count on another atom.
> SMARTS [CH2] matches a C with exactly two Hs; SMARTS [H]C[H] will match a
> carbon with at lea
Dear all,
Thanks for your answers!
I have no objection to Chris' code modification proposal.
With Craig's suggestion and Noel's blog (so useful for code
inspiration (plagiarism...) - at least for me :), I got this working
with pybel:
conv = ob.OBConversion()
conv.SetInAndOutFormats("smi", "can"
On Jan 26, 2011, at 11:54 AM, Chris Morley wrote:
> As may have been discussed here earlier, maybe this option should output
> explicit hydrogen as [H] rather than a hydrogen count on another atom.
> SMARTS [CH2] matches a C with exactly two Hs; SMARTS [H]C[H] will match a
> carbon with at leas
On 26/01/2011 01:16, Craig A. James wrote:
On 1/25/11 3:33 PM, Andrew Dalke wrote:
On Jan 25, 2011, at 4:01 PM, Pascal Muller wrote:
Using pybel, I would like to generate a smarts with explicit H before
doing a substructure search.
...
scaffoldSmiles = mol.write("can")
scaffoldSmarts = p
On 1/25/11 3:33 PM, Andrew Dalke wrote:
> On Jan 25, 2011, at 4:01 PM, Pascal Muller wrote:
>> Using pybel, I would like to generate a smarts with explicit H before
>> doing a substructure search.
>
> ...
>> scaffoldSmiles = mol.write("can")
>> scaffoldSmarts = pybel.Smarts(scaffoldSmiles)
>
>
On Jan 25, 2011, at 4:01 PM, Pascal Muller wrote:
> Using pybel, I would like to generate a smarts with explicit H before
> doing a substructure search.
...
> scaffoldSmiles = mol.write("can")
> scaffoldSmarts = pybel.Smarts(scaffoldSmiles)
The problem is this the write("can") step. It convert
Dear all,
Using pybel, I would like to generate a smarts with explicit H before
doing a substructure search.
Actually, I'm seeking analogs of a reference molecule - let's say HO-CH2-NH2.
I want to keep the HO-CH2 part (the "scaffold").
I delete the NH2 and generate the smarts for HO-CH2 (and I ho