This list is closed, nobody may subscribe to it.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(10) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(3) |
Feb
(10) |
Mar
(5) |
Apr
(12) |
May
(8) |
Jun
(9) |
Jul
(3) |
Aug
(11) |
Sep
|
Oct
(26) |
Nov
(21) |
Dec
(20) |
2007 |
Jan
(10) |
Feb
(32) |
Mar
(14) |
Apr
(13) |
May
(44) |
Jun
(13) |
Jul
(18) |
Aug
(26) |
Sep
(17) |
Oct
(3) |
Nov
(10) |
Dec
(8) |
2008 |
Jan
(20) |
Feb
(8) |
Mar
(28) |
Apr
(18) |
May
(22) |
Jun
(13) |
Jul
(4) |
Aug
(2) |
Sep
(19) |
Oct
(17) |
Nov
(8) |
Dec
(10) |
2009 |
Jan
(4) |
Feb
(3) |
Mar
(12) |
Apr
(15) |
May
(7) |
Jun
(1) |
Jul
(13) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(14) |
Dec
(13) |
2010 |
Jan
(9) |
Feb
(6) |
Mar
(21) |
Apr
(12) |
May
(4) |
Jun
|
Jul
(2) |
Aug
(15) |
Sep
(3) |
Oct
(1) |
Nov
(18) |
Dec
(6) |
2011 |
Jan
(7) |
Feb
(13) |
Mar
(17) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(15) |
Aug
(11) |
Sep
(12) |
Oct
(3) |
Nov
(14) |
Dec
(4) |
2012 |
Jan
(10) |
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: ori k. <ori...@gm...> - 2010-05-12 16:47:41
|
Hi, I've just installed python3.1, open babel 2.2.3 and pybel. I ran the tests for pybel installation and I am getting errors on the ">>>print mol.write("sdf")" command. As advised on the installation website, I am sending you the output from the test commands (see below). What should I do? Best regards, Ori *output from test commands*: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\ginati>cd C:\Documents and Settings\ginati\My Document s\Ori\LEDGF\Libaries C:\Documents and Settings\ginati\My Documents\Ori\XXX\Libaries>babel -V Open Babel 2.2.3 -- Aug 18 2009 -- 16:21:20 C:\Documents and Settings\ginati\My Documents\Ori\XXX\Libaries>babel -Hsdf sdf MDL MOL/SDF format Reads and writes V2000 and V3000 versions Write Options, e.g. -x3 3 output V3000 not V2000 (used for >999 atoms/bonds) m write no properties Input Options, e.g. -av v AtomValue in V line is NOT a partial charge Specification at: http://www.mdl.com/downloads/public/ctfile/ctfile.jsp C:\Documents and Settings\ginati\My Documents\Ori\XXX\Libaries>dir "%BABEL_DAT ADIR%"\OBGUI.exe Volume in drive C has no label. Volume Serial Number is 34F7-04B6 Directory of C:\Program Files\OpenBabel-2.2.3 08/18/2009 06:20 PM 1,253,376 OBGUI.exe 1 File(s) 1,253,376 bytes 0 Dir(s) 180,960,583,680 bytes free C:\Documents and Settings\ginati\My Documents\Ori\LEDGF\Libaries>c:\Python31\pyt hon.exe Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pybel >>> mol = pybel.readstring("smi", "CC(=O)Br") >>> mol.make3D() >>> print mol.write("sdf") File "<stdin>", line 1 print mol.write("sdf") ^ SyntaxError: invalid syntax >>> |
From: Rocco M. <rmoretti@u.washington.edu> - 2010-05-01 17:19:41
|
On 5/1/2010 2:24 AM, Noel O'Boyle wrote: > A vector of OBAtoms is not wrapped by the Python wrappers (other > vectors can be created using the global vector methods - see > dir(openbabel)). Could you describe why you are using this function? > There may be a workaround. I'm trying to use OpenBabel to pre-process files for eventual input into another program. Unfortunately, that program is apparently particular about atom order and naming conventions. I was hoping there was a straightforward way of telling OpenBabel what order and names to use in the output files. > I don't know anything about atom names. If you don't get a reply, > maybe email openbabel-discuss just on that topic. Thanks, -Rocco |
From: Noel O'B. <bao...@gm...> - 2010-05-01 09:24:53
|
A vector of OBAtoms is not wrapped by the Python wrappers (other vectors can be created using the global vector methods - see dir(openbabel)). Could you describe why you are using this function? There may be a workaround. I don't know anything about atom names. If you don't get a reply, maybe email openbabel-discuss just on that topic. - Noel On 28 April 2010 01:45, Rocco Moretti <rmoretti@u.washington.edu> wrote: > Hello, > > I'm using the Python bindings for small molecule analysis and > processing, and am running into a few issues. (with version 2.2.3. I'm > technically importing pybel, but it happens that I'm doing most of my > tweaking at the openbabel level.): > > How does one pack up objects for a function which normally accepts a C++ > vector? For example, OBMol.RenumberAtoms() is listed as taking a > "std::vector< OBAtom * > &" as it's argument. I tried to pass a regular > python list of (Python wrapped) OBAtom objects to the wrapper function, > hoping it would get converted, but that does not seem to work. The wiki > mentions what's needed for functions taking an array of C doubles, but > not a vector of object pointers. > > Also, how does one read/change atom names? I realize not all formats > contain named atoms like PDB does, but, best I can tell, Open Babel can > recognize atom names, at least well enough to round-trip them from pdb > to pdb. Is there any way I can read/change these from within Python? > > Thanks, > Rocco Moretti > Senior Fellow > University of Washington > > ------------------------------------------------------------------------------ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Rocco M. <rmo...@uw...> - 2010-04-30 17:59:14
|
Hello, I'm using the Python bindings for small molecule analysis and processing, and am running into a few issues. (with version 2.2.3. I'm technically importing pybel, but it happens that I'm doing most of my tweaking at the openbabel level.): How does one pack up objects for a function which normally accepts a C++ vector? For example, OBMol.RenumberAtoms() is listed as taking a "std::vector< OBAtom * > &" as it's argument. I tried to pass a regular python list of (Python wrapped) OBAtom objects to the wrapper function, hoping it would get converted, but that does not seem to work. The wiki mentions what's needed for functions taking an array of C doubles, but not a vector of object pointers. Also, how does one read/change atom names? I realize not all formats contain named atoms like PDB does, but, best I can tell, Open Babel can recognize atom names, at least well enough to round-trip them from pdb to pdb. Is there any way I can read/change these from within Python? Thanks, Rocco Moretti Senior Fellow University of Washington |
From: Schneemaus <cl...@ae...> - 2010-04-29 11:32:05
|
Hi Pranav Thakur, could you be so kind to describe your solution? I have the same problem and didn't find any solution yet. Thanks a lot. Best regards Schneemaus -- View this message in context: http://open-babel.957263.n4.nabble.com/The-type-initializer-for-OpenBabel-openbabelcsharpPINVOKE-threw-an-exception-tp2041014p2075300.html Sent from the openbabel-scripting mailing list archive at Nabble.com. |
From: Rocco M. <rmoretti@u.washington.edu> - 2010-04-28 00:46:14
|
Hello, I'm using the Python bindings for small molecule analysis and processing, and am running into a few issues. (with version 2.2.3. I'm technically importing pybel, but it happens that I'm doing most of my tweaking at the openbabel level.): How does one pack up objects for a function which normally accepts a C++ vector? For example, OBMol.RenumberAtoms() is listed as taking a "std::vector< OBAtom * > &" as it's argument. I tried to pass a regular python list of (Python wrapped) OBAtom objects to the wrapper function, hoping it would get converted, but that does not seem to work. The wiki mentions what's needed for functions taking an array of C doubles, but not a vector of object pointers. Also, how does one read/change atom names? I realize not all formats contain named atoms like PDB does, but, best I can tell, Open Babel can recognize atom names, at least well enough to round-trip them from pdb to pdb. Is there any way I can read/change these from within Python? Thanks, Rocco Moretti Senior Fellow University of Washington |
From: Alexander K. <ale...@ph...> - 2010-04-15 18:20:31
|
Hi Noel, here you go: public void testCase3() { IteratingMolFileReader imfr = new IteratingMolFileReader("input_conformes.sdf"); OBForceField ff; while(imfr.hasNext()) { ff = OBForceField.Default(); mol =MoleculeConvertingFactory.convertCDKMoltoBabelMol(imfr.readNextMol()); ff.SetParameterFile("MMFF94"); ff.Setup(mol); ff.ConjugateGradients(1000); } } Same Problem,BUT if i do skip 4 molecules each time ( there are 5 conformations each) like this: public void testCase4() { IteratingMolFileReader imfr = new IteratingMolFileReader("MOMO_working_corina_3d_deionisiert.sdf_socger_out.sdf"); OBForceField ff = OBForceField.Default(); while(imfr.hasNext()) { imfr.readNextMol(); //skipping mols imfr.readNextMol(); imfr.readNextMol(); imfr.readNextMol(); mol =MoleculeConvertingFactory.convertCDKMoltoBabelMol(imfr.readNextMol()); ff.SetParameterFile("MMFF94"); ff.Setup(mol); ff.ConjugateGradients(1000); } } It works perfectly well. I have really small molecules by now for the test cases and still the same error as long as i have conformations in the file .. The parsing should be fine, I exported like 1300 molecules and they all had rmsd 0.0, which means they were exactly the same also had same bond numbers, and atoms, but i attached the classes if you want to take a look. Also, the error always says 0x0 rip=0x114791639, no matter what file or molecules conformation cause it. Greetings, Alex Here is my converting class: public static OBMol convertCDKMoltoBabelMol(Molecule mol) { //generate new OBMol OBMol obMol = new OBMol(); //adding all atoms for (int i = 0; i < mol.getAtomCount(); i++) { obMol.AddAtom(parseCDKAtom((Atom) mol.getAtom(i))); } //adding all bonds for (int i = 0; i < mol.getBondCount(); i++) { obMol.AddBond(parseCDKBond((Bond) mol.getBond(i), i, obMol, mol)); } //calculating all properties return autoCompleteMol(obMol); } public static OBAtom parseCDKAtom(Atom atom) { OBAtom obAtom = new OBAtom(); obAtom.SetVector(atom.getPoint3d().x, atom.getPoint3d().y, atom.getPoint3d().z); obAtom.SetAtomicNum(atom.getAtomicNumber()); obAtom.SetPartialCharge(atom.getCharge()); obAtom.SetFormalCharge(atom.getFormalCharge()); obAtom.SetHyb(atom.getHybridization()); return obAtom; } public static OBBond parseCDKBond(Bond bond, int index, OBMol obmol, Molecule mol) { OBBond obBond = new OBBond(); obBond.Set(index + 1, obmol.GetAtom(mol.getAtomNumber(bond.getAtom(0)) + 1), obmol.GetAtom(mol.getAtomNumber(bond.getAtom(1)) + 1), (int) bond.getOrder(), 0); return obBond; } Am 15.04.2010 um 17:57 schrieb Noel O'Boyle: > 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 > <ale...@ph...> 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 >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> -- 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 Am 15.04.2010 um 17:57 schrieb Noel O'Boyle: > 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 > <ale...@ph...> 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 >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> -- 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 |
From: Noel O'B. <bao...@gm...> - 2010-04-15 15:57:29
|
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 <ale...@ph...> 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 > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Alexander K. <ale...@ph...> - 2010-04-15 14:43:43
|
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 |
From: Noel O'B. <bao...@gm...> - 2010-04-08 20:25:22
|
So...just delete all files related to OpenBabel (e.g. search your computer for all files with openbabel in their path) and recompile 2.2.3 (not 2.2.3b). Then you can be sure you have only a single version. In future, you should consider installing locally rather than globally to avoid this problem. - Noel On 8 April 2010 20:17, Chirag Patel <cj...@st...> wrote: > Hello Noel, All, > Thanks for your response. > > I attempted to compile and install myself (v 2.2.3b), but this was after I had installed the binary; how can I verify if I have only a single version of OpenBabel? > > Chirag > > > On Apr 7, 2010, at 4:29 AM, Noel O'Boyle wrote: > >> Hello Chirag, >> >> What version of OpenBabel are you using? Did you compile and install >> it yourself? >> >> Can you verify that you only have a single version of OpenBabel on >> your system and that all of the files, openbabel.py, _openbabel.so, >> and so forth come from that version? The usual problem is that there >> is a mixup between different versions due to incorrectly set >> environment variables. >> >> - Noel >> >> (please cc to list) >> >> On 2 April 2010 23:42, Chirag Patel <cj...@st...> wrote: >>> Hello, >>> I am having trouble using the python bindings. I am using max OS 10.6.2 and python 2.6.1: >>> >>> Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) >>> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin >>> Type "help", "copyright", "credits" or "license" for more information. >>>>>> import openbabel >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in <module> >>> File "/Library/Python/2.6/site-packages/openbabel.py", line 36, in <module> >>> _openbabel = swig_import_helper() >>> File "/Library/Python/2.6/site-packages/openbabel.py", line 35, in swig_import_helper >>> return _mod >>> UnboundLocalError: local variable '_mod' referenced before assignment >>> >>>>>> import _openbabel >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in <module> >>> ImportError: dlopen(/Library/Python/2.6/site-packages/_openbabel.so, 2): Symbol not found: __ZN9OpenBabel10obErrorLogE >>> Referenced from: /Library/Python/2.6/site-packages/_openbabel.so >>> Expected in: flat namespace >>> in /Library/Python/2.6/site-packages/_openbabel.so >>> >>> >>> any ideas? I apologize if this is a repeat issue and I googled around to no avail... >>> >>> >>> Chirag >>> ------------------------------------------------------------------------------ >>> 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 >>> Ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >>> > > |
From: Chirag P. <cj...@st...> - 2010-04-08 19:17:58
|
Hello Noel, All, Thanks for your response. I attempted to compile and install myself (v 2.2.3b), but this was after I had installed the binary; how can I verify if I have only a single version of OpenBabel? Chirag On Apr 7, 2010, at 4:29 AM, Noel O'Boyle wrote: > Hello Chirag, > > What version of OpenBabel are you using? Did you compile and install > it yourself? > > Can you verify that you only have a single version of OpenBabel on > your system and that all of the files, openbabel.py, _openbabel.so, > and so forth come from that version? The usual problem is that there > is a mixup between different versions due to incorrectly set > environment variables. > > - Noel > > (please cc to list) > > On 2 April 2010 23:42, Chirag Patel <cj...@st...> wrote: >> Hello, >> I am having trouble using the python bindings. I am using max OS 10.6.2 and python 2.6.1: >> >> Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) >> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >>>>> import openbabel >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "/Library/Python/2.6/site-packages/openbabel.py", line 36, in <module> >> _openbabel = swig_import_helper() >> File "/Library/Python/2.6/site-packages/openbabel.py", line 35, in swig_import_helper >> return _mod >> UnboundLocalError: local variable '_mod' referenced before assignment >> >>>>> import _openbabel >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> ImportError: dlopen(/Library/Python/2.6/site-packages/_openbabel.so, 2): Symbol not found: __ZN9OpenBabel10obErrorLogE >> Referenced from: /Library/Python/2.6/site-packages/_openbabel.so >> Expected in: flat namespace >> in /Library/Python/2.6/site-packages/_openbabel.so >> >> >> any ideas? I apologize if this is a repeat issue and I googled around to no avail... >> >> >> Chirag >> ------------------------------------------------------------------------------ >> 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 >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> |
From: Noel O'B. <bao...@gm...> - 2010-04-07 11:29:29
|
Hello Chirag, What version of OpenBabel are you using? Did you compile and install it yourself? Can you verify that you only have a single version of OpenBabel on your system and that all of the files, openbabel.py, _openbabel.so, and so forth come from that version? The usual problem is that there is a mixup between different versions due to incorrectly set environment variables. - Noel (please cc to list) On 2 April 2010 23:42, Chirag Patel <cj...@st...> wrote: > Hello, > I am having trouble using the python bindings. I am using max OS 10.6.2 and python 2.6.1: > > Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) > [GCC 4.2.1 (Apple Inc. build 5646)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import openbabel > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/Library/Python/2.6/site-packages/openbabel.py", line 36, in <module> > _openbabel = swig_import_helper() > File "/Library/Python/2.6/site-packages/openbabel.py", line 35, in swig_import_helper > return _mod > UnboundLocalError: local variable '_mod' referenced before assignment > >>>> import _openbabel > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: dlopen(/Library/Python/2.6/site-packages/_openbabel.so, 2): Symbol not found: __ZN9OpenBabel10obErrorLogE > Referenced from: /Library/Python/2.6/site-packages/_openbabel.so > Expected in: flat namespace > in /Library/Python/2.6/site-packages/_openbabel.so > > > any ideas? I apologize if this is a repeat issue and I googled around to no avail... > > > Chirag > ------------------------------------------------------------------------------ > 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 > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Chirag P. <cj...@st...> - 2010-04-02 22:42:28
|
Hello, I am having trouble using the python bindings. I am using max OS 10.6.2 and python 2.6.1: Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import openbabel Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.6/site-packages/openbabel.py", line 36, in <module> _openbabel = swig_import_helper() File "/Library/Python/2.6/site-packages/openbabel.py", line 35, in swig_import_helper return _mod UnboundLocalError: local variable '_mod' referenced before assignment >>> import _openbabel Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dlopen(/Library/Python/2.6/site-packages/_openbabel.so, 2): Symbol not found: __ZN9OpenBabel10obErrorLogE Referenced from: /Library/Python/2.6/site-packages/_openbabel.so Expected in: flat namespace in /Library/Python/2.6/site-packages/_openbabel.so any ideas? I apologize if this is a repeat issue and I googled around to no avail... Chirag |
From: Chris M. <c.m...@ga...> - 2010-03-15 19:52:39
|
Jie Shen wrote: > Dear Noel and all, > > That's great! I wonder know whether we can use PubChem fingerprint in > openbabel or pybel? There are about 1,000 substurcture SMARTS patterns > available. > > ftp://ftp.ncbi.nlm.nih.gov/pubchem/specifications/pubchem_fingerprints.txt If the PubChem fingerprint was defined by SMARTS patterns it would be easy to add to OpenBabel. But I think it would be necessary to use code in OpenBabel to generate a fingerprint to the specification above. But if you had a SMARTS pattern for each bit... Chris |
From: Charlie Z. <zh....@gm...> - 2010-03-14 05:31:33
|
I think I catch what Mikko's meaning. OBDotNet implements FastSearch functions all well as exactly searching and sub-structure searching. But similarity-searching. The only problem is about an unimplemented data structure as parameter of the function. That is public bool FindSimilar(OpenBabel.OBBase pOb, OpenBabel.SWIGTYPE_p_std__multimapT_double_unsigned_int_t SeekposMap) Member of OpenBabel.FastSearch SWIGTYPE_p_std__multimapT_double_unsigned_int_t can be implemented as List<double, uint> to solve this problem. Noel has give me instructions about compiling OBDotNet with SWIG but I have not done it. Regards, Charlie On Wed, Mar 3, 2010 at 12:37 AM, Noel O'Boyle <bao...@gm...> wrote: > I don't think it will work using the FastSearch class, but it should > work fine using the FastSearch format. > > See > http://old.nabble.com/Re%3A-Using-fastsearch-from-Python-p17430663.html > for instructions on use from Python. > > - Noel > > On 2 March 2010 16:14, Mikko Kasanen <kas...@ho...> wrote: > > > > > > Greetings from Finland! > > > > We are currently developing a small program in University of Eastern > Finland > > (www.uef.fi) at Kuopio campus. > > In the program we are using OBdotNet from Open Babel and as a molecylar > > database we use the Chembl database. > > We are currently having some problems trying to write the code in C# > using > > Visual Studio, since we cannot get Similarity searches working. > > The problem is that we try to use FindSimilar methods but all the Swig > types > > etc give us problems since we cannot get it to work. > > > > > > I am trying to ask that is it even possible at this moment to get it > work, > > and if so, could u help with a small sample code. > > > > Thx in advance, Mikko Kasanen. > > > > ________________________________ > > Uusi Spaces ja 25 Gt ilmaista SkyDrive tallennustilaa. Lataa Live > paketti. > > ________________________________ > > Tutustu videoiden avulla Windows Live tuotteisiin. Opi mestariksi. > > > ------------------------------------------------------------------------------ > > 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 > > Ope...@li... > > 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 > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Geoffrey H. <ge...@ge...> - 2010-03-11 16:32:18
|
On Mar 11, 2010, at 10:18 AM, Noel O'Boyle wrote: > direction of AddBond(). Perhaps I should also remove NewBond() from > the bindings. Yes, I think that's a good idea. -Geoff |
From: Noel O'B. <bao...@gm...> - 2010-03-11 15:18:43
|
On 11 March 2010 15:01, Jason Power <pow...@gm...> wrote: > Sorry about that, didn't pay attention.. > > With this: > import openbabel > ring3 = openbabel.OBMol() > ra1=ring3.NewAtom() > ra2=ring3.NewAtom() > ra3=ring3.NewAtom() > ra1.SetAtomicNum(6) > ra2.SetAtomicNum(6) > ra3.SetAtomicNum(6) > ring3.AddBond(1, 2, 1) > ring3.AddBond(2, 3, 1) > ring3.AddBond(3, 1, 1) > print len(ring3.GetSSSR()) > builder = openbabel.OBOp.FindType("Gen3D") > builder.Do(ring3) > print len(ring3.GetSSSR()) > ra1.SetVector(1,0,0) > ra2.SetVector(0,-1,0) > ra3.SetVector(0,1,0) > > I now get the proper behavior of GetSSSR(), but I still get a segfault when I > try to move the atoms. I assume this is because the pointers are not valid > anymore. Why is this? I'm not sure. I have a feeling it would work fine from C++, because although the builder adds new atoms (Hs), it adds them at the end of the molecule and doesn't disturb the existing atoms. The way to find out would be the write the same code in C++ and step through it. In any case, it should work fine if you get the atom again with ring3.GetAtom(1).SetVector(whatever) > Also, why would it work when I add a bond as you described and not work when I > did it the way I was doing it? Does AddBond make some connections that I > wasn't doing? No that's not it. It's a limitation of the SWIG bindings. There are no pointers in Python, so what you have is only pretending to be a pointer as well as it can. In C++ your code would work as expected. I'll add some notes to the documentation pointing people in the direction of AddBond(). Perhaps I should also remove NewBond() from the bindings. > Thanks, I think with this I can get my code to work! > Jason > > On Thursday 11 March 2010 09:52:27 am Noel O'Boyle wrote: >> (Please cc to list) >> >> How about commenting about: >> >> ##rb1=ring3.NewBond() >> ##rb2=ring3.NewBond() >> ##rb3=ring3.NewBond() >> ##rb1.SetBegin(ra1) >> ##rb1.SetEnd(ra2) >> ##rb2.SetBegin(ra2) >> ##rb2.SetEnd(ra3) >> ##rb3.SetBegin(ra3) >> ##rb3.SetEnd(ra1) >> ##rb1.SetBO(1) >> ##rb2.SetBO(1) >> ##rb3.SetBO(1) >> >> and replacing it with: >> >> ring3.AddBond(1, 2, 1) >> ring3.AddBond(2, 3, 1) >> ring3.AddBond(3, 1, 1) >> >> - Noel >> >> On 11 March 2010 14:28, Jason Power <pow...@gm...> wrote: >> > Here is something that causes a segfault every time: >> > >> > import openbabel >> > ring3 = openbabel.OBMol() >> > ra1=ring3.NewAtom() >> > ra2=ring3.NewAtom() >> > ra3=ring3.NewAtom() >> > ra1.SetAtomicNum(6) >> > ra2.SetAtomicNum(6) >> > ra3.SetAtomicNum(6) >> > rb1=ring3.NewBond() >> > rb2=ring3.NewBond() >> > rb3=ring3.NewBond() >> > rb1.SetBegin(ra1) >> > rb1.SetEnd(ra2) >> > rb2.SetBegin(ra2) >> > rb2.SetEnd(ra3) >> > rb3.SetBegin(ra3) >> > rb3.SetEnd(ra1) >> > rb1.SetBO(1) >> > rb2.SetBO(1) >> > rb3.SetBO(1) >> > print len(ring3.GetSSSR()) # OUTPUT: 0 >> > builder = openbabel.OBOp.FindType("Gen3D") >> > builder.Do(ring3) >> > print len(ring3.GetSSSR()) # OUTPUT: 1 >> > ra1.SetVector(1,0,0) >> > ra2.SetVector(0,-1,0) >> > ra3.SetVector(0,1,0) >> > >> > Sometimes is segfaults on ra2.SetVector(0,-1,0) and sometimes on >> > ra3.SetVector(0,1,0). Also, I don't understand why the first call the >> > GetSSSR() doesn't return the right number. >> > >> > Thanks again! >> > Jason >> > >> > On Thursday 11 March 2010 04:48:45 am you wrote: >> >> Where do beginAtom and endAtom come from in your code snippet. >> >> >> >> The best thing would be if you can you create a simple and short >> >> self-contained script that exhibits the problem. >> >> >> >> - Noel >> >> >> >> On 11 March 2010 03:59, Jason Power <pow...@gm...> wrote: >> >> > Hi all, >> >> > >> >> > I am currently developing a pure-python 2-D molecule editor for use >> >> > within another project I am currently working on. To begin with I >> >> > decided to use the OBMol object as a model, thinking it would save me >> >> > time and effort. However, I have run into a variety of issues that I'm >> >> > not sure are due to my own misunderstandings, limitations of the >> >> > python bindings, or bugs. >> >> > >> >> > I am building the OBMol object slowly over time as the user adds atoms >> >> > and bonds. So I have a numerous places where I basically call >> >> > >> >> > self.mol.BeginModify() >> >> > bond = self.mol.NewBond() >> >> > bond.SetBegin(beginAtom) >> >> > bond.SetEnd(endAtom) >> >> > self.mol.EndModify() >> >> > >> >> > and >> >> > >> >> > self.mol.BeginModify() >> >> > newAtom = self.mol.NewAtom() >> >> > newAtom.SetVector(self.translateToAtomCoords(pos)) >> >> > newAtom.SetAtomicNum(atomicNum) >> >> > self.mol.EndModify() >> >> > >> >> > and similar to delete. I find that with these calls when I go on to do >> >> > other interesting things it fails, often as a segfault. Also, if I try >> >> > to make a call like self.mol.GetSSSR() even though there is a ring, (I >> >> > can trace the indices of the ends of the bonds myself), it returns a >> >> > zero length list. >> >> > >> >> > I have found that if I call self.builder.Do(self.mol) before I run >> >> > GetSSSR() it will return the right numbers, but I do not want to build >> >> > the full 3-D coords, and worse, self.builder.Do(self.mol) randomly >> >> > segfaults. >> >> > >> >> > Am I doing something wrong? Is there something that I am missing while >> >> > building the molecule? >> >> > >> >> > Thanks for you help! >> >> > Jason >> >> > >> >> > >> >> > ---------------------------------------------------------------------- >> >> >--- ----- 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 >> >> > Ope...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> > |
From: Jason P. <pow...@gm...> - 2010-03-11 15:02:02
|
Sorry about that, didn't pay attention.. With this: import openbabel ring3 = openbabel.OBMol() ra1=ring3.NewAtom() ra2=ring3.NewAtom() ra3=ring3.NewAtom() ra1.SetAtomicNum(6) ra2.SetAtomicNum(6) ra3.SetAtomicNum(6) ring3.AddBond(1, 2, 1) ring3.AddBond(2, 3, 1) ring3.AddBond(3, 1, 1) print len(ring3.GetSSSR()) builder = openbabel.OBOp.FindType("Gen3D") builder.Do(ring3) print len(ring3.GetSSSR()) ra1.SetVector(1,0,0) ra2.SetVector(0,-1,0) ra3.SetVector(0,1,0) I now get the proper behavior of GetSSSR(), but I still get a segfault when I try to move the atoms. I assume this is because the pointers are not valid anymore. Why is this? Also, why would it work when I add a bond as you described and not work when I did it the way I was doing it? Does AddBond make some connections that I wasn't doing? Thanks, I think with this I can get my code to work! Jason On Thursday 11 March 2010 09:52:27 am Noel O'Boyle wrote: > (Please cc to list) > > How about commenting about: > > ##rb1=ring3.NewBond() > ##rb2=ring3.NewBond() > ##rb3=ring3.NewBond() > ##rb1.SetBegin(ra1) > ##rb1.SetEnd(ra2) > ##rb2.SetBegin(ra2) > ##rb2.SetEnd(ra3) > ##rb3.SetBegin(ra3) > ##rb3.SetEnd(ra1) > ##rb1.SetBO(1) > ##rb2.SetBO(1) > ##rb3.SetBO(1) > > and replacing it with: > > ring3.AddBond(1, 2, 1) > ring3.AddBond(2, 3, 1) > ring3.AddBond(3, 1, 1) > > - Noel > > On 11 March 2010 14:28, Jason Power <pow...@gm...> wrote: > > Here is something that causes a segfault every time: > > > > import openbabel > > ring3 = openbabel.OBMol() > > ra1=ring3.NewAtom() > > ra2=ring3.NewAtom() > > ra3=ring3.NewAtom() > > ra1.SetAtomicNum(6) > > ra2.SetAtomicNum(6) > > ra3.SetAtomicNum(6) > > rb1=ring3.NewBond() > > rb2=ring3.NewBond() > > rb3=ring3.NewBond() > > rb1.SetBegin(ra1) > > rb1.SetEnd(ra2) > > rb2.SetBegin(ra2) > > rb2.SetEnd(ra3) > > rb3.SetBegin(ra3) > > rb3.SetEnd(ra1) > > rb1.SetBO(1) > > rb2.SetBO(1) > > rb3.SetBO(1) > > print len(ring3.GetSSSR()) # OUTPUT: 0 > > builder = openbabel.OBOp.FindType("Gen3D") > > builder.Do(ring3) > > print len(ring3.GetSSSR()) # OUTPUT: 1 > > ra1.SetVector(1,0,0) > > ra2.SetVector(0,-1,0) > > ra3.SetVector(0,1,0) > > > > Sometimes is segfaults on ra2.SetVector(0,-1,0) and sometimes on > > ra3.SetVector(0,1,0). Also, I don't understand why the first call the > > GetSSSR() doesn't return the right number. > > > > Thanks again! > > Jason > > > > On Thursday 11 March 2010 04:48:45 am you wrote: > >> Where do beginAtom and endAtom come from in your code snippet. > >> > >> The best thing would be if you can you create a simple and short > >> self-contained script that exhibits the problem. > >> > >> - Noel > >> > >> On 11 March 2010 03:59, Jason Power <pow...@gm...> wrote: > >> > Hi all, > >> > > >> > I am currently developing a pure-python 2-D molecule editor for use > >> > within another project I am currently working on. To begin with I > >> > decided to use the OBMol object as a model, thinking it would save me > >> > time and effort. However, I have run into a variety of issues that I'm > >> > not sure are due to my own misunderstandings, limitations of the > >> > python bindings, or bugs. > >> > > >> > I am building the OBMol object slowly over time as the user adds atoms > >> > and bonds. So I have a numerous places where I basically call > >> > > >> > self.mol.BeginModify() > >> > bond = self.mol.NewBond() > >> > bond.SetBegin(beginAtom) > >> > bond.SetEnd(endAtom) > >> > self.mol.EndModify() > >> > > >> > and > >> > > >> > self.mol.BeginModify() > >> > newAtom = self.mol.NewAtom() > >> > newAtom.SetVector(self.translateToAtomCoords(pos)) > >> > newAtom.SetAtomicNum(atomicNum) > >> > self.mol.EndModify() > >> > > >> > and similar to delete. I find that with these calls when I go on to do > >> > other interesting things it fails, often as a segfault. Also, if I try > >> > to make a call like self.mol.GetSSSR() even though there is a ring, (I > >> > can trace the indices of the ends of the bonds myself), it returns a > >> > zero length list. > >> > > >> > I have found that if I call self.builder.Do(self.mol) before I run > >> > GetSSSR() it will return the right numbers, but I do not want to build > >> > the full 3-D coords, and worse, self.builder.Do(self.mol) randomly > >> > segfaults. > >> > > >> > Am I doing something wrong? Is there something that I am missing while > >> > building the molecule? > >> > > >> > Thanks for you help! > >> > Jason > >> > > >> > > >> > ---------------------------------------------------------------------- > >> >--- ----- 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 > >> > Ope...@li... > >> > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Noel O'B. <bao...@gm...> - 2010-03-11 14:52:35
|
(Please cc to list) How about commenting about: ##rb1=ring3.NewBond() ##rb2=ring3.NewBond() ##rb3=ring3.NewBond() ##rb1.SetBegin(ra1) ##rb1.SetEnd(ra2) ##rb2.SetBegin(ra2) ##rb2.SetEnd(ra3) ##rb3.SetBegin(ra3) ##rb3.SetEnd(ra1) ##rb1.SetBO(1) ##rb2.SetBO(1) ##rb3.SetBO(1) and replacing it with: ring3.AddBond(1, 2, 1) ring3.AddBond(2, 3, 1) ring3.AddBond(3, 1, 1) - Noel On 11 March 2010 14:28, Jason Power <pow...@gm...> wrote: > Here is something that causes a segfault every time: > > import openbabel > ring3 = openbabel.OBMol() > ra1=ring3.NewAtom() > ra2=ring3.NewAtom() > ra3=ring3.NewAtom() > ra1.SetAtomicNum(6) > ra2.SetAtomicNum(6) > ra3.SetAtomicNum(6) > rb1=ring3.NewBond() > rb2=ring3.NewBond() > rb3=ring3.NewBond() > rb1.SetBegin(ra1) > rb1.SetEnd(ra2) > rb2.SetBegin(ra2) > rb2.SetEnd(ra3) > rb3.SetBegin(ra3) > rb3.SetEnd(ra1) > rb1.SetBO(1) > rb2.SetBO(1) > rb3.SetBO(1) > print len(ring3.GetSSSR()) # OUTPUT: 0 > builder = openbabel.OBOp.FindType("Gen3D") > builder.Do(ring3) > print len(ring3.GetSSSR()) # OUTPUT: 1 > ra1.SetVector(1,0,0) > ra2.SetVector(0,-1,0) > ra3.SetVector(0,1,0) > > Sometimes is segfaults on ra2.SetVector(0,-1,0) and sometimes on > ra3.SetVector(0,1,0). Also, I don't understand why the first call the > GetSSSR() doesn't return the right number. > > Thanks again! > Jason > > On Thursday 11 March 2010 04:48:45 am you wrote: >> Where do beginAtom and endAtom come from in your code snippet. >> >> The best thing would be if you can you create a simple and short >> self-contained script that exhibits the problem. >> >> - Noel >> >> On 11 March 2010 03:59, Jason Power <pow...@gm...> wrote: >> > Hi all, >> > >> > I am currently developing a pure-python 2-D molecule editor for use >> > within another project I am currently working on. To begin with I decided >> > to use the OBMol object as a model, thinking it would save me time and >> > effort. However, I have run into a variety of issues that I'm not sure >> > are due to my own misunderstandings, limitations of the python bindings, >> > or bugs. >> > >> > I am building the OBMol object slowly over time as the user adds atoms >> > and bonds. So I have a numerous places where I basically call >> > >> > self.mol.BeginModify() >> > bond = self.mol.NewBond() >> > bond.SetBegin(beginAtom) >> > bond.SetEnd(endAtom) >> > self.mol.EndModify() >> > >> > and >> > >> > self.mol.BeginModify() >> > newAtom = self.mol.NewAtom() >> > newAtom.SetVector(self.translateToAtomCoords(pos)) >> > newAtom.SetAtomicNum(atomicNum) >> > self.mol.EndModify() >> > >> > and similar to delete. I find that with these calls when I go on to do >> > other interesting things it fails, often as a segfault. Also, if I try to >> > make a call like self.mol.GetSSSR() even though there is a ring, (I can >> > trace the indices of the ends of the bonds myself), it returns a zero >> > length list. >> > >> > I have found that if I call self.builder.Do(self.mol) before I run >> > GetSSSR() it will return the right numbers, but I do not want to build >> > the full 3-D coords, and worse, self.builder.Do(self.mol) randomly >> > segfaults. >> > >> > Am I doing something wrong? Is there something that I am missing while >> > building the molecule? >> > >> > Thanks for you help! >> > Jason >> > >> > >> > ------------------------------------------------------------------------- >> >----- 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 >> > Ope...@li... >> > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> > |
From: Noel O'B. <bao...@gm...> - 2010-03-11 14:39:57
|
---------- Forwarded message ---------- From: Jason Power <pow...@gm...> Date: 11 March 2010 14:28 Subject: Re: [OpenBabel-scripting] (no subject) To: Noel O'Boyle <bao...@gm...> Here is something that causes a segfault every time: import openbabel ring3 = openbabel.OBMol() ra1=ring3.NewAtom() ra2=ring3.NewAtom() ra3=ring3.NewAtom() ra1.SetAtomicNum(6) ra2.SetAtomicNum(6) ra3.SetAtomicNum(6) rb1=ring3.NewBond() rb2=ring3.NewBond() rb3=ring3.NewBond() rb1.SetBegin(ra1) rb1.SetEnd(ra2) rb2.SetBegin(ra2) rb2.SetEnd(ra3) rb3.SetBegin(ra3) rb3.SetEnd(ra1) rb1.SetBO(1) rb2.SetBO(1) rb3.SetBO(1) print len(ring3.GetSSSR()) # OUTPUT: 0 builder = openbabel.OBOp.FindType("Gen3D") builder.Do(ring3) print len(ring3.GetSSSR()) # OUTPUT: 1 ra1.SetVector(1,0,0) ra2.SetVector(0,-1,0) ra3.SetVector(0,1,0) Sometimes is segfaults on ra2.SetVector(0,-1,0) and sometimes on ra3.SetVector(0,1,0). Also, I don't understand why the first call the GetSSSR() doesn't return the right number. Thanks again! Jason On Thursday 11 March 2010 04:48:45 am you wrote: > Where do beginAtom and endAtom come from in your code snippet. > > The best thing would be if you can you create a simple and short > self-contained script that exhibits the problem. > > - Noel > > On 11 March 2010 03:59, Jason Power <pow...@gm...> wrote: > > Hi all, > > > > I am currently developing a pure-python 2-D molecule editor for use > > within another project I am currently working on. To begin with I decided > > to use the OBMol object as a model, thinking it would save me time and > > effort. However, I have run into a variety of issues that I'm not sure > > are due to my own misunderstandings, limitations of the python bindings, > > or bugs. > > > > I am building the OBMol object slowly over time as the user adds atoms > > and bonds. So I have a numerous places where I basically call > > > > self.mol.BeginModify() > > bond = self.mol.NewBond() > > bond.SetBegin(beginAtom) > > bond.SetEnd(endAtom) > > self.mol.EndModify() > > > > and > > > > self.mol.BeginModify() > > newAtom = self.mol.NewAtom() > > newAtom.SetVector(self.translateToAtomCoords(pos)) > > newAtom.SetAtomicNum(atomicNum) > > self.mol.EndModify() > > > > and similar to delete. I find that with these calls when I go on to do > > other interesting things it fails, often as a segfault. Also, if I try to > > make a call like self.mol.GetSSSR() even though there is a ring, (I can > > trace the indices of the ends of the bonds myself), it returns a zero > > length list. > > > > I have found that if I call self.builder.Do(self.mol) before I run > > GetSSSR() it will return the right numbers, but I do not want to build > > the full 3-D coords, and worse, self.builder.Do(self.mol) randomly > > segfaults. > > > > Am I doing something wrong? Is there something that I am missing while > > building the molecule? > > > > Thanks for you help! > > Jason > > > > > > ------------------------------------------------------------------------- > >----- 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 > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Noel O'B. <bao...@gm...> - 2010-03-11 09:48:52
|
Where do beginAtom and endAtom come from in your code snippet. The best thing would be if you can you create a simple and short self-contained script that exhibits the problem. - Noel On 11 March 2010 03:59, Jason Power <pow...@gm...> wrote: > Hi all, > > I am currently developing a pure-python 2-D molecule editor for use within > another project I am currently working on. To begin with I decided to use the > OBMol object as a model, thinking it would save me time and effort. However, I > have run into a variety of issues that I'm not sure are due to my own > misunderstandings, limitations of the python bindings, or bugs. > > I am building the OBMol object slowly over time as the user adds atoms and > bonds. So I have a numerous places where I basically call > > self.mol.BeginModify() > bond = self.mol.NewBond() > bond.SetBegin(beginAtom) > bond.SetEnd(endAtom) > self.mol.EndModify() > > and > > self.mol.BeginModify() > newAtom = self.mol.NewAtom() > newAtom.SetVector(self.translateToAtomCoords(pos)) > newAtom.SetAtomicNum(atomicNum) > self.mol.EndModify() > > and similar to delete. I find that with these calls when I go on to do other > interesting things it fails, often as a segfault. Also, if I try to make a > call like self.mol.GetSSSR() even though there is a ring, (I can trace the > indices of the ends of the bonds myself), it returns a zero length list. > > I have found that if I call self.builder.Do(self.mol) before I run GetSSSR() > it will return the right numbers, but I do not want to build the full 3-D > coords, and worse, self.builder.Do(self.mol) randomly segfaults. > > Am I doing something wrong? Is there something that I am missing while > building the molecule? > > Thanks for you help! > Jason > > > ------------------------------------------------------------------------------ > 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 > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Jason P. <pow...@gm...> - 2010-03-11 03:59:16
|
Hi all, I am currently developing a pure-python 2-D molecule editor for use within another project I am currently working on. To begin with I decided to use the OBMol object as a model, thinking it would save me time and effort. However, I have run into a variety of issues that I'm not sure are due to my own misunderstandings, limitations of the python bindings, or bugs. I am building the OBMol object slowly over time as the user adds atoms and bonds. So I have a numerous places where I basically call self.mol.BeginModify() bond = self.mol.NewBond() bond.SetBegin(beginAtom) bond.SetEnd(endAtom) self.mol.EndModify() and self.mol.BeginModify() newAtom = self.mol.NewAtom() newAtom.SetVector(self.translateToAtomCoords(pos)) newAtom.SetAtomicNum(atomicNum) self.mol.EndModify() and similar to delete. I find that with these calls when I go on to do other interesting things it fails, often as a segfault. Also, if I try to make a call like self.mol.GetSSSR() even though there is a ring, (I can trace the indices of the ends of the bonds myself), it returns a zero length list. I have found that if I call self.builder.Do(self.mol) before I run GetSSSR() it will return the right numbers, but I do not want to build the full 3-D coords, and worse, self.builder.Do(self.mol) randomly segfaults. Am I doing something wrong? Is there something that I am missing while building the molecule? Thanks for you help! Jason |
From: Matt S. <mes...@gm...> - 2010-03-11 03:42:06
|
It's done. Let me know if you have any problems. -Matt On Wed, Mar 10, 2010 at 7:35 PM, Geoffrey Hutchison < ge...@ge...> wrote: > Matt, > > Great catch. This will probably help other people, since you're not the > only one running Open Babel in a separate thread. I suspect this is the root > cause of other XML crashes -- there are a few posted to the bug tracker. > > Let's commit this to SVN trunk for some testing. If it works, I'll backport > it, potentially for a 2.2.4 release. > > Thanks, > -Geoff > > > > |
From: Geoffrey H. <ge...@ge...> - 2010-03-11 02:35:16
|
Matt, Great catch. This will probably help other people, since you're not the only one running Open Babel in a separate thread. I suspect this is the root cause of other XML crashes -- there are a few posted to the bug tracker. Let's commit this to SVN trunk for some testing. If it works, I'll backport it, potentially for a 2.2.4 release. Thanks, -Geoff On Mar 10, 2010, at 8:24 PM, Matt Sprague wrote: > I finally found a fix for the crash I was experiencing. I went back and read the documentation for libxml2 and found this (http://xmlsoft.org/threads.html) > > "call xmlInitParser() in the "main" thread before using any of the libxml2 API (except possibly selecting a different memory allocator)" > > > After making the following change to xml.cpp, everything works fine. > > if(_reader) > return true; //do not need to make a new reader > > //fix crash on GC in the C# bindings > xmlInitParser(); > > //If the inputstream is not at the start (probably arising in fastsearch), > //save its position and rewind so that the reader initialization is ok. > //(Getting the requested object is handled in ReadXML(), when the format is known.) > _requestedpos = GetInStream()->tellg(); > > The root cause of the crash was that the CLI runs finalizers in a separate thread, but libxml wasn't being setup for a multithreaded environment. While I don't think that adding this call will impact the base code, I wanted to run it by more experienced C++ programmers before committing anything. > > -Matt > > ------------------------------------------------------------------------------ > 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 > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting |
From: Matt S. <mes...@gm...> - 2010-03-11 01:24:14
|
I finally found a fix for the crash I was experiencing. I went back and read the documentation for libxml2 and found this ( http://xmlsoft.org/threads.html) "call xmlInitParser() in the "main" thread before using any of the libxml2 > API (except possibly selecting a different memory allocator)" > After making the following change to xml.cpp, everything works fine. if(_reader) return true; //do not need to make a new reader //fix crash on GC in the C# bindings xmlInitParser(); //If the inputstream is not at the start (probably arising in fastsearch), //save its position and rewind so that the reader initialization is ok. //(Getting the requested object is handled in ReadXML(), when the format is known.) _requestedpos = GetInStream()->tellg(); The root cause of the crash was that the CLI runs finalizers in a separate thread, but libxml wasn't being setup for a multithreaded environment. While I don't think that adding this call will impact the base code, I wanted to run it by more experienced C++ programmers before committing anything. -Matt |