Quantcast

set the atom type in python interface

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

set the atom type in python interface

Yun Ding-2

Dear all,


I would like to get the SYB type of the atom using the python interface, however, it always gives the INT type, how can I set it to be SYB type?


By studying the C++ code I know how to do it in C++. But using python is much more convenient for me. 


So far my code is like


```

import pybel


lig = pybel.readfile('sdf', "xxx.sdf").next()

types = [a.type for a in lig.atoms]

```


Thanks!


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: set the atom type in python interface

mwojcikowski
Hi,

Here you go:

from openbabel import OBAtomAtomIter,OBTypeTable

# setup typetable to translate atom types
typetable = OBTypeTable()
typetable.SetFromType('INT')
typetable.SetToType('SYB')

lig = pybel.readfile('sdf', "xxx.sdf").next()
types = [typetable.Translate(a.type) for a in lig.atoms]


----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
[hidden email]

2016-04-13 19:13 GMT+02:00 Yun Ding <[hidden email]>:

Dear all,


I would like to get the SYB type of the atom using the python interface, however, it always gives the INT type, how can I set it to be SYB type?


By studying the C++ code I know how to do it in C++. But using python is much more convenient for me. 


So far my code is like


```

import pybel


lig = pybel.readfile('sdf', "xxx.sdf").next()

types = [a.type for a in lig.atoms]

```


Thanks!


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Loading...