Hi Alex, Can you reduce the code down to as few lines as possible that exhibit the problem? In particular, since the code behind Forcefield is not given, it is difficult to figure out where the problem is.
- Noel On 15 April 2010 15:30, Alexander Klenner <[email protected]> wrote: > Hi all, > > I have a very strange problem using the java OpenBabel library. I have an SDF > File with severals molecules where every molecule has x conformers. I am > using a class to parse these molecules from iMolecule class from CDK > (Chemistry Development Kit) to openBabel. I need to do this since all our > programs are working with CDK and the goal is to pass the CDK mols directly > to openBabel without i/o operations. > > I am using the OpenBabel forcefield (OBForceField) to minimize the > conformers. And here is the strangest thing happening: If I read a second > conformer from the sdf of a molecule and parse it to OpenBabel and the > corresponding forcefield I get this error: > > Invalid memory access of location 0x0 rip=0x1149a2639 > > I only get this error if I parse two different conformations of the same > molecule in a raw to the forcefield(i.e. they only differ in coordinates). I > can minimize hundreds of structures without problems. Also I can alter > between conformations like mol1,mol2,mol1, ... that also works fine, but > whenever I have two conformations of one molecule in my sdf file in a raw( > like mol1_conf1, mol1_conf2,...), the program will terminate and give the > error message mentioned above. I have absolutely no idea why conformations of > the same molecule can cause an error like this... > > I am always dealing with new instances and the CDK-Reader knows nothing about > the molecule it read before. Theres just no way I can imagine why this can > happen. > > Here is the code of the method I use: > > ----------- > > public void testCase() throws IOException, Exception { > > > System.load("/Users/aklenner/Modlab/Java-Projekte/OpenBable/openbabel-2.2.3/scripts/java/libopenbabel.jnilib"); > > IteratingMolFileReader imfr = new > IteratingMolFileReader("input_confomers.sdf"); > ForceField ff=null; > OBMol mol=null; > > while(imfr.hasNext()) { > > mol > =MoleculeConvertingFactory.convertCDKMoltoBabelMol(imfr.readNextMol()); > ff = new ForceField("MMFF94",mol); > ff.ConjugateGradient(1000, true); > > } > > } > ----------- > MoleculeConvertingFactory.convertCDKMoltoBabelMol() returns an OBMol; > ForceField is just a container for the OBForceField > and ConjugateGradient just calls the same method for OBForceField. I also > tried to use the 'native' classes without the container- same problem. > > Again, if 'input_confomers.sdf' only has one conformation each or the > conformations are altered the minimization works perfect. > > Any idea or help is appreciated, > > Thanks, > > Alex > > > -- > ETH Zurich > Dipl.-Bioinf. Alexander G. Klenner > Institute of Pharmaceutical Sciences > HCI G 496 > Wolfgang-Pauli-Str. 10 > 8093 Zürich > SWITZERLAND > > +41 44 633 74 23 phone > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > OpenBabel-scripting mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ OpenBabel-scripting mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
