Re: [OpenBabel-Devel] Convenience functions

2017-03-02 Thread Stefano Forli
Noel, I'm not sure how to describe all the cases with a switch statement. The original idea of using SMARTS came from your suggestion: > The thing is, if I was matching a functional group, I would just use a > SMARTS pattern. This is a general solution for 99% of cases, rather > than having a

Re: [OpenBabel-Devel] Convenience functions

2017-03-02 Thread Noel O'Boyle
The presence of a class or not is an "implementation detail", as they say. That is, the user doesn't need to know anything about that. However, as I am currently replacing the use of SMARTS patterns for atom typers with switch statements, I'd recommend you to avoid using SMARTS for this in the

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

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

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

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

Re: [OpenBabel-Devel] Convenience functions

2017-03-02 Thread Stefano Forli
Noel, thanks for the clarification, the only reason why I was looking at the lazy mechanism was because of previous code. I'm OK with the simple function, although I think there's still a need for a dedicated class behind which gets called to parse the different SMARTS patterns from a data

[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

Re: [OpenBabel-Devel] Convenience functions

2017-03-02 Thread Noel O'Boyle
Typo: "But the guidelines are not unfortunately the existing code. " On 2 March 2017 at 10:22, Noel O'Boyle wrote: > Hi Stefano, > > Sounds good. But the guidelines are not unfortunately the existing > guide. I'm currently in the process of rewriting/removing as much of >

Re: [OpenBabel-Devel] Convenience functions

2017-03-02 Thread Noel O'Boyle
Hi Stefano, Sounds good. But the guidelines are not unfortunately the existing guide. I'm currently in the process of rewriting/removing as much of the croft as possible and the Lazy Evaluation mechanism is in my sights. It's a legacy from the original codebase. It'll be difficult to change this