Re: [Open Babel] substructure classification

2012-12-09 Thread Chris Morley
On 08/12/2012 21:32, David van der Spoel wrote:
> On 2012-12-08 17:42, Noel O'Boyle wrote:
>> C:\Users\Noel>obabel -:c1(Br)cc(Br)ccc1 -ofpt -xf fp4 -xs
>>>
>> Arylbromide Aromatic
>> 1 molecule converted
>>
> Great, I can reproduce that.
> Is there a simple way of getting this functionality from the source
> code? I don't see any member functions in OBMol that could provide this?

As well as the core API, OpenBabel has some of its functionality in 
plugins. The code for the above feature is in the API code 
fingerprint.cpp, and in the plugins fingerprintformat.cpp and 
finger3.cpp. Probably the easiest way to access it is to use OB's 
conversion framework (Imitate the command line.). Something like: (untested)

ifstream ifs(13-dibromobenzene.sdf);
if(!ifs)
   return false;
OBConversion conv(&ifs, &cout);
if(!conv.SetInAndOutFormats("sdf", "fpt"))
   return false;
conv.AddOption("f", OBConversion::OUTOPTIONS, "FP4");
conv.AddOption("s");
conv.Convert();

If you already have the OBMol, conv.Write() will do the output half.

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

Chris

 is it possible with openbabel to classify a molecule based on 
 substructures?

 E.g.:

 110-dichlorodecane.sdf
 alkyl chloride

 11122334455666-tetradecafluorohexane.sdf
 alkyl fluoride

 111-trimethoxyethane.sdf
 orthocarboxylic acid derivative
 orthoester

 13-dibromobenzene.sdf
 aryl bromide
 aromatic compound


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Problems with binding Python

2012-12-09 Thread elikbelik
I tryed using the latest release of swig (2.0.8) and compile everything from
scratch and still got the problem.
I am using python 2.7.3.



--
View this message in context: 
http://forums.openbabel.org/Problems-with-binding-Python-tp4655705p4655766.html
Sent from the General discussion mailing list archive at Nabble.com.

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] substructure classification

2012-12-09 Thread David van der Spoel
On 2012-12-09 11:36, Chris Morley wrote:
> On 08/12/2012 21:32, David van der Spoel wrote:
>> On 2012-12-08 17:42, Noel O'Boyle wrote:
>>> C:\Users\Noel>obabel -:c1(Br)cc(Br)ccc1 -ofpt -xf fp4 -xs

>>> Arylbromide Aromatic
>>> 1 molecule converted
>>>
>> Great, I can reproduce that.
>> Is there a simple way of getting this functionality from the source
>> code? I don't see any member functions in OBMol that could provide this?
>
> As well as the core API, OpenBabel has some of its functionality in
> plugins. The code for the above feature is in the API code
> fingerprint.cpp, and in the plugins fingerprintformat.cpp and
> finger3.cpp. Probably the easiest way to access it is to use OB's
> conversion framework (Imitate the command line.). Something like: (untested)
>
> ifstream ifs(13-dibromobenzene.sdf);
> if(!ifs)
> return false;
> OBConversion conv(&ifs, &cout);
> if(!conv.SetInAndOutFormats("sdf", "fpt"))
> return false;
> conv.AddOption("f", OBConversion::OUTOPTIONS, "FP4");
> conv.AddOption("s");
> conv.Convert();
>
> If you already have the OBMol, conv.Write() will do the output half.
>
> See http://openbabel.org/dev-api

Thanks, I now use this which works:

   if (conv.SetOutFormat("fpt"))
 {
   conv.AddOption("f", OpenBabel::OBConversion::OUTOPTIONS, 
"FP4");
   conv.AddOption("s");
   conv.Convert();
   cout << conv.WriteString(mol,false);
 }

however, it gives me output that is not very nice for e.g. 
N,N-dimethylaniline

 >
Amine   Tertiary_mixed_amineAromatic   C_ONS_bond   Rotatable_bond  

It would be nicer to get this in a more ordered manner, like a vector of 
strings. Also, the first three terms make sense to me but the last two 
seem not very useful. Any more tips?


>
> Chris
>
> is it possible with openbabel to classify a molecule based on 
> substructures?
>
> E.g.:
>
> 110-dichlorodecane.sdf
> alkyl chloride
>
> 11122334455666-tetradecafluorohexane.sdf
> alkyl fluoride
>
> 111-trimethoxyethane.sdf
> orthocarboxylic acid derivative
> orthoester
>
> 13-dibromobenzene.sdf
> aryl bromide
> aromatic compound
>
>
> --
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205.
sp...@xray.bmc.uu.sehttp://folding.bmc.uu.se

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] substructure classification

2012-12-09 Thread Chris Swain
> 
> 
> --
> 
> Message: 2
> Date: Sat, 08 Dec 2012 14:51:44 +0100
> From: David van der Spoel 
> Subject: [Open Babel] substructure classification
> To: openbabel-discuss@lists.sourceforge.net
> Message-ID: <50c345f0.4070...@xray.bmc.uu.se>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hi,
> 
> is it possible with openbabel to classify a molecule based on substructures?
> 
> E.g.:
> 
> 110-dichlorodecane.sdf
> alkyl chloride
> 
> 11122334455666-tetradecafluorohexane.sdf
> alkyl fluoride
> 
> 111-trimethoxyethane.sdf
> orthocarboxylic acid derivative
> orthoester
> 
> 13-dibromobenzene.sdf
> aryl bromide
> aromatic compound
> 
> 
> -- 
> David van der Spoel, Ph.D., Professor of Biology
> Dept. of Cell & Molec. Biol., Uppsala University.
> Box 596, 75124 Uppsala, Sweden. Phone:+46184714205.
> sp...@xray.bmc.uu.sehttp://folding.bmc.uu.se
> 


Have a look at Checkmol

http://merian.pch.univie.ac.at/~nhaider/cheminf/cmmm.html

Cheers,

Chris

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] substructure classification

2012-12-09 Thread David van der Spoel
On 2012-12-09 22:14, Chris Swain wrote:
>>
>>
>> --
>>
>> Message: 2
>> Date: Sat, 08 Dec 2012 14:51:44 +0100
>> From: David van der Spoel 
>> Subject: [Open Babel] substructure classification
>> To: openbabel-discuss@lists.sourceforge.net
>> Message-ID: <50c345f0.4070...@xray.bmc.uu.se>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Hi,
>>
>> is it possible with openbabel to classify a molecule based on substructures?
>>
>> E.g.:
>>
>> 110-dichlorodecane.sdf
>> alkyl chloride
>>
>> 11122334455666-tetradecafluorohexane.sdf
>> alkyl fluoride
>>
>> 111-trimethoxyethane.sdf
>> orthocarboxylic acid derivative
>> orthoester
>>
>> 13-dibromobenzene.sdf
>> aryl bromide
>> aromatic compound
>>
>>
>> --
>> David van der Spoel, Ph.D., Professor of Biology
>> Dept. of Cell & Molec. Biol., Uppsala University.
>> Box 596, 75124 Uppsala, Sweden. Phone:   +46184714205.
>> sp...@xray.bmc.uu.sehttp://folding.bmc.uu.se
>>
>
>
> Have a look at Checkmol
>
> http://merian.pch.univie.ac.at/~nhaider/cheminf/cmmm.html

Thanks, I'm aware of that, but was hoping to have that functionality in 
openbabel instead, in order to streamline my tools (am already using way 
too many different tools anyway).
It seems that openbabel is almost there.



-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205.
sp...@xray.bmc.uu.sehttp://folding.bmc.uu.se

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss