Hi,

I have said clearly about my problem. Sorry !

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 ?

Many thanks in advance for your help.

T-B


2011/3/2 Pascal Muller <pascal.jm.mul...@gmail.com>

> Hi,
>
>
> > Can i determine the position of the fonctional groups within the
> molecules
> > with pybel _ openbabel ?
>
> I'm not sure what you mean with "position". What about that?
>
> mol = pybel.readstring("smi", "CCOCN=C")
> smarts = pybel.Smarts("[#6^3,#7^3,#8^3]")
> print smarts.findall(mol)
> for num, in smarts.findall(mol):
>        print "Index:", num, "AtomicNum:",
> mol.atoms[num-1].OBAtom.GetAtomicNum()
>
> Output :
> [(1,), (2,), (3,), (4,)]
> Index: 1 AtomicNum: 6
> Index: 2 AtomicNum: 6
> Index: 3 AtomicNum: 8
> Index: 4 AtomicNum: 6
>
> 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