Re: [OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-06 Thread Noel O'Boyle
The discussion over at opensmiles was that both forms are reasonable and
Geoff prefers the current behavior, so I'll stick to that.

On Thursday, 2 March 2017, Andrew Dalke  wrote:

> On Mar 2, 2017, at 21:31, Andrew Dalke  > wrote:
> >> In practice, one chemist might represent nitromethane as C[N+](=O)[O-]
> with a nitrogen of valence 3 in a charge-separated structure while another
> might represent it as CN(=O)=O with a neutral 5-valent nitrogen. Which
> SMILES is correct? Both are.
>
> I'm sorry. I sent that without fully double-checking/proof-reading. That
> is not a counter-example.
>
> I'll see if I can find an actual counter-example.
>
> I still think it should be changed.
>
>
> Andrew
> da...@dalkescientific.com 
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> OpenBabel-Devel mailing list
> OpenBabel-Devel@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-02 Thread Noel O'Boyle
To avoid multiple threads, let's move this over to the opensmiles list.

On 2 March 2017 at 20:31, Andrew Dalke  wrote:
> On Mar 2, 2017, at 20:34, Craig James  wrote:
>> Well, "FIF" violates the OpenSMILES spec in section 3.1.5, which states that 
>> the "organic subset" are only allowed outside of brackets if they're in 
>> their normal lowest-valence state. Actually, now that I read it, it's not 
>> well written and has room for (mis)interpretation. The phrase that I think 
>> applies in OpenSMILES is:
>
> My understanding of Daylight SMILES is that when the explicit valence based 
> on the bonds is higher than the maximum natural valence then the deduced 
> hydrogen count is 0.
>
> For example, quoting 
> http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html 
> :
>
>> In practice, one chemist might represent nitromethane as C[N+](=O)[O-] with 
>> a nitrogen of valence 3 in a charge-separated structure while another might 
>> represent it as CN(=O)=O with a neutral 5-valent nitrogen. Which SMILES is 
>> correct? Both are.
>
>
>
>
> On Mar 2, 2017, at 20:34, Craig James  wrote:
>> If you can say, "It's obvious ...", and this is a feature everyone would 
>> like, then the OpenSMILES spec could be changed.
>
> I think it should be changed.
>
> Andrew
> da...@dalkescientific.com
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> OpenBabel-Devel mailing list
> OpenBabel-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-02 Thread Andrew Dalke
On Mar 2, 2017, at 20:34, Craig James  wrote:
> Well, "FIF" violates the OpenSMILES spec in section 3.1.5, which states that 
> the "organic subset" are only allowed outside of brackets if they're in their 
> normal lowest-valence state. Actually, now that I read it, it's not well 
> written and has room for (mis)interpretation. The phrase that I think applies 
> in OpenSMILES is:

My understanding of Daylight SMILES is that when the explicit valence based on 
the bonds is higher than the maximum natural valence then the deduced hydrogen 
count is 0.

For example, quoting 
http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html :

> In practice, one chemist might represent nitromethane as C[N+](=O)[O-] with a 
> nitrogen of valence 3 in a charge-separated structure while another might 
> represent it as CN(=O)=O with a neutral 5-valent nitrogen. Which SMILES is 
> correct? Both are.




On Mar 2, 2017, at 20:34, Craig James  wrote:
> If you can say, "It's obvious ...", and this is a feature everyone would 
> like, then the OpenSMILES spec could be changed.

I think it should be changed.

Andrew
da...@dalkescientific.com



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-02 Thread Noel O'Boyle
Hi Craig,

>From what you say, it sounds like this is a better discussion for the
OpenSMILES list. My intention is to match existing usage and what I
believe to be Daylight usage. Let's have this discussion over there,
and can clarify the spec either way depending on the outcome.

- Noel



On 2 March 2017 at 19:34, Craig James  wrote:
> Hi Noel,
>
> On Thu, Mar 2, 2017 at 10:11 AM, Noel O'Boyle  wrote:
>>
>> In the course of sorting out the handling of implicit Hs, I've found
>> that the current SMILES writer writes hypervalent atoms from the
>> organic subset in square brackets. E.g. Texas carbons:
>>
>> >obabel -:C(C)(C)(C)(C)C -osmi
>> [C](C)(C)(C)(C)C
>>
>> or "FIF" as "F[I]F".
>>
>> This is unusual behaviour compared to other toolkits and I think lack
>> of brackets are preferred where possible, so I've changed this (on my
>> branch). If this is an issue for anyone, now's the time to duke it
>> out.
>
>
> Well, "FIF" violates the OpenSMILES spec in section 3.1.5, which states that
> the "organic subset" are only allowed outside of brackets if they're in
> their normal lowest-valence state. Actually, now that I read it, it's not
> well written and has room for (mis)interpretation. The phrase that I think
> applies in OpenSMILES is:
>
> An atom is specified [without brackets] has the following properties:
>
> "implicit hydrogens" are added such that valence of the atom is in the
> lowest normal state for that element
>
> You might argue from this that since you don't have to add any hydrogens,
> it's clear what it means. But someone else might say, "you have to add
> charge to balance it."
>
> Daylight's page is more clear. It says:
>
> ... the "organic subset" B, C, N, O, P, S, F, Cl, Br, and I may be written
> without brackets if the number of attached hydrogens conforms to the lowest
> normal valence consistent with explicit bonds.
>
>
> If you can say, "It's obvious ...", and this is a feature everyone would
> like, then the OpenSMILES spec could be changed.
>
> Craig
>
>>
>>
>> - Noel
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> OpenBabel-Devel mailing list
>> OpenBabel-Devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-02 Thread Craig James
Hi Noel,

On Thu, Mar 2, 2017 at 10:11 AM, Noel O'Boyle  wrote:

> In the course of sorting out the handling of implicit Hs, I've found
> that the current SMILES writer writes hypervalent atoms from the
> organic subset in square brackets. E.g. Texas carbons:
>
> >obabel -:C(C)(C)(C)(C)C -osmi
> [C](C)(C)(C)(C)C
>
> or "FIF" as "F[I]F".
>
> This is unusual behaviour compared to other toolkits and I think lack
> of brackets are preferred where possible, so I've changed this (on my
> branch). If this is an issue for anyone, now's the time to duke it
> out.
>

Well, "FIF" violates the OpenSMILES spec in section 3.1.5, which states
that the "organic subset" are only allowed outside of brackets if they're
in their normal lowest-valence state. Actually, now that I read it, it's
not well written and has room for (mis)interpretation. The phrase that I
think applies in OpenSMILES is:

An atom is specified [without brackets] has the following properties:


   - "implicit hydrogens" are added such that valence of the atom is in the
   lowest normal state for that element

You might argue from this that since you don't have to add any hydrogens,
it's clear what it means. But someone else might say, "you have to add
charge to balance it."

Daylight's page
 is more
clear. It says:

... the "organic subset" B, C, N, O, P, S, F, Cl, Br, and I may be written
without brackets if the number of attached hydrogens conforms to the lowest
normal valence consistent with explicit bonds.


If you can say, "It's obvious ...", and this is a feature everyone would
like, then the OpenSMILES spec could be changed.

Craig


>
> - Noel
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> OpenBabel-Devel mailing list
> OpenBabel-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


[OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-02 Thread Noel O'Boyle
Hi there,

In the course of sorting out the handling of implicit Hs, I've found
that the current SMILES writer writes hypervalent atoms from the
organic subset in square brackets. E.g. Texas carbons:

>obabel -:C(C)(C)(C)(C)C -osmi
[C](C)(C)(C)(C)C

or "FIF" as "F[I]F".

This is unusual behaviour compared to other toolkits and I think lack
of brackets are preferred where possible, so I've changed this (on my
branch). If this is an issue for anyone, now's the time to duke it
out.

- Noel

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel