On 1 July 2010 19:52, Greg Landrum <[email protected]> wrote:
> Dear Cedric,
>
> On Thu, Jul 1, 2010 at 10:52 AM, Cedric MORETTI
> <[email protected]> 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
>> [email protected]
>> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss