On Wed, Jun 1, 2011 at 7:43 AM, Andrew Dalke <[email protected]> wrote: > Hi all, > > I'm working on my poster for ICCS next week. It's about the Chemistry > Toolkit Rosetta. The main part of my poster shows the examples from > > http://ctr.wikia.com/wiki/Heavy_atom_counts_from_an_SD_file > > with commentary. > > The CDK/Java example there was something I wrote about 1.5 years ago, and I > don't know the CDK API that well.
I think the code looks OK > Would one of you all kindly review the code and see if it's appropriate and > idiomatically correct? I know from the CDK/Cinfony example that I could use > > cdk.tools.manipulator.AtomCountainterManipulater().getHeavyAtoms > > but I don't know if that's what people usually use. Didn't realize this function was there - I personally would count the atoms by hand the way you've done it, rather than create a new list just for the heavy atoms > for ( ... mdliter = new ... ; mdliter.hasNext() ) > > while for the atom iterator I have > > for (IAtom a : mol.atoms() ) > > Are there two different forms because I don't know Java well enough? No, the two interfaces are different, but it's a good point - they shouldn't be. I don't think it'd be too difficult to update this to implement Iterable. > And is there a way pass any structure filename and be able to read molecules > from it? There isn't, but there should be. I currently use code in rcdk to do this - but it reads all molecules into memory, rather than provide an iterater to them. See loadMolecules() in https://github.com/rajarshi/cdkr/blob/master/rcdkjar/src/org/guha/rcdk/util/Misc.java -- Rajarshi Guha NIH Chemical Genomics Center ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

