From: Rajarshi G. <raj...@gm...> - 2011-08-01 04:45:21
|
Hi, thanks for catching this. Would you mind sending a diff of your patch? My mail client removed your formatting and so I can't see the changes easily On Jul 31, 2011, at 10:28 PM, Yap Chun Wei wrote: > Dear Rajarshi and Egon, > > One of my collaborators is having trouble reading hyperchem files > (HIN files) with CDK. As I was tracing through the code, I noticed > that the code to identify aromatic atoms and bonds in the > HINReader.java may not be correct. I have modified it as shown below > (lines which were changed were highlighted in red). I am not sure > whether this modification is correct but it is working for me so far. > > Best regards, > Chun Wei > > case 'a': > bo = IBond.Order.SINGLE; > atom.setFlag(CDKConstants.ISAROMATIC, > true); > break; > } > List<Object> ar = new ArrayList<Object>(3); > ar.add(atomSerial); > ar.add(s); > ar.add(bo); > cons.add( ar ); > } > m.addAtom(atom); > atomSerial++; > line = input.readLine(); > } > > // now just store all the bonds we have > for (List<Object> ar : cons) { > IAtom s = m.getAtom((Integer) ar.get(0)); > IAtom e = m.getAtom((Integer) ar.get(1)); > IBond.Order bo = (IBond.Order) ar.get(2); > if (!isConnected(m, s, e)) > { > IBond newBond = null; > if (s.getFlag(CDKConstants.ISAROMATIC) || > e.getFlag(CDKConstants.ISAROMATIC)) > { > newBond = > file.getBuilder().newInstance(IBond.class,s, e, bo); > newBond.setFlag(CDKConstants.ISAROMATIC, > true); > } > else > { > newBond = > file.getBuilder().newInstance(IBond.class,s, e, bo); > } > m.addBond(newBond); > } > } > <winmail.dat> ---------------------------------------------------- Rajarshi Guha | NIH Chemical Genomics Center http://www.rguha.net | http://ncgc.nih.gov ---------------------------------------------------- Mathematics consists of proving the most obvious thing in the least obvious way. -- George Polya |