Hi JP, Maybe a comment since I ran into this before - you will loose the properties of a molecule when just using the MolBlock.
Cheers Nik -----Original Message----- From: Greg Landrum [mailto:[email protected]] Sent: Tuesday, May 17, 2011 6:10 AM To: JP Cc: [email protected] Subject: Re: [Rdkit-discuss] Write SDF as a string instead of two file Dear JP, On Mon, May 16, 2011 at 7:56 PM, JP <[email protected]> wrote: > Quick one. > > I have the following which writes to an .sdf file: > > w = AllChem.SDWriter(output_file) > for mol in molecules: > confIds = [c.GetId() for c in mol.GetConformers()] > for cid in confIds: > w.write(mol, confId=cid) > w.close() > > Now, what I would like is instead of writing to a file - I would like > to "write" to a string (so I can zip the output using the zlib > library). At the moment this is not possible. SDWriters can only write to named files. It would be a useful feature and I think it should be possible, but I'm going to have to do some research. > Do I just need to get the MolBlock and interleave the varies entries with > $$$$ ? That will definitely work. -greg ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

