[Rdkit-discuss] read 2 SDF files in the loop

2010-07-01 Thread Cedric MORETTI
Hello all,
I have a little question.
I don't arrive to read 2 SDF files with RDKIT when I use the for loop.

I explain
I have a first sdf files with 1 property and a second with another properties.
I put the second SDMolSupplier instead of suppl and load a sdf file ( look 
exemple)
If I replace the SDMolSupplier by a text file the program don't have a problem.
I just search a writer to read 2 SDF 
Tks
Cedric


reader1 = Chem.SDMolSupplier(C:\Data\scaffold/Total/totalscaffold.sdf.sdf)
writer = Chem.SDWriter(C:\Data\scaffold/Eval/evalcount.sdf)
z = 0
for mol in reader1:
  h = Chem.MolToSmiles(mol)

  suppl = open('C:\Data\scaffold/Total/total.txt','r')

  for a in suppl:
r = 0
r+=1



**
DISCLAIMER
This email and any files transmitted with it, including replies and forwarded 
copies (which may contain alterations) subsequently transmitted from Firmenich, 
are confidential and solely for the use of the intended recipient. The contents 
do not represent the opinion of Firmenich except to the extent that it relates 
to their official business.
**

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Q2 2010 Release

2010-07-01 Thread Greg Landrum
On Thu, Jul 1, 2010 at 1:38 PM, Evgueni Kolossov ekolos...@gmail.com wrote:
 Greg,
 looking like it cannot be done with cmake without python installed.
 I have cygwin installed but cmake cannot find BISON and FLEX and complaining
 about python executable. Any suggestions?

The python part should be easy: after you configure the first time,
untick the RDK_BUILD_PYTHON_WRAPPERS box and then configure again.

flex and bison should be found if they are in your PATH. Please check
that they are.

-greg

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Q2 2010 Release

2010-07-01 Thread Evgueni Kolossov
Dear Greg,

I was sure bison and flex are part of cygwin installation but cannot find
executables.
Can you suggest anything?

Regards,
Evgueni

On 1 July 2010 13:06, Greg Landrum greg.land...@gmail.com wrote:

 On Thu, Jul 1, 2010 at 1:38 PM, Evgueni Kolossov ekolos...@gmail.com
 wrote:
  Greg,
  looking like it cannot be done with cmake without python installed.
  I have cygwin installed but cmake cannot find BISON and FLEX and
 complaining
  about python executable. Any suggestions?

 The python part should be easy: after you configure the first time,
 untick the RDK_BUILD_PYTHON_WRAPPERS box and then configure again.

 flex and bison should be found if they are in your PATH. Please check
 that they are.

 -greg

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Q2 2010 Release

2010-07-01 Thread Noel O'Boyle
On 1 July 2010 13:43, Evgueni Kolossov ekolos...@gmail.com wrote:
 Dear Greg,

 I was sure bison and flex are part of cygwin installation but cannot find
 executables.
 Can you suggest anything?

Run cygwin setup, and type bison into the search box.

 Regards,
 Evgueni

 On 1 July 2010 13:06, Greg Landrum greg.land...@gmail.com wrote:

 On Thu, Jul 1, 2010 at 1:38 PM, Evgueni Kolossov ekolos...@gmail.com
 wrote:
  Greg,
  looking like it cannot be done with cmake without python installed.
  I have cygwin installed but cmake cannot find BISON and FLEX and
  complaining
  about python executable. Any suggestions?

 The python part should be easy: after you configure the first time,
 untick the RDK_BUILD_PYTHON_WRAPPERS box and then configure again.

 flex and bison should be found if they are in your PATH. Please check
 that they are.

 -greg



 --
 This SF.net email is sponsored by Sprint
 What will you do first with EVO, the first 4G phone?
 Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Q2 2010 Release

2010-07-01 Thread Evgueni Kolossov
Dear Noel,
Thank you very much - done upgrade anyway and now can find bison and flex

Regards,
Evgueni

On 1 July 2010 13:45, Noel O'Boyle baoille...@gmail.com wrote:

 On 1 July 2010 13:43, Evgueni Kolossov ekolos...@gmail.com wrote:
  Dear Greg,
 
  I was sure bison and flex are part of cygwin installation but cannot find
  executables.
  Can you suggest anything?

 Run cygwin setup, and type bison into the search box.

  Regards,
  Evgueni
 
  On 1 July 2010 13:06, Greg Landrum greg.land...@gmail.com wrote:
 
  On Thu, Jul 1, 2010 at 1:38 PM, Evgueni Kolossov ekolos...@gmail.com
  wrote:
   Greg,
   looking like it cannot be done with cmake without python installed.
   I have cygwin installed but cmake cannot find BISON and FLEX and
   complaining
   about python executable. Any suggestions?
 
  The python part should be easy: after you configure the first time,
  untick the RDK_BUILD_PYTHON_WRAPPERS box and then configure again.
 
  flex and bison should be found if they are in your PATH. Please check
  that they are.
 
  -greg
 
 
 
 
 --
  This SF.net email is sponsored by Sprint
  What will you do first with EVO, the first 4G phone?
  Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
  ___
  Rdkit-discuss mailing list
  Rdkit-discuss@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
 
 

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] read 2 SDF files in the loop

2010-07-01 Thread Noel O'Boyle
On 1 July 2010 19:52, Greg Landrum greg.land...@gmail.com wrote:
 Dear Cedric,

 On Thu, Jul 1, 2010 at 10:52 AM, Cedric MORETTI
 cedric.more...@firmenich.com wrote:
 Hello all,

 I have a little question.

 I don’t arrive to read 2 SDF files with RDKIT when I use the for loop.

 I explain

 I have a first sdf files with 1 property and a second with another
 properties.

 I put the second SDMolSupplier instead of “suppl” and load a sdf file ( look
 exemple)

 I think what you want is something like the following:

 suppl1 = Chem.SDMolSupplier('file1.sdf')
 suppl2 = Chem.SDMolSupplier('file2.sdf')

 for mol1 in suppl1:
  mol2 = suppl2.next()
  # do something with the two molecules

Maybe for mol1, mol2 in zip(suppl1, suppl2): ?


 Best Regards,
 -greg




 If I replace the SDMolSupplier by a text file the program don’t have a
 problem.

 I just search a writer to read 2 SDF ….

 Tks

 Cedric





 reader1 = Chem.SDMolSupplier(C:\Data\scaffold/Total/totalscaffold.sdf.sdf)

 writer = Chem.SDWriter(C:\Data\scaffold/Eval/evalcount.sdf)

 z = 0

 for mol in reader1:

   h = Chem.MolToSmiles(mol)



   suppl = open('C:\Data\scaffold/Total/total.txt','r')



   for a in suppl:

     r = 0

     r+=1





 **
 DISCLAIMER
 This email and any files transmitted with it, including replies and
 forwarded copies (which may contain alterations) subsequently transmitted
 from Firmenich, are confidential and solely for the use of the intended
 recipient. The contents do not represent the opinion of Firmenich except to
 the extent that it relates to their official business.
 **


 --
 This SF.net email is sponsored by Sprint
 What will you do first with EVO, the first 4G phone?
 Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



 --
 This SF.net email is sponsored by Sprint
 What will you do first with EVO, the first 4G phone?
 Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] read 2 SDF files in the loop

2010-07-01 Thread Greg Landrum
On Thu, Jul 1, 2010 at 9:01 PM, Noel O'Boyle baoille...@gmail.com wrote:

 I think what you want is something like the following:

 suppl1 = Chem.SDMolSupplier('file1.sdf')
 suppl2 = Chem.SDMolSupplier('file2.sdf')

 for mol1 in suppl1:
  mol2 = suppl2.next()
  # do something with the two molecules

 Maybe for mol1, mol2 in zip(suppl1, suppl2): ?


That's a really nice and clean way of spelling it, but a bit of a
disaster when the files are large: zip(a,b) creates the whole joined
list at once, it's not a generator (at least with python 2.5).

What this means to those of you who don't get excited about these
things is that Noel's form reads all the molecules from both suppliers
into memory and then loops over them. The form I originally proposed
only has two molecules in memory at a time.

Best Regards,
-greg

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] read 2 SDF files in the loop

2010-07-01 Thread Greg Landrum
On Thu, Jul 1, 2010 at 9:26 PM, Noel O'Boyle baoille...@gmail.com wrote:

 Two molecules in memory, eh? I raise you the complicated itertools module:

 import itertools
 for mol1, mol2, in itertools.izip(suppl1, suppl2):

This is the cleanest of the approaches yet; thanks Noel!

-greg

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss