[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

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

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

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