From: Peter Murray-R. <pm...@ca...> - 2004-05-20 18:08:11
|
At 16:33 20/05/2004 +0200, Egon Willighagen wrote: >On Thursday 20 May 2004 14:51, Peter Murray-Rust wrote: > > [*] I mailed 2 questions to the CDK list about functionality (double and > > cyclic bonds)- I assume they got there - if they didn't I will remail. It > > seems that discovering functionality is already a problem and we should > > address it. > >I've responded on the second question, but could not quickly find the first >one... Thanks - wasn't sure it had got through as the archive isn't uptodate. The questions included: - is there a simple function to get cyclic bonds? - what does layout do about known cis and trans double bonds? >getAllDoubleBonds(Molecule molecule) is not explicitely in CDK, but is easily >written as: > >AtomContainer bondSet = new AtomContainer(); >Bond[] bonds = molecule.getBonds(); >for (int i=0; i<bonds.length; i++) { > if (bonds[i].getOrder() == CDKConstants.BONDORDER_DOUBLE) { > bondSet.addBond(bonds[i]); > } >} >Bond[] allDoubleBonds = bondSet.getBonds(); Thanks. P. >Egon Peter Murray-Rust Unilever Centre for Molecular Informatics Chemistry Department, Cambridge University Lensfield Road, CAMBRIDGE, CB2 1EW, UK Tel: +44-1223-763069 |