From: TJ O'D. <tj...@ac...> - 2008-03-21 18:05:08
|
Is it possible to get the canonical atom re-ordering, say as an int vector, after conversion to canonical smiles? I tried GetGIDVector, but this is not what I need. Thanks, TJ O'Donnell |
From: Geoffrey H. <ge...@ge...> - 2008-03-21 19:13:00
|
On Mar 21, 2008, at 2:05 PM, TJ O'Donnell wrote: > Is it possible to get the canonical atom re-ordering, > say as an int vector, after conversion to canonical smiles? As a matter of fact, yes. The current SVN trunk has this feature -- after conversion to canonical SMILES, the ordering is available as an OBPairData called "Canonical Atom Order" For a C++ example, of this, check out tools/obfragment.cpp. This should be accessible from Python directly, although I defer to Noel on the Pybel syntax for this. Cheers, -Geoff |
From: Noel O'B. <bao...@gm...> - 2008-03-21 20:29:03
|
Geoff - it might be a good idea to document these side-effects...I wasn't aware of this one. TJ, from O'person to another: >>> a = pybel.readstring("smi", "CCCC(=O)") >>> a.data.keys() [] >>> print a.write("can") CCCC=O >>> a.data.keys() ['PartialCharges', 'canonical order'] >>> a.data['canonical order'] '1 2 3 4 5' >>> a = pybel.readstring("smi", "C(=O)CCC") >>> a.data.keys() [] >>> print a.write("can") >>> print b CCCC=O >>> a.data['canonical order'] '5 4 3 1 2' If you have any further questions, please let us know. - Noel On 21/03/2008, Geoffrey Hutchison <ge...@ge...> wrote: > > On Mar 21, 2008, at 2:05 PM, TJ O'Donnell wrote: > > > Is it possible to get the canonical atom re-ordering, > > say as an int vector, after conversion to canonical smiles? > > > As a matter of fact, yes. The current SVN trunk has this feature -- > after conversion to canonical SMILES, the ordering is available as an > OBPairData called "Canonical Atom Order" > > For a C++ example, of this, check out tools/obfragment.cpp. > > This should be accessible from Python directly, although I defer to > Noel on the Pybel syntax for this. > > Cheers, > -Geoff > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Geoffrey H. <ge...@ge...> - 2008-03-21 20:41:03
|
> Geoff - it might be a good idea to document these side-effects...I > wasn't aware of this one. Well.. it just went in recently. I promise it'll be on the wiki when 2.2 is released. I waited because Craig was arguing (successfully) for a different name than I used. Cheers, -Geoff |
From: TJ O'D. <tj...@ac...> - 2008-03-23 22:53:54
|
Noel This worked fine for me. It was the "configure --enable-maintainer-mode" step that I was missing. After that, everything went without a hitch. And the Canonical Atom Order is working fine too. Thanks, TJ Noel O'Boyle wrote: > Sorry - I beg your pardon. The problem is the documentation (which I > now remember I was supposed to update). If you are using the trunk, > there is a file missing which you need to create yourself. > > You need to do two things: > (1) install SWIG (we recommend you download the latest version and > compile it yourself) > (2) run "configure --enable-maintainer-mode" instead of just > "configure" (see the last line in > http://openbabel.org/wiki/Install_%28source_code%29#Advanced_Notes) > > When you run 'make' it will create the SWIG bindings as the file > openbabel_python.cpp. After running "make install", "python setup.py > build" should hopefully work. > > Noel > >> wrote: >> I think it must be those recent, um, improvements to the setup.py. >> Could you do me a favour and send me (off-list) the output of "ls >> -alR" in the top openbabel directory (where the ChangeLog and so on >> are)? This will help me fix this problem. Also, what is your exact >> operating system? Is that a regular Ubuntu? >> >> In the meanwhile, you can just set the environment variable >> OPENBABEL_INSTALL to the location where you installed OpenBabel, e.g. >> /usr/local. Then it should work for you. >> >> >> Noel >> >> >> On 21/03/2008, TJ O'Donnell <tj...@ac...> wrote: >> > Hi Noel - another O'Person :) >> > >> > I downloaded the latest via svn. It seems to have compiled and >> > installed OK. But the python setup fails. >> > >> > tj@vmubuntu:~/openbabel/trunk/scripts/python$ python setup.py build >> > WARNING: Environment variable OPENBABEL_INSTALL is not set >> > INFO: Looking for library and include files in ../../src and ../../include >> > running build >> > running build_py >> > file openbabel.py (for module openbabel) not found >> > file openbabel.py (for module openbabel) not found >> > running build_ext >> > building '_openbabel' extension >> > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall >> > -Wstrict-prototypes -fPIC -I../../include -I/usr/include/python2.5 -c >> > openbabel_python.cpp -o build/temp.linux-i686-2.5/openbabel_python.o >> > gcc: openbabel_python.cpp: No such file or directory >> > gcc: no input files >> > error: command 'gcc' failed with exit status 1 >> > >> > I've attached the configure.out and make.out. >> > >> > Can you figure out why python setup is not working? >> > >> > Thanks, >> > >> > TJ >> > >> > >> > >> > >> > > Geoff - it might be a good idea to document these side-effects...I >> > > wasn't aware of this one. >> > > >> > > TJ, from O'person to another: >> > > >> > >>>> a = pybel.readstring("smi", "CCCC(=O)") >> > >>>> a.data.keys() >> > > [] >> > >>>> print a.write("can") >> > > CCCC=O >> > >>>> a.data.keys() >> > > ['PartialCharges', 'canonical order'] >> > >>>> a.data['canonical order'] >> > > '1 2 3 4 5' >> > > >> > >>>> a = pybel.readstring("smi", "C(=O)CCC") >> > >>>> a.data.keys() >> > > [] >> > >>>> print a.write("can") >> > >>>> print b >> > > CCCC=O >> > >>>> a.data['canonical order'] >> > > '5 4 3 1 2' >> > > >> > > If you have any further questions, please let us know. >> > > >> > > - Noel >> > > >> > > On 21/03/2008, Geoffrey Hutchison <ge...@ge...> wrote: >> > >> >> > >> On Mar 21, 2008, at 2:05 PM, TJ O'Donnell wrote: >> > >> >> > >> > Is it possible to get the canonical atom re-ordering, >> > >> > say as an int vector, after conversion to canonical smiles? >> > >> >> > >> >> > >> As a matter of fact, yes. The current SVN trunk has this feature -- >> > >> after conversion to canonical SMILES, the ordering is available as an >> > >> OBPairData called "Canonical Atom Order" >> > >> >> > >> For a C++ example, of this, check out tools/obfragment.cpp. >> > >> >> > >> This should be accessible from Python directly, although I defer to >> > >> Noel on the Pybel syntax for this. >> > >> >> > >> Cheers, >> > >> -Geoff >> > >> >> > >> >> > >> ------------------------------------------------------------------------- >> > >> This SF.net email is sponsored by: Microsoft >> > >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> > >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> > >> _______________________________________________ >> > >> OpenBabel-scripting mailing list >> > >> Ope...@li... >> > >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> > >> >> > > >> > >> > >> |