> 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 least two Hs and is more versatile in substructure searches.
> Would there be any objections to me changing it in the development code?
It seems I accidentally replied only to Chris. Here's what I wrote a few days
ago:
> No, don't replace it. That would be a different option. They're not the
> same, and we rely on the current behavior. They might both be good
> options, but don't replace the current behavior. When someone wants
> [CH2] exactly, the [H]C[H] option is wrong.
And I'll add the converse: If someone wants the [H]C[H] option, then [CH2] is
wrong.
That said, it's my opinion that using explicit H atoms in a SMARTS is not a
great way to go because of the way that different toolkits interpret it (see
discussion a couple years ago on "implicit versus explicit H" and SMARTS).
There's always a way to write what you mean using bracket notation using
logical OR or the D and X operators.
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 is the
same.
But that doesn't change the fact that using brackets *should* be a more general
way to do hydrogen counts due to the messiness of "implicit" versus "explicit"
hydrogens.
Craig
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss