Get number of carbon atoms?

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

Get number of carbon atoms?

Håvard S
Hi.

I am just getting started with the C# bindings for OpenBabel. How do I get the number of carbon atoms in a molecule I have read from an mdl file?

Thanks in advance,

-Håvard

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenBabel-scripting mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
Reply | Threaded
Open this post in threaded view
|

Re: Get number of carbon atoms?

Pascal Muller-3
Hello,

> I am just getting started with the C# bindings for OpenBabel. How do I get
> the number of carbon atoms in a molecule I have read from an mdl file?

Iterate over atoms and increment if OBAtom IsCarbon()
http://openbabel.org/dev-api/classOpenBabel_1_1OBAtom.shtml#a1f0a167775136e911cd349cdd8923b24
or
OBMol GetFormula() or GetSpacedFormula(), keep the number following C.

Regards,
Pascal

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
OpenBabel-scripting mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting