On 13/12/2011 13:26, Adebayo Adeniyi wrote:
> I want to use open babel to append properties to sdf file and also to filter 
> a sdf file with the properties like:
> CAT_NO
>
> PUBCHEM_CACTVS_HBOND_DONOR
> PUBCHEM_CACTVS_HBOND_ACCEPTOR
>
> PUBCHEM_MOLECULAR_WEIGHT
> PUBCHEM_XLOGP3
>
> but i got an error message like: not recognized as a property or a descriptor

OpenBabel does not do everything you want and possibly using Pybel 
(Python) would be more flexible.

However attached are some examples (using Windows command line) to help 
you find why you got an error message (you didn't provide the command 
you used).


 >obabel 005050001-5.sdf -osmi
S(=O)(=O)(N1CCOCC1)c1cc(/N=C\2/c3c(N(C(C)C)C2=O)cccc3)ccc1      5050001
O=C1N(CC(C)C)c2c(/C/1=N/c1cccnc1)cccc2  5050002
O=C1C(=Cc2c(OC)c(OC)c(OC)cc2)CCc2c1cccc2        5050003
FC(F)(COCc1oc(cc1)C(=O)[O-])C(F)F       5050004
O1CCN(CC1)c1ccc(C=C2CCc3c(C2=O)cccc3)cc1        5050005
5 molecules converted

***Filtering on sdf properties***
 >obabel 005050001-5.sdf -osmi --filter "PUBCHEM_CACTVS_HBOND_ACCEPTOR>4"
S(=O)(=O)(N1CCOCC1)c1cc(/N=C\2/c3c(N(C(C)C)C2=O)cccc3)ccc1      5050001
FC(F)(COCc1oc(cc1)C(=O)[O-])C(F)F       5050004
2 molecules converted

 >obabel 005050001-5.sdf -osmi --filter "PUBCHEM_CACTVS_HBOND_ACCEPTOR>4 
&& PUBCHEM_CACTVS_COMPLEXITY>600"
S(=O)(=O)(N1CCOCC1)c1cc(/N=C\2/c3c(N(C(C)C)C2=O)cccc3)ccc1      5050001
1 molecule converted

***Appending properties to the title***
 >obabel 005050001-5.sdf -otxt --append PUBCHEM_CACTVS_HBOND_ACCEPTOR
5050001 6
5050002 3
5050003 4
5050004 8
5050005 3
5 molecules converted

***Adding a new property (same text for all molecules) See below***
 >obabel 005050001-5.sdf -O 001-5a.sdf --property SOURCE EXTERNAL
5 molecules converted

***Adding a new property (calculated for each molecule)***
 >obabel 001-5a.sdf -O 001-5b.sdf --add MW
5 molecules converted

***Part of the resulting file***
 >obabel 001-5b.sdf -osdf -l 1
...(many lines omitted)...
 >  <PUBCHEM_BONDANNOTATIONS>
14  15  8
14  23  8
15  24  8
16  21  8
16  25  8
21  22  8
22  26  8
23  27  8
24  29  8
25  28  8
26  28  8
27  29  8

 >  <SOURCE>
EXTERNAL

 >  <MW>
413.49

$$$$
1 molecule converted

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to