Re: [Rdkit-discuss] name generator

2013-08-28 Thread Markus Sitzmann

Hi Sergio,there may be random entries in the Resolver database behind http://cactus.nci.nih.gov/chemical/structure but definitelynothing systematic.MarkusOn Wed, 28 Aug 2013 07:54:26 -0400, Sergio Martinez Cuesta  wrote:Thanks Greg,I agree, it certainly works for molecules, however I am testing whether cactus is able to provide names to molecular fragments as well. Things like methyl phosphinite (COP) are named after that. 
See:http://cactus.nci.nih.gov/chemical/structure/COP/iupac_nameDo you have any hints on systematically naming molecular fragments?
On 28 August 2013 05:53, Greg Landrum  wrote:
On Tue, Aug 27, 2013 at 10:32 PM, Sergio Martinez Cuesta  wrote:


Oc(:[nH2]):[nH2] does not seem to be in the databasehttp://cactus.nci.nih.gov/chemical/structure/Oc(:[nH2]):[nH2]/iupac_name



molcovert does not generate a name either.That's not actually a stable molecule. it is, at best, a piece of a molecule. OC(N)N works fine with the NCI lookup.


What molecule are you trying to name?-greg

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] how to make Compute2DCoords respecting coords from molfile

2013-08-28 Thread Michał Nowotka
Thanks Greg, can you explain what is GetConformer?

In [3]: m = Chem.MolFromSmiles('Cc1c1')
In [4]: CoordsAreAllZero(m)

---
ValueErrorTraceback (most recent call last)
/home/mnowotka/Documents/ci/curation_interface/trunk/src/curation_interface/
in ()
> 1 CoordsAreAllZero(m)

/home/mnowotka/Documents/ci/curation_interface/trunk/src/curation_interface/
in CoordsAreAllZero(m, confId)
  1 def CoordsAreAllZero(m,confId=-1):
> 2 conf = m.GetConformer(confId)
  3 for i in range(m.GetNumAtoms()):
  4 if list(conf.GetAtomPosition(i))!=[0.0,0.0,0.0]:
  5 return False

ValueError: Bad Conformer Id


On Wed, Aug 28, 2013 at 1:20 PM, Greg Landrum wrote:

> Hi Michal,
>
>
> On Wed, Aug 28, 2013 at 1:16 PM, Michał Nowotka  wrote:
>
>> Imagine this scenario:
>>
>> I read random molfile and I want to produce an image of it:
>>
>> 1. If the molfile already contains coordinates, use them
>> 2. If the molfile coordinates are all zeros, compute them
>>
>> I don't know how to check if Mol (python object) has coordinates without
>> parsing original molfile, which doesn't seem to be a good idea.
>> And Compute2DCoords doesn't respect coordinates but computes them from
>> scratch.
>>
>> So, do you know any way to check if Mol (python object) already contains
>> not trivial (all zeros) coordinates, so I can call Compute2DCorrds only on
>> those of them which doesn't have coords?
>>
>>
> There's no easy way I can think of that's built in, but you could do
> something like this:
>
> In [19]: def CoordsAreAllZero(m,confId=-1):
>: conf = m.GetConformer(confId)
>: for i in range(m.GetNumAtoms()):
>: if list(conf.GetAtomPosition(i))!=[0.0,0.0,0.0]:
>: return False
>: return True
>:
>
> In [20]: print mb
>
>  RDKit
>
>   2  1  0  0  0  0  0  0  0  0999 V2000
> 0.0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
> 0.0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
>   1  2  1  0
> M  END
>
> In [21]: m = Chem.MolFromMolBlock(mb)
>
> In [22]: CoordsAreAllZero(m)
> Out[22]: True
>
> In [25]: AllChem.Compute2DCoords(m)
> Out[25]: 0
>
> In [26]: CoordsAreAllZero(m)
> Out[26]: False
>
>
> That ought to work at least most of the time.
>
> -greg
>
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] how to make Compute2DCoords respecting coords from molfile

2013-08-28 Thread Greg Landrum
Hi Michal,


On Wed, Aug 28, 2013 at 1:16 PM, Michał Nowotka  wrote:

> Imagine this scenario:
>
> I read random molfile and I want to produce an image of it:
>
> 1. If the molfile already contains coordinates, use them
> 2. If the molfile coordinates are all zeros, compute them
>
> I don't know how to check if Mol (python object) has coordinates without
> parsing original molfile, which doesn't seem to be a good idea.
> And Compute2DCoords doesn't respect coordinates but computes them from
> scratch.
>
> So, do you know any way to check if Mol (python object) already contains
> not trivial (all zeros) coordinates, so I can call Compute2DCorrds only on
> those of them which doesn't have coords?
>
>
There's no easy way I can think of that's built in, but you could do
something like this:

In [19]: def CoordsAreAllZero(m,confId=-1):
   : conf = m.GetConformer(confId)
   : for i in range(m.GetNumAtoms()):
   : if list(conf.GetAtomPosition(i))!=[0.0,0.0,0.0]:
   : return False
   : return True
   :

In [20]: print mb

 RDKit

  2  1  0  0  0  0  0  0  0  0999 V2000
0.0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
0.0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
M  END

In [21]: m = Chem.MolFromMolBlock(mb)

In [22]: CoordsAreAllZero(m)
Out[22]: True

In [25]: AllChem.Compute2DCoords(m)
Out[25]: 0

In [26]: CoordsAreAllZero(m)
Out[26]: False


That ought to work at least most of the time.

-greg
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] name generator

2013-08-28 Thread Sergio Martinez Cuesta
Thanks Greg,

I agree, it certainly works for molecules, however I am testing whether
cactus is able to provide names to molecular fragments as well. Things
like methyl phosphinite (COP) are named after that.

See:
http://cactus.nci.nih.gov/chemical/structure/COP/iupac_name

Do you have any hints on systematically naming molecular fragments?








On 28 August 2013 05:53, Greg Landrum  wrote:

>
> On Tue, Aug 27, 2013 at 10:32 PM, Sergio Martinez Cuesta <
> sermar...@gmail.com> wrote:
>
>> Oc(:[nH2]):[nH2] does not seem to be in the database
>>
>> http://cactus.nci.nih.gov/chemical/structure/Oc(:[nH2]):[nH2]/iupac_name
>>
>> molcovert does not generate a name either.
>>
>
> That's not actually a stable molecule. it is, at best, a piece of a
> molecule. OC(N)N works fine with the NCI lookup.
> What molecule are you trying to name?
>
> -greg
>
>
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] USR/USRCAT implementation in RDKit

2013-08-28 Thread sereina riniker
Dear all,

A c++ implementation and Python wrappers of the ultrafast shape recognition
(USR) descriptor (Ballester and Richards, J. Comput. Chem. (2007), 28,
1711) and the USR CREDO atom types (USRCAT) descriptor (Schreyer and
Blundell, J. Cheminf. (2012), 4, 27) are now available for the RDKit. The
code is based on the Python implementations of Jan Domanski and Adrian
Schreyer.

The descriptors can be accessed from Python via
rdkit.Chem.rdMolDescriptors.GetUSR and
rdkit.Chem.rdMolDescriptors.GetUSRCAT.

Best regards,
Sereina
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] how to make Compute2DCoords respecting coords from molfile

2013-08-28 Thread Michał Nowotka
Imagine this scenario:

I read random molfile and I want to produce an image of it:

1. If the molfile already contains coordinates, use them
2. If the molfile coordinates are all zeros, compute them

I don't know how to check if Mol (python object) has coordinates without
parsing original molfile, which doesn't seem to be a good idea.
And Compute2DCoords doesn't respect coordinates but computes them from
scratch.

So, do you know any way to check if Mol (python object) already contains
not trivial (all zeros) coordinates, so I can call Compute2DCorrds only on
those of them which doesn't have coords?

Kind regards,
Michal Nowotka
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss