Ask for SMILES + C++

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

Ask for SMILES + C++

NGUYEN Thanh Binh
Dear,
 
My name is NGUYEN Thanh Binh. I have now a problem with SMILES.
I have taken the database with SMILES from DIPPR. Now i want to use C++ in order to read these structures SMILES and give me the result with the number of the functions within it. 
For example : i have a SMILES C=CCC. It means that we have a substance : CH2=CH-CH2-CH3. The result that we can have is:
        number of CH2= : 01
        number of CH=   : 01
        number of CH2   : 01
        number of CH3   : 01
 
Is it available this code C++ on your open babel ? If possible, can you tell me something about it ?
 
Many thanks in advance for your help.
 
With best regards, 
 
NGUYEN Thanh-Binh
 
__________________________
Ce message (et toutes ses pièces jointes éventuelles) est confidentiel et établi à l'intention exclusive de ses destinataires. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute responsabilité au titre de ce message.

This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP Energies nouvelles should not be liable for this message.

L'IFP change de nom et devient IFP Energies nouvelles. Son adresse de messagerie change aussi : [hidden email]

IFP is changing its name to IFP Energies nouvelles. Its email address is changing too: [hidden email]

Visitez notre site Web / Visit our web site : www.ifpenergiesnouvelles.fr

__________________________

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Ask for SMILES + C++

Chris Morley-3
On 13/01/2011 12:39, NGUYEN Thanh Binh wrote:

> I have taken the database with SMILES from DIPPR. Now i want to use
> C++ in order to read these structures SMILES and give me the result
> with the number of the functions within it.
> For example : i have a SMILES C=CCC. It means that we have a substance
> : CH2=CH-CH2-CH3. The result that we can have is:
> number of CH2= : 01
> number of CH= : 01
> number of CH2 : 01
> number of CH3 : 01
> Is it available this code C++ on your open babel ? If possible, can
> you tell me something about it ?

Use SMARTS (
http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html ) to
define the groups you want to count.

Then something like: (untested and without error handling)

   OBConversion conv;
   conv.SetInFormat("smi");
   OBMol mol;
   conv.ReadString(&mol, "C=CCC"));

   std::string smarts = "[CH2]";
   OBSmartsPattern sp;
   sp.Init(smarts);
   sp.Match(&mol);
   unsigned int numberMatches = sp.GetUMapList().size();

See http://openbabel.org/dev-api/ .

In data/SMARTS_InteLigand.txt there is a list of SMARTS for more
complicated groups.

Chris

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss