Hi,

> I want to ask about the position of the fonctional groups within the
> molecules.
> For example, i have the substance like C(C)CC=C.
> Can i use Pybel for determining the position of branch CH3 at the position 2
> in this molecule ?

You can get the idx of the atom bearing your CH3 group:

smarts = pybel.Smarts("[CX4H3]") # match only one atom, C([H])([H])[H]
will match 4 atoms
...
for neighbor in ob.OBAtomAtomIter(mol.atoms[num-1].OBAtom):
        if neighbor.GetAtomicNum() != 1:
                print neighbor.GetIdx()


Is the neighbor idx equivalent to the position you want?

Regards,
Pascal

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to