Re: [Rdkit-discuss] Find out if a molecuole object was generated from smiles or smarts

2016-11-07 Thread Axel Pahl

Thanks, Greg.

This is exactly what I was looking for.

KR Axel

On 07.11.2016 15:18, Greg Landrum wrote:
Brian is exactly right: atoms (or bonds) constructed from SMARTS will 
have queries, and so HasQuery() will return True. This is not true of 
atoms (or bonds) that are constructed from SMILES.


-greg


On Mon, Nov 7, 2016 at 2:23 PM, Brian Kelley > wrote:


I would try checking:

atom.HasQuery()

I expect the smarts molecules have this property by default and
smiles don't.  Greg can confirm, and I can double check later today.


Brian Kelley

> On Nov 7, 2016, at 7:57 AM, Paul Emsley
> wrote:
>
>> On 07/11/2016 12:37, Axel Pahl wrote:
>>
>> amongst other options, I can generate an RDKit mol object by one of
>> these two ways:
>>
>> mol1 = Chem.MolFromSmiles()
>> mol2 = Chem.MolFromSmarts()
>>
>> Is there a possibility to detect for a given mol object whether
it was
>> generated from Smiles or Smarts?
>
> Not obviously to me.
>
> Perhaps you can do something like this at creation time:
>
> mol2.SetProp('origin', 'SMARTS')
>
> then use mol.GetProp('origin') when you need to do the test
(inside a try/except KeyError).
>
> Paul.
>
>
>

--
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net

> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/rdkit-discuss





--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Find out if a molecuole object was generated from smiles or smarts

2016-11-07 Thread Greg Landrum
Brian is exactly right: atoms (or bonds) constructed from SMARTS will have
queries, and so HasQuery() will return True. This is not true of atoms (or
bonds) that are constructed from SMILES.

-greg


On Mon, Nov 7, 2016 at 2:23 PM, Brian Kelley  wrote:

> I would try checking:
>
> atom.HasQuery()
>
> I expect the smarts molecules have this property by default and smiles
> don't.  Greg can confirm, and I can double check later today.
>
> 
> Brian Kelley
>
> > On Nov 7, 2016, at 7:57 AM, Paul Emsley 
> wrote:
> >
> >> On 07/11/2016 12:37, Axel Pahl wrote:
> >>
> >> amongst other options, I can generate an RDKit mol object by one of
> >> these two ways:
> >>
> >> mol1 = Chem.MolFromSmiles()
> >> mol2 = Chem.MolFromSmarts()
> >>
> >> Is there a possibility to detect for a given mol object whether it was
> >> generated from Smiles or Smarts?
> >
> > Not obviously to me.
> >
> > Perhaps you can do something like this at creation time:
> >
> > mol2.SetProp('origin', 'SMARTS')
> >
> > then use mol.GetProp('origin') when you need to do the test (inside a
> try/except KeyError).
> >
> > Paul.
> >
> >
> > 
> --
> > Developer Access Program for Intel Xeon Phi Processors
> > Access to Intel Xeon Phi processor-based developer platforms.
> > With one year of Intel Parallel Studio XE.
> > Training and support from Colfax.
> > Order your platform today. http://sdm.link/xeonphi
> > ___
> > Rdkit-discuss mailing list
> > Rdkit-discuss@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
> 
> --
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Find out if a molecuole object was generated from smiles or smarts

2016-11-07 Thread Brian Kelley
I would try checking:

atom.HasQuery()

I expect the smarts molecules have this property by default and smiles don't.  
Greg can confirm, and I can double check later today.


Brian Kelley

> On Nov 7, 2016, at 7:57 AM, Paul Emsley  wrote:
> 
>> On 07/11/2016 12:37, Axel Pahl wrote:
>> 
>> amongst other options, I can generate an RDKit mol object by one of
>> these two ways:
>> 
>> mol1 = Chem.MolFromSmiles()
>> mol2 = Chem.MolFromSmarts()
>> 
>> Is there a possibility to detect for a given mol object whether it was
>> generated from Smiles or Smarts?
> 
> Not obviously to me.
> 
> Perhaps you can do something like this at creation time:
> 
> mol2.SetProp('origin', 'SMARTS')
> 
> then use mol.GetProp('origin') when you need to do the test (inside a 
> try/except KeyError).
> 
> Paul.
> 
> 
> --
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Find out if a molecuole object was generated from smiles or smarts

2016-11-07 Thread Paul Emsley
On 07/11/2016 12:37, Axel Pahl wrote:
>
> amongst other options, I can generate an RDKit mol object by one of
> these two ways:
>
> mol1 = Chem.MolFromSmiles()
> mol2 = Chem.MolFromSmarts()
>
> Is there a possibility to detect for a given mol object whether it was
> generated from Smiles or Smarts?

Not obviously to me.

Perhaps you can do something like this at creation time:

mol2.SetProp('origin', 'SMARTS')

then use mol.GetProp('origin') when you need to do the test (inside a 
try/except KeyError).

Paul.


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss