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: Noel O'B. <bao...@gm...> - 2009-09-27 16:30:20
|
Hello Charlie, (ccing to mailing list) Unfortunately, it's not possible to wrap ostream using SWIG in any useful way, but see http://www.nabble.com/Re%3A-Using-fastsearch-from-Python-p17430663.html for example of using fastsearch from Python. Regards, Noel 2009/9/27 Charlie Zhu <zh....@gm...>: > Hi, Noel, > > Thanks for your obdotnet 2.0 and I am using it on my work. > > I have consulted to you about how to compile obdotnet and I still not have > it done. > > I have another question that is it possible that the std::ostream type will > be supported in some following version of obdotnet? It is currently compiled > as SWIGTYPE_p_std__ostream and inaccessible. I want to use FastSearchIndexer > class to generate fast-search index with OBDotNet. > > > Charlie > +86 13661348004 > > > On Tue, Aug 25, 2009 at 2:41 AM, Noel O'Boyle <bao...@gm...> wrote: >> >> Hello all, >> >> To celebrate the release of OB 2.2.3, I've made a new release of >> OBDotNet which incorporates several improvements by Matt Sprague. Many >> of these changes are behind the scenes; the remainder are documented >> at http://openbabel.org/wiki/OBDotNet, principally: >> >> (1) OpenBabel's Iterators are now accessible as .NET Enumerators >> (2) Handling OBGenericData is simplified through the use of a DownCast >> method >> >> Feedback, as ever, is welcome. >> >> - Noel >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> OpenBabel-scripting mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > |
From: Pascal M. <pas...@gm...> - 2009-09-25 08:08:45
|
Hi, > I need to calculate the number of rotable bonds in my molecules, since a Python point of view... > Please help me... #!/usr/bin/python import pybel # This programm print number of rotatable bonds for mol in pybel.readfile("smi", "ligand.smi"): # could be sdf or mol2 print mol.OBMol.NumRotors(), "\t", mol.OBMol.GetTitle() Hope it helps, Regards, Pascal |
From: <ped...@fe...> - 2009-09-23 22:16:41
|
I need to calculate the number of rotable bonds in my molecules, since a Python point of view... Please help me... Thanks |
From: Noel O'B. <bao...@gm...> - 2009-09-15 20:09:30
|
Hello Christoph, To access the elements of an enum, you don't go through Option_type, but rather access the variables directly (this is a C++ 'feature'). That is, in the case of OBConversion (http://openbabel.org/api/2.2.0/classOpenBabel_1_1OBConversion.shtml#a5c5a0aac29d9e705d9b7b7b8aeb8116), you should be able to access OpenBabel::OBConversion::INOPTIONS (or the Ruby equivalent) directly. - Noel 2009/9/11 Christoph Helma <he...@in...>: > I am trying to use the OpenBabel Ruby bindings to create InChI keys, but > I have no idea how to provide the Option_type as second argument to > set_options (OpenBabel::OBConversion::Option_type is not accessible from > Ruby): > > require 'rubygems' > require 'openbabel' > obconversion = OpenBabel::OBConversion.new > obmol = OpenBabel::OBMol.new > obconversion.set_in_and_out_formats 'smi', 'inchi' > obconversion.set_options 'K', *how to set OUTOPTIONS here?* > obconversion.read_string obmol, 'c1ccccc1' > obconversion.write_string(obmol) > > Am I missing something obvious? > > Thanks, > Christoph > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Christoph H. <he...@in...> - 2009-09-11 09:16:25
|
I am trying to use the OpenBabel Ruby bindings to create InChI keys, but I have no idea how to provide the Option_type as second argument to set_options (OpenBabel::OBConversion::Option_type is not accessible from Ruby): require 'rubygems' require 'openbabel' obconversion = OpenBabel::OBConversion.new obmol = OpenBabel::OBMol.new obconversion.set_in_and_out_formats 'smi', 'inchi' obconversion.set_options 'K', *how to set OUTOPTIONS here?* obconversion.read_string obmol, 'c1ccccc1' obconversion.write_string(obmol) Am I missing something obvious? Thanks, Christoph |
From: Noel O'B. <bao...@gm...> - 2009-08-24 18:41:32
|
Hello all, To celebrate the release of OB 2.2.3, I've made a new release of OBDotNet which incorporates several improvements by Matt Sprague. Many of these changes are behind the scenes; the remainder are documented at http://openbabel.org/wiki/OBDotNet, principally: (1) OpenBabel's Iterators are now accessible as .NET Enumerators (2) Handling OBGenericData is simplified through the use of a DownCast method Feedback, as ever, is welcome. - Noel |
From: Noel O'B. <bao...@gm...> - 2009-08-18 08:45:58
|
Swig doesn't have support for multimaps for CSharp. The real solution here are additions to the FastSearch API to make it suitable for use from scripting languages. I will file a feature request. In the meanwhile, you will have to code it yourself. - Noel 2009/8/18 Charlie Zhu <zh....@gm...>: > Hi, > > The second parameter of FindSimilar function is in type std::multimap< > double, unsigned int > . > It is transformed to SWIGTYPE_p_std__multimapT_double_unsigned_int_t in > OBDotNet and I can not find a way to use this type. So the Fast Search > FindSimilar function will not work on OBDotNet, right? > Thanks > > Charlie > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > |
From: Charlie Z. <zh....@gm...> - 2009-08-18 05:15:31
|
Hi, The second parameter of FindSimilar function is in type std::multimap< double, unsigned int > . It is transformed to SWIGTYPE_p_std__multimapT_double_unsigned_int_t in OBDotNet and I can not find a way to use this type. So the Fast Search FindSimilar function will not work on OBDotNet, right? Thanks Charlie |
From: Andrew F. <fa...@mo...> - 2009-07-28 18:31:43
|
OK. this is as simple as I can get it. Openbabel 2.2.2 Python 2.5.4 Eric 4.3.5 I'm willing to file it with the eric people too. I just started here on the probability of getting one of the developers to render an opinion. Andy Noel O'Boyle wrote: > OK, I guess I asked for that :-) > > Could you reduce it down to the shortest possible program that > reproduces the error? For example, a 2 or 3 line program (including > imports) would be ideal. You'll should also supply the input file, > e.g. a one-molecule sdf file would be ideal. > > You also need to supply the versions of your operating system, python, > eric, openbabel. > > Since this is an eric bug, rather than in openbabel, you'll probably > have to report it to eric instead, but at least I can help you narrow > down the problem. > > - Noel |
From: Noel O'B. <bao...@gm...> - 2009-07-26 18:43:39
|
OK, I guess I asked for that :-) Could you reduce it down to the shortest possible program that reproduces the error? For example, a 2 or 3 line program (including imports) would be ideal. You'll should also supply the input file, e.g. a one-molecule sdf file would be ideal. You also need to supply the versions of your operating system, python, eric, openbabel. Since this is an eric bug, rather than in openbabel, you'll probably have to report it to eric instead, but at least I can help you narrow down the problem. - Noel 2009/7/24 Andrew Fant <fa...@mo...>: > Noel asked me to verify the code was working on the command line and to > post it to the group. > > The following code should be fed two sd formatted files from the command > line. It works fine from the command line but dies the previously > mentioned ugly death under eric. > > (yes, I know it needs refactoring. this was a cut and paste job to do a > one-off.) > > Andy > > #!/usr/bin/env python > > import pybel > import sys > import os.path > import numpy > import scipy > import scipy.stats > import string > import math > import matplotlib.pyplot as plt > > if len(sys.argv) == 3: > file1=sys.argv[1] > file2=sys.argv[2] > if not(os.path.isfile(file1)) or not(os.path.isfile(file2)): > print sys.argv[0],": input files must exist" > exit(64) > else: > print "Usage:",sys.argv[0]," file1 file2" > exit(128) > > basename1=string.split( (string.split(file1,'_',2)[0]),'.',2 )[0] > basename2=string.split( (string.split(file2,'_',2)[0]),'.',2 )[0] > > set1=[] > for molecule in pybel.readfile("sdf",file1): > set1.append(molecule) > > set2=[] > for molecule in pybel.readfile("sdf",file2): > set2.append(molecule) > > #generate data arrays > > > data1=[] > for molecule in set1: > mw=molecule.molwt > logp=molecule.calcdesc()['LogP'] > mr=molecule.calcdesc()['MR'] > tpsa=molecule.calcdesc()['TPSA'] > fp2=molecule.calcfp('FP2') > fp4=molecule.calcfp('FP4') > mumble=[mw,logp,mr,tpsa,fp2,fp4] > data1.append(mumble) > > data2=[] > for molecule in set2: > mw=molecule.molwt > logp=molecule.calcdesc()['LogP'] > mr=molecule.calcdesc()['MR'] > tpsa=molecule.calcdesc()['TPSA'] > fp2=molecule.calcfp('FP2') > fp4=molecule.calcfp('FP4') > mumble=[mw,logp,mr,tpsa,fp2,fp4] > data2.append(mumble) > > #Generate stats for mw,logP,mr, & tpsa for each set > > scratch1=numpy.empty((len(data1),4)) > kount=0 > for line in data1: > scratch1[kount,0]=line[0] > scratch1[kount,1]=line[1] > scratch1[kount,2]=line[2] > scratch1[kount,3]=line[3] > kount+=1 > > scratch2=numpy.empty((len(data2),4)) > kount=0 > for line in data2: > scratch2[kount,0]=line[0] > scratch2[kount,1]=line[1] > scratch2[kount,2]=line[2] > scratch2[kount,3]=line[3] > kount+=1 > > print "Statistical Summaries" > print "for",basename1 > print "n =",len(set1) > print "property mean sigma" > print "Mol. Wt ",numpy.mean(scratch1[:,0])," ",numpy.std(scratch1[:,0]) > print "LogP ",numpy.mean(scratch1[:,1])," ",numpy.std(scratch1[:,1]) > print "Molar Ref. ",numpy.mean(scratch1[:,2])," ",numpy.std(scratch1[:,2]) > print "TPSA ",numpy.mean(scratch1[:,3])," ",numpy.std(scratch1[:,3]) > print > print "for",basename2 > print "n =",len(set2) > print "property mean sigma" > print "Mol. Wt ",numpy.mean(scratch2[:,0])," ",numpy.std(scratch2[:,0]) > print "LogP ",numpy.mean(scratch2[:,1])," ",numpy.std(scratch2[:,1]) > print "Molar Ref. ",numpy.mean(scratch2[:,2])," ",numpy.std(scratch2[:,2]) > print "TPSA ",numpy.mean(scratch2[:,3])," ",numpy.std(scratch2[:,3]) > > cross_FP2_similar=numpy.empty((len(set1),len(set2))) > cross_FP4_similar=numpy.empty((len(set1),len(set2))) > for i in range(len(set1)): > for j in range(len(set2)): > cross_FP2_similar[i,j]=data1[i][4] | data2[j][4] > cross_FP4_similar[i,j]=data1[i][5] | data2[j][5] > > > ------------------------------------------------------------------------------ > > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > |
From: Andrew F. <fa...@mo...> - 2009-07-24 18:55:43
|
Noel asked me to verify the code was working on the command line and to post it to the group. The following code should be fed two sd formatted files from the command line. It works fine from the command line but dies the previously mentioned ugly death under eric. (yes, I know it needs refactoring. this was a cut and paste job to do a one-off.) Andy |
From: Noel O'B. <bao...@gm...> - 2009-07-24 01:56:34
|
set, set2? 2009/7/23 Andrew Fant <fa...@mo...>: > Good Afternoon All, > I was trying to find a bug in some code I was writing, using the > python debugger interface in eric4, when I ran into an unexpected snag. > > When I was using a standard pybel read loop: > > set=[] > for molecule in pybel.readfile('sdf',filename) > set2.append(molecule) > > eric4 returns an unhandled exception at line 90 of pybel.py (in the > OBConversion_ReadFile method) which is: > > notatend = obconversion.ReadFile(obmol,filename > > Is this problem because I am not doing something in a sufficiently > pythonic idiom, or is eric4 being rigid about checking for EOF and the > like when pybel checks for problems in the input stream further down in > the code? FWIW, the code runs fine (aside from the logic bug further > along that I was trying to track down) from the command line, and this > is the latest stable release of openbabel (I upgraded to see if that > would fix it; it didn't) and python 2.54. > > Thanks in advance, > Andy > > ------------------------------------------------------------------------------ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Andrew F. <fa...@mo...> - 2009-07-23 22:41:20
|
Good Afternoon All, I was trying to find a bug in some code I was writing, using the python debugger interface in eric4, when I ran into an unexpected snag. When I was using a standard pybel read loop: set=[] for molecule in pybel.readfile('sdf',filename) set2.append(molecule) eric4 returns an unhandled exception at line 90 of pybel.py (in the OBConversion_ReadFile method) which is: notatend = obconversion.ReadFile(obmol,filename Is this problem because I am not doing something in a sufficiently pythonic idiom, or is eric4 being rigid about checking for EOF and the like when pybel checks for problems in the input stream further down in the code? FWIW, the code runs fine (aside from the logic bug further along that I was trying to track down) from the command line, and this is the latest stable release of openbabel (I upgraded to see if that would fix it; it didn't) and python 2.54. Thanks in advance, Andy |
From: Noel O'B. <bao...@gm...> - 2009-07-14 10:19:05
|
2009/7/14 <coy...@ya...>: > > Hi, > > I couldn't find an example of usage of OBMolRingIter in python. > (What I want to do is given an id of an atom in a ring, > print out other atoms in that ring, by the way) > > Before I get to that I try to do something simple and just print out the rings, but the following script doesn't work: > > for ring in openbabel.OBMolRingIter(mol2): > print ring.Size() > > For my fairly small molecule with two fused 6 membered rings I get an infinite loop printing "6", until I Ctrl-C. What am I doing wrong? This was fixed in OB 2.2.2. Can you confirm that you're not using 2.2.2? > The second question, how to manipulate rings stored in OBRing in python. The example is in C++, and I am too weak in python to figure out how to use vectors. > > The example from OBRing Class description is: > > OBMol mol; > > vector<OBRing*> vr; > vr = mol.GetSSSR(); > > That's identical in python: vr=mol2.GetSSSR() > > How do I crack vr though? The code in C++ is (The same description): > > > > vector<OBRing*>::iterator i; > vector<int>::iterator j; > vector<OBRing*> *rlist = (vector<OBRing*>*)mol.GetData("RingList"); > for (i = rlist->begin();i != rlist->end();++i) > { > for(j = (*i)->_path.begin(); j != (*i)->_path.end(); ++j) > cout << *j << ' '; > cout << endl; > } > and this prints out the atom numbers of a ring. > > > Sorry, maybe I should know learn more python first, but stuff like this is not in the beginners textbooks:( A vector in C++ is like a list in Python. len(vr), list(vr), vr[0], vr[1], "for ring in vr", etc. Maybe I should add this to the docs. - Noel |
From: <coy...@ya...> - 2009-07-14 09:23:05
|
Hi, I couldn't find an example of usage of OBMolRingIter in python. (What I want to do is given an id of an atom in a ring, print out other atoms in that ring, by the way) Before I get to that I try to do something simple and just print out the rings, but the following script doesn't work: for ring in openbabel.OBMolRingIter(mol2): print ring.Size() For my fairly small molecule with two fused 6 membered rings I get an infinite loop printing "6", until I Ctrl-C. What am I doing wrong? The second question, how to manipulate rings stored in OBRing in python. The example is in C++, and I am too weak in python to figure out how to use vectors. The example from OBRing Class description is: OBMol mol; vector<OBRing*> vr; vr = mol.GetSSSR(); That's identical in python: vr=mol2.GetSSSR() How do I crack vr though? The code in C++ is (The same description): vector<OBRing*>::iterator i; vector<int>::iterator j; vector<OBRing*> *rlist = (vector<OBRing*>*)mol.GetData("RingList"); for (i = rlist->begin();i != rlist->end();++i) { for(j = (*i)->_path.begin(); j != (*i)->_path.end(); ++j) cout << *j << ' '; cout << endl; } and this prints out the atom numbers of a ring. Sorry, maybe I should know learn more python first, but stuff like this is not in the beginners textbooks:( Thank you, Vis |
From: Geoffrey H. <ge...@pi...> - 2009-07-10 16:22:23
|
I am very happy to finally announce the release of Open Babel 2.2.2, the latest stable version of the open source chemistry toolbox. This release represents a major bug-fix release and is a stable upgrade, strongly recommended for all users of Open Babel. While there may not be many new features, many crashes and other bugs have been fixed since 2.2.1 and 2.2.0. What's new? See the full release notes at: http://openbabel.org/wiki/Open_Babel_2.2.2 To download, see: https://sourceforge.net/projects/openbabel/files/ For more information, see the project website at: http://openbabel.org/ I would like to personally thank a few people for making this release a great one. In alphabetical order, Igor Filippov, Craig James, Chris Morley, Noel O'Boyle, and Tim Vandermeersch. This is a community project and we couldn't have made this release without you. Many thanks to all the contributors to Open Babel including those of you who submitted feedback, bug reports, and code. Cheers, -Geoff --- Prof. Geoffrey Hutchison Department of Chemistry University of Pittsburgh tel: (412) 648-0492 email: ge...@pi... web: http://hutchison.chem.pitt.edu/ |
From: Visvaldas K. <coy...@ya...> - 2009-07-10 15:58:16
|
Thank you, it works! Before, I couldn't figure out how to stick GetResidue and GetName together with an "atom" without some statement invoking OBResidue into the limelight. > It's a good question, but that also works in OpenBabel. Try > "print > patom.GetResidue().GetName()". Your original program should > have > worked fine, that's why I asked about the error message and > the input > file. > |
From: Noel O'B. <bao...@gm...> - 2009-07-10 15:15:02
|
2009/7/10 Visvaldas K. <coy...@ya...>: > > sorry, I figured it out myself! I didn't input the file because the example would work on _any_ PDB file, I guess people don't have the crystal ball:) Sorry again... today I come about a complete noob, maybe coffee wasn't so good to me after all:) > > The correct syntax I have is something like, with more complete code: > ======================================== > import openbabel > import sys > > try: > filename1 = sys.argv[1] > except: > print "Usage: python script.py filename1" > sys.exit(1) > > > mol1 = openbabel.OBMol() > conv = openbabel.OBConversion() > format = conv.FormatFromExt(filename1) > conv.SetInAndOutFormats(format, format) > conv.ReadFile(mol1, filename1) > > > for pres in openbabel.OBResidueIter(mol1): > print pres.GetName() > for patom in openbabel.OBResidueAtomIter(pres): > print patom.GetAtomicNum() > > ============================ > One thing surprises me, is that residue name is not a part of OBAtom > object, but it belongs to a different OBResidue object. When > I think normally, I think of an atom in a protein as having atomic number, isotope, hybridization, xyz coords, etc, and _also_ which residue it belongs to, so I hope my question is not too far fetched... It's a good question, but that also works in OpenBabel. Try "print patom.GetResidue().GetName()". Your original program should have worked fine, that's why I asked about the error message and the input file. > Thank you, > > Vis > > > > > |
From: Visvaldas K. <coy...@ya...> - 2009-07-10 14:56:38
|
sorry, I figured it out myself! I didn't input the file because the example would work on _any_ PDB file, I guess people don't have the crystal ball:) Sorry again... today I come about a complete noob, maybe coffee wasn't so good to me after all:) The correct syntax I have is something like, with more complete code: ======================================== import openbabel import sys try: filename1 = sys.argv[1] except: print "Usage: python script.py filename1" sys.exit(1) mol1 = openbabel.OBMol() conv = openbabel.OBConversion() format = conv.FormatFromExt(filename1) conv.SetInAndOutFormats(format, format) conv.ReadFile(mol1, filename1) for pres in openbabel.OBResidueIter(mol1): print pres.GetName() for patom in openbabel.OBResidueAtomIter(pres): print patom.GetAtomicNum() ============================ One thing surprises me, is that residue name is not a part of OBAtom object, but it belongs to a different OBResidue object. When I think normally, I think of an atom in a protein as having atomic number, isotope, hybridization, xyz coords, etc, and _also_ which residue it belongs to, so I hope my question is not too far fetched... Thank you, Vis |
From: Noel O'B. <bao...@gm...> - 2009-07-10 13:46:51
|
Hello Visvaldas, To help we need to know (1) what the error message is, and (2) what the input file is. You may also find it useful to try out OBResidueIter, and OBResidueAtomIter (see the API documentation at openbabel.org/api). - Noel 2009/7/10 Visvaldas K. <coy...@ya...>: > > I'm very sorry, I am very rusty in python and OO programming, could you please suggest the correct syntax how to get residue info for an iterated atom. The problem (for me) seems that the atom info and residue info belong to different objects, and I don't know how to connect the gap between them. > > In other words, > > for patom in openbabel.OBMolAtomIter(mol1): > print patom.GetAtomicNum() > > of course works, and > > for patom in openbabel.OBMolAtomIter(mol1): > print patom.GetResidue() > > gves an error. How to make the script print the reside names for the second example, for each atom? > > Sincerely yours, > > Vis > > > > > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Visvaldas K. <coy...@ya...> - 2009-07-10 13:37:06
|
I'm very sorry, I am very rusty in python and OO programming, could you please suggest the correct syntax how to get residue info for an iterated atom. The problem (for me) seems that the atom info and residue info belong to different objects, and I don't know how to connect the gap between them. In other words, for patom in openbabel.OBMolAtomIter(mol1): print patom.GetAtomicNum() of course works, and for patom in openbabel.OBMolAtomIter(mol1): print patom.GetResidue() gves an error. How to make the script print the reside names for the second example, for each atom? Sincerely yours, Vis |
From: Noel O'B. <bao...@gm...> - 2009-06-25 09:03:05
|
(Moved to openbabel-scripting) You should compare the bits that are set. Pybel makes this easy (look at calcfp() in pybel.py to see what's happening): >>> mol = pybel.readstring("smi", "CCCC") >>> mol.calcfp() <pybel.Fingerprint object at 0x013EAD10> >>> mol.calcfp().bits [261, 385, 671] >>> mol_b = pybel.readstring("smi", "CCCCC") >>> mol_b.calcfp().bits [261, 385, 671, 985] If you convert both lists to a set, you can check whether they are identical. - Noel openbabel-scripting <ope...@li...> 2009/6/22 Mingyue Zheng <my...@ma...>: > Hi all, > I'd like to compare two OBBitVec instances using the following script: > > #!/usr/bin/env python > import openbabel > bv1=openbabel.OBBitVec() > bv2=openbabel.OBBitVec() > ... > if bv1==bv2: > ... > ... > > However, since the OBBitVec class wrapped in openbabel.py has no definition for the __eq__() or __ne__() operations, I assume that "bv1==bv2" comparison will compare these two class instances by their physical address, which is not what I want. > > Is here anybody has a solution to this issue? Any comments would be appreciated. > > Regards, > 9thNight > > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge conference! > Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. > Need another reason to go? 24-hour hacker lounge. Register today! > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > _______________________________________________ > OpenBabel-discuss mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > |
From: Geoffrey H. <ge...@ge...> - 2009-05-27 16:16:56
|
> I was trying to find information on how to install the bindings > (especially > python) with cMake without luck. The CMake builds should create Python bindings if you use cmake - DENABLE_PYTHON. You can also run ccmake from a build directory to change the setting. Unfortunately, the rest of the bindings aren't enabled by Cmake yet. Hope that helps, -Geoff |
From: Noel O'B. <bao...@gm...> - 2009-05-26 14:52:56
|
Hi Andreas, Unfortunately, you are probably the first person to use this code from Python. As you say, matrix3x3 is not currently wrapped so there doesn't seem to be anyway to access this information from Python. I will see what I can do about adding this functionality (this may take a week or two). In the meanwhile you could try pycifrw (see google). - Noel 2009/5/26 Andreas Kempe <a....@is...>: > Hello Noel, > > thanks a lot for your reply. > > Unfortunately, I already ran into a new problem. When trying to access > the unit cell matrices (GetOrthoMatrix, GetCellMatrix,..), I get the > error message: > > swig/python detected a memory leak of type 'OpenBabel::matrix3x3 *', no > destructor found. > > The matrix3x3-class does not exist in openbabel.py? Do you know a > workaround for this problem as well? > > "pseudo-code": > mol = pybel.readfile("cif", "cell.cif").next() > uc = mol.unitcell > om = uc.GetOrthoMatrix() > print om.Get(1,1) > > Thanks in advance, > > Andreas > > Noel O'Boyle schrieb: >> Hello Andreas, >> >> Looks like you've found a bug in OpenBabel, rather than a Python >> problem. First of all, here's a workaround - use the Get method >> instead: >> >>>>> import pybel >>>>> mol = pybel.readfile("cif", "ABENAX.cif").next() >>>>> cv = mol.unitcell.GetCellVectors()[0] >>>>> a = pybel.ob.doubleArray(3) >>>>> cv.Get(a) >>>>> a[0] >> 8.4589996337890625 >>>>> a[1] >> 0.0 >>>>> a[2] >> 0.0 >> >> I'll file a bug. >> >> Noel >> >> 2009/5/22 Andreas Kempe <a....@is...>: >>> Hello list, >>> >>> this code >>> >>> [...] >>> uc = openbabel.toUnitCell(mol.GetData(openbabel.UnitCell)) >>> temp = uc.GetCellVectors() >>> print temp[0].x() >>> >>> is not working (on windows). Why? How can I access the cell vectors with >>> the python bindings? >>> >>> Thanks in advance, >>> >>> Andreas >>> > |
From: Andreas K. <a....@is...> - 2009-05-26 14:33:57
|
Hello Noel, thanks a lot for your reply. Unfortunately, I already ran into a new problem. When trying to access the unit cell matrices (GetOrthoMatrix, GetCellMatrix,..), I get the error message: swig/python detected a memory leak of type 'OpenBabel::matrix3x3 *', no destructor found. The matrix3x3-class does not exist in openbabel.py? Do you know a workaround for this problem as well? "pseudo-code": mol = pybel.readfile("cif", "cell.cif").next() uc = mol.unitcell om = uc.GetOrthoMatrix() print om.Get(1,1) Thanks in advance, Andreas Noel O'Boyle schrieb: > Hello Andreas, > > Looks like you've found a bug in OpenBabel, rather than a Python > problem. First of all, here's a workaround - use the Get method > instead: > >>>> import pybel >>>> mol = pybel.readfile("cif", "ABENAX.cif").next() >>>> cv = mol.unitcell.GetCellVectors()[0] >>>> a = pybel.ob.doubleArray(3) >>>> cv.Get(a) >>>> a[0] > 8.4589996337890625 >>>> a[1] > 0.0 >>>> a[2] > 0.0 > > I'll file a bug. > > Noel > > 2009/5/22 Andreas Kempe <a....@is...>: >> Hello list, >> >> this code >> >> [...] >> uc = openbabel.toUnitCell(mol.GetData(openbabel.UnitCell)) >> temp = uc.GetCellVectors() >> print temp[0].x() >> >> is not working (on windows). Why? How can I access the cell vectors with >> the python bindings? >> >> Thanks in advance, >> >> Andreas >> |