From: Noel O'B. <bao...@gm...> - 2008-12-09 13:44:30
|
---------- Forwarded message ---------- From: <fre...@gm...> Date: 2008/12/9 Subject: Bus error using OBMol.Separate To: Cinfony <ci...@go...> Hi! I'm trying to use pybel from cinfony in order to find the different R- groups on a general scaffold. I have managed to delete the scaffold, leaving the R-groups as disconnected fragments in the molecule. However, when I tried to separate the fragments I ran into a bus error. The error appears every time I try to do .Separate() on a OBMol such as in the following code: from cinfony import pybel mol = pybel.readstring("smi", "[NH3+]c1ccccc1.[Cl-]") print "Initial molecule: ", mol.write("smi") mol.OBMol.StripSalts(2) print "After StripSalts(2): ", mol.write("smi") mol = pybel.readstring("smi", "[NH3+]c1ccccc1.[Cl-]") print "Back again: ", mol.write("smi") temp = mol.OBMol.Separate() for tempMol in temp: print "Fragment: ", tempMol.write("smi") Do you know what can be the problem, or should I rather post the question with OpenBabel? I'm running cinfony on an Intel Mac with 10.5.5 and Python2.5 from fink and OpenBabel 2.2.0 Kind regards, Fredrik Wallner --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cinfony" group. To post to this group, send email to ci...@go... To unsubscribe from this group, send email to cin...@go... For more options, visit this group at http://groups.google.com/group/cinfony?hl=en -~----------~----~----~----~------~----~------~--~--- |
From: Noel O'B. <bao...@gm...> - 2008-12-09 13:52:26
|
Hello Fredrik, I must admit that OBMol.Separate() usually causes a segfault for me too, but I've never gotten around to reporting the bug. I've just tested it a little bit. It seems that separating a methane is fine, but separating ethane causes a segault. >>> import pybel >>> pybel.readstring("smi", "C").OBMol.Separate() (<openbabel.OBMol; proxy of <Swig Object of type 'OpenBabel::OBMol *' at 0x12887 78> >,) >>> pybel.readstring("smi", "CC").OBMol.Separate() # It's a segger I'll file a bug. Noel 2008/12/9 Noel O'Boyle <bao...@gm...>: > ---------- Forwarded message ---------- > From: <fre...@gm...> > Date: 2008/12/9 > Subject: Bus error using OBMol.Separate > To: Cinfony <ci...@go...> > > Hi! > > I'm trying to use pybel from cinfony in order to find the different R- > groups on a general scaffold. I have managed to delete the scaffold, > leaving the R-groups as disconnected fragments in the molecule. > However, when I tried to separate the fragments I ran into a bus > error. The error appears every time I try to do .Separate() on a OBMol > such as in the following code: > > from cinfony import pybel > > mol = pybel.readstring("smi", "[NH3+]c1ccccc1.[Cl-]") > print "Initial molecule: ", mol.write("smi") > mol.OBMol.StripSalts(2) > print "After StripSalts(2): ", mol.write("smi") > mol = pybel.readstring("smi", "[NH3+]c1ccccc1.[Cl-]") > print "Back again: ", mol.write("smi") > temp = mol.OBMol.Separate() > for tempMol in temp: > print "Fragment: ", tempMol.write("smi") > > Do you know what can be the problem, or should I rather post the > question with OpenBabel? > > I'm running cinfony on an Intel Mac with 10.5.5 and Python2.5 from > fink and OpenBabel 2.2.0 > > Kind regards, > Fredrik Wallner > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google > Groups "Cinfony" group. > To post to this group, send email to ci...@go... > To unsubscribe from this group, send email to > cin...@go... > For more options, visit this group at > http://groups.google.com/group/cinfony?hl=en > -~----------~----~----~----~------~----~------~--~--- > |
From: Noel O'B. <bao...@gm...> - 2008-12-09 17:55:04
|
Chris made the point this bug has already been fixed in r2700. All you need to do to fix it yourself is to remove the word "return" at line 237 (or so) in obiter.cpp as shown here: http://openbabel.svn.sf.net/viewvc/openbabel/openbabel/trunk/src/obiter.cpp?r1=2627&r2=2700&pathrev=2700 Just rerun "make" and "make install" (no need to redo the configure), and the Python bindings should work straightaway (no need to recompile). Noel 2008/12/9 Noel O'Boyle <bao...@gm...>: > Hello Fredrik, > > I must admit that OBMol.Separate() usually causes a segfault for me > too, but I've never gotten around to reporting the bug. I've just > tested it a little bit. It seems that separating a methane is fine, > but separating ethane causes a segault. > >>>> import pybel >>>> pybel.readstring("smi", "C").OBMol.Separate() > (<openbabel.OBMol; proxy of <Swig Object of type 'OpenBabel::OBMol *' at 0x12887 > 78> >,) >>>> pybel.readstring("smi", "CC").OBMol.Separate() > # It's a segger > > I'll file a bug. > > Noel > > > 2008/12/9 Noel O'Boyle <bao...@gm...>: >> ---------- Forwarded message ---------- >> From: <fre...@gm...> >> Date: 2008/12/9 >> Subject: Bus error using OBMol.Separate >> To: Cinfony <ci...@go...> >> >> Hi! >> >> I'm trying to use pybel from cinfony in order to find the different R- >> groups on a general scaffold. I have managed to delete the scaffold, >> leaving the R-groups as disconnected fragments in the molecule. >> However, when I tried to separate the fragments I ran into a bus >> error. The error appears every time I try to do .Separate() on a OBMol >> such as in the following code: >> >> from cinfony import pybel >> >> mol = pybel.readstring("smi", "[NH3+]c1ccccc1.[Cl-]") >> print "Initial molecule: ", mol.write("smi") >> mol.OBMol.StripSalts(2) >> print "After StripSalts(2): ", mol.write("smi") >> mol = pybel.readstring("smi", "[NH3+]c1ccccc1.[Cl-]") >> print "Back again: ", mol.write("smi") >> temp = mol.OBMol.Separate() >> for tempMol in temp: >> print "Fragment: ", tempMol.write("smi") >> >> Do you know what can be the problem, or should I rather post the >> question with OpenBabel? >> >> I'm running cinfony on an Intel Mac with 10.5.5 and Python2.5 from >> fink and OpenBabel 2.2.0 >> >> Kind regards, >> Fredrik Wallner >> >> --~--~---------~--~----~------------~-------~--~----~ >> You received this message because you are subscribed to the Google >> Groups "Cinfony" group. >> To post to this group, send email to ci...@go... >> To unsubscribe from this group, send email to >> cin...@go... >> For more options, visit this group at >> http://groups.google.com/group/cinfony?hl=en >> -~----------~----~----~----~------~----~------~--~--- >> > |