Re: [Open Babel] single sdf to multi pdbs conversion with compound names

2017-10-25 Thread Chris Morley

On 25/10/2017 07:55, Sundar wrote:


Can anyone help me convert a single input (multimolecular) sdf file into
multiple pdb files with the molecule names (as seen in the sdf file) as
their file names instead of consecutively numbered file names?


Try:
 obabel manymols.sdf -O dummy.pdb --split

Each output file has a name in which 'dummy' is replaced by title of the 
molecule.
(You can use -opdb to specify the output format, but OB uses the first 
extension for this format, which is .ent.)


The output file name can also be made from other properties of the molecule.

Read the description of --split:
 obabel -L split

Chris


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] "b" option in INOPTIONS in python

2017-08-10 Thread Chris Morley

On 10/08/2017 08:16, devw wrote:

The bond detection behavior has been acting up recently and as part of the
problem solving process I've been trying to find any documentation
whatsoever about this "b" option being set in INOPTIONS.
To be more explicit, it's not for a particular format, it has an effect on
how babelbond reads many formats, and that effect is not as stated in the
documentation i could find that mentioned b.


The code that adds bonds is in the functions  ConnectTheDots and 
PerceiveBondOrders in mol.cpp. Look here to see the detail of how they work.


These functions are called from several file formats (xyz is a simple 
one), depending on the input options b and s. Information on a format 
and its options can be obtained from, for example, 
http://open-babel.readthedocs.io/en/latest/FileFormats/XYZ_cartesian_coordinates_format.html

or obabel -L xyz

An overview of the differences between input, output and general options 
is at http://open-babel.readthedocs.io/en/latest/FileFormats/Overview.html


Chris


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Conversion : CML to SDF

2017-03-03 Thread Chris Morley
Sebastian

While reading CML files, OB ignores most elements and attributes it does 
not understand. But the  element (for the SGroup) embedded 
within the main  is not handled properly. I don't think there 
is an option to bypass this (see obabel -L cml). It seems this issue was 
recognized but not fixed 11 years ago when the code was written.

Chris

On 01/03/2017 10:40, Sebastien wrote:
>  xmlns="http://www.chemaxon.com";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_14_8_4.xsd";
> version="ChemAxon file format v14.8.4, generated by v14.9.8.0">
> 
>   
>   
>mrvStereoGroup="0 or1 0 0 0 0 0" lonePair="0 0 0 0 0 1 0" sgroupRef="0 sg1 0
> 0 0 0 0" x2="1.333679121828039 1.3336791218280368 2.6673582436560745
> 2.6673582436560714 1.3336791218280346 0.0 1.3322676295501878E-15"
> y2="3.852 2.312 1.5378
> -2.220446049250313E-15 -0.77 1.9984014443252818E-15 1.5418" />
>   
>   
>   W
>   
>   
>   
>   
>   
>   
>   
>   
>fieldName="[DUP]" x="0.000" y="0.000"
> placement="Relative" unitsDisplayed="Unit displayed" context="Atom"
> fieldData="Enantiomer1" />
>   
>   
>   
>   
>   
>   
> 
> 
Is there a parameter to add in the command line for making the 
conversion works in such case ?
Can we ignore the data which is added on the atom ?


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] error with obabel filter by SMARTS

2015-03-23 Thread Chris Morley
The -s option is more restricted when used with the fs format. If you type

obabel -L fs

the documentation says:

The search target is the parameter of the ``-s`` option and can be
slightly extended SMILES (with ``[#n]`` atoms and ``~`` bonds) or
the name of a file containing a molecule.

This is because fastsearch uses fingerprints the target as well as the 
searched molecules, so the content of the s option has to be a molecule.

You could do the search in two parts - a rough fastsearch using SMILES 
which is then refined using SMARTS:

obabel index.fs -omol2 -sSMILES -an |
   obabel -imol2 -O first.smi -sSMARTS

Chris

On 21/03/2015 21:52, Stefano Forli wrote:
> I think there's an error either in the documentation or in the implementation 
> of the
> filter by pattern in obabel (v2.3.2). The online help says:
>
>$ obabel -H
>...
>-s"smarts" Convert only if match SMARTS or mols in file:
>...
>
> as well as the documentation page here:
> 
> http://openbabel.org/docs/dev/Fingerprints/fingerprints.html#substructure-searching
>
> Although, when trying the following example, I get an error message that 
> implies the code
> is expecting a SMILES string:
>
> 
> $ obabel -ifs mol2_files_top50K.fs
> -s'[#6]-1(=[#6](-[$([#1]),$([#6](-[#1])-[#1]),$([#6]=[#8])])-[#16]-[#6](-[#7]-1-[$([#1]),$([#6]-[#1]),$([#6]:[#6])])=[#7;\!R])-[$([#6](-[#1])-[#1]),$([#6]:[#6])]'
> -osmi -O first.smi
> ==
> *** Open Babel Error  in ReadMolecule
> C-1(=C(-[$(H),$(C(-H)-H),$(C=O)])-S contained a character ',' which is 
> invalid in SMILES
> ==
> *** Open Babel Error  in ObtainTarget
> Cannot read the SMILES string
> 0 molecules converted
> --
>
> (note: I've escaped some characters in the pattern to avoid shell errors).
>
> Thanks,
>
> S
>
>
>


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Conversion of SMILES to SMARTS String

2014-07-26 Thread Chris Morley
On 24/07/2014 17:06, Wallace Chan wrote:
> Tim,
>
> Thanks for your reply. Yes, we have the canonical SMILES strings stored
> as properties in our glass.sdf file. I tried to generate canonical SMILES
> as the result, and they are different than ours. Thus, ours were
> probably acquired using a different canonicalization.

It is possible to recover your canonical SMILES from glass.sdf and add 
it to the title of the results file:

obabel glass.sdf -ifs -O results.smi -sc1c1 --append SMILESSTRING

where SMILESSTRING is the name of the sdf property. You could also 
construct a canonical SMILES file:

obabel glass.sdf -ifs -O results.smi -otxt -sc1c1 --title "" 
--append "SMILESSTRING"

For each matching molecule, the output format txt gives just the title, 
which --title "" removes; the SMILES is then added. Other properties or 
descriptors could be added, e.g. --append "SMILESSTRING inchi"

This then leads to
> another question that has come to me. Does the input for substructure or
> similarity searching have to be in SDF format or can it be another
> format, such as a list of InChI ID's? In other words, does the fast
> search index have to come from an SDF file? Many thanks.

The datafile (and the output query results) can be in any format, 
including inchi.

Chris
>
> On Tue, Jul 22, 2014 at 7:44 PM, Tim Vandermeersch
> mailto:tim.vandermeer...@gmail.com>> wrote:
>
> Hi,
>
> I assume you have canonical SMILES strings in glass.sdf stored as
> titles or properties. Correct me if this is incorrect. If so, it
> depends on what program was used to create these canonical SMILES
> strings. If you used openbabel for this, you can convert the
> molecules in result.smi to openbabel canonical SMILES (or write
> canonical SMILES directly using the .can extension).
>
> In the case where another program was used to generate the canonical
> SMILES, it would not be possible to use openbabel to generate the
> same canonical SMILES starting from result.smi. If you have access
> to the other program you could use this to convert results.smi to
> these canonical SMILES and use these to search glass.sdf.
>
> The reason for this is that there is no universal SMILES
> canonicalization algorithm. Different toolkits will result in
> different canonical SMILES (which are canonical only when using the
> same toolkit). InChI on the hand has a single reference implementation.
>
> Tim
>
>
> On Wed, Jul 23, 2014 at 12:03 AM, Wallace Chan  > wrote:
>
> Dr. Hutchison,
>
> Yes, this helps. I do have another question about substructure
> searching. We are building a database with roughly 270,000
> molecules and want users to be able to do a substructure and
> similarity search. I've read the following documentation,
> http://openbabel.org/docs/dev/Fingerprints/fingerprints.html,
> and it helps in understand how this process works. However, I
> want to ask whether or not the output file from the query can
> contain the exact same SMILES strings that were generated from
> the fast search index. Currently, the SMILES strings generated
> from the query in the result.smi file are not the canonical
> SMILES that I used to create the fast search index. For example,
> if I were to look for a benzene substructure with the following
> command,
>
> *babel glass.fs -ifs -sc1c1 result.smi*
>
> would I be able to retrieve the SMILES string from glass.sdf,
> which was used to create glass.fs? Many thanks for your patience.
>

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] trying to implement chemical structure matching

2014-06-03 Thread Chris Morley
On 29/05/2014 13:53, ANKIT RUNGTA wrote:
> Hi,
>
> I am trying to evaluate whether this software can help me compare two
> chemical structures and find out whether they are same or similar.
>
> Any kind of support will be helpful.

Using the command line, the easiest way to compare molecules is

   obabel mols.xxx -ok

which uses InChI to compare the first molecule read with each of the 
others. There can be multiple files of any format, e.g.

   obabel molec1.mol2 molec2.sdf -ok

or there can be direct input of SMILES, e.g.

   obabel -:"n1c1[C@H](Br)(Cl)" -:"n1c1[C@@H](Br)(Cl)" 
-:"N1=CC=CC=C1[C@H](Br)(Cl)" -ok

which outputs:

   InChI=1S/C6H5BrClN/c7-6(8)5-3-1-2-4-9-5/h1-4,6H/t6-/m1/s1
   InChI=1S/C6H5BrClN/c7-6(8)5-3-1-2-4-9-5/h1-4,6H/t6-/m0/s1
   Molecules #1 and #2  have different sp3 stereochemistry
   InChI=1S/C6H5BrClN/c7-6(8)5-3-1-2-4-9-5/h1-4,6H/t6-/m1/s1
   Molecules #1 and #3  are identical
   3 molecules converted

For larger data sets the --unique option might help, see:

obabel -L unique

Chris

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Chris Morley
> On 2013-12-03 04:28, Maciek Wójcikowski wrote:
>> You're probably right, C also has to read therm, but other than recognizing
the beginning and the end of the molecule it wouldn't do anything 
especially
kekulization and bonding etc.
>
On 03/12/2013 18:11, Geoffrey Hutchison wrote:
> Actually no. Indeed this would be a useful "lazy" optimization, but is not
> currently implemented this way. The C++ library does in fact read the file,
> but the molecules go through the parsers, which means that things like
> kekulization, bond perception, etc. are generally done.

In fact it is implemented this way for most common multi-molecule file 
formats. The molecules before the one specified by the -f option are 
skipped without being parsed. (The format's virtual SkipObjects() 
function is used.)

Chris

--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Open Babel & Boost.Log linking errors.

2013-10-03 Thread Chris Morley
On 03/10/2013 11:33, Anton Simakov wrote:
> Hi!
>
> I'm trying to use Boost.Log 2.0 in my project which is based on Open Babel.
> I'm currently compiling at Windows with Visual C++ 2010 and linkage
> fails with the following message
>
> libboost_log-vc100-mt-gd-1_54.lib(exceptions.obj) : error LNK2005:
> "public: virtual __thiscall std::basic_stringbuf std::char_traits,class std::allocator
>  >::~basic_stringbuf,class
> std::allocator >(void)"
> (??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ)
> already defined in openbabel-2.lib(openbabel-2.dll)
>
> libboost_log-vc100-mt-gd-1_54.lib(exceptions.obj) : error LNK2005:
> "public: __thiscall std::basic_stringbuf std::char_traits,class std::allocator
>  >::basic_stringbuf,class
> std::allocator >(int)"
> (??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z)
> already defined in openbabel-2.lib(openbabel-2.dll)
>
> fatal error LNK1169: one or more multiply defined symbols found
>
> Seems like both openbabel-2.dll and libboost_log-vc100-mt-gd-1_54.lib
> exporting same symbols.
> Boost binaries are from official sourceforge.net
>  page and openbabel-2.dll was built by myself,
> but the same symbols are exported by openbabel-2.dll from official binaries.
>
> Does anyone knows how to fix that?

I have had this sort of problem in the past with wxWidgets rather than 
Boost but I think it was still with std::basic_stringbuf. I don't know 
how to solve it, but the following may help. Check that the DLLs are 
both built using the same compiler and are using the same runtime 
libraries. A final workaround is to set the option "Multiply Defined 
Symbol Only (/FORCE:MULTIPLE)" in Linker/General/Force File Output. This 
is said to be dangerous but has been ok when I used it. The problem is 
described in several sites on the web but for the ones I found it was 
not very clearly defined and was without a general solution.

Chris


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Count Molecules

2013-08-21 Thread Chris Morley

On 17/08/2013 20:09, Chris Swain wrote:

Is there a way to simply count the number of molecules in a file?


There is an API command OBConversion::NumInputObjects() which works with 
most multi-molecule formats (although it looks faulty for mol2). It is 
currently not exposed in the obabel interface, as far as I know, but the 
attached draft op uses it. Use --count like:


  obabel 10dataset.sdf -onul --count

  10dataset.sdf contains 10 molecules
  0 molecules converted

It works with a single or multiple files which can be of different 
formats and may be compressed. It chemically converts only the first 
molecule in a file and is usable in files up to 2GB: it took 30 seconds 
to count a 1.6GB sdf file with 517K molecules.


Note that an output format is not used but something still has to be 
there. Writing the functionality as an output format -ocount as 
suggested by Noel would be clearer but I didn't find it easy to do.


Chris
/**
opcount.cpp - Counts objects in files

Copyright(C) 2013 by Chris Morley
 
This file is part of the Open Babel project.
For more information, see <http://openbabel.sourceforge.net/>
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
***/
#include 
#include
#include

namespace OpenBabel
{

using namespace std;

class OpCount : public OBOp
{
public:
  OpCount(const char* ID) : OBOp(ID, false){}

  const char* Description(){ return 
"Count molecules in files\n"
"  obabel infile.xxx -onul --count;\n"
"An output format must be present, although it is not used.\n"
"There can be multiple input files, of various formats,\n"
"including compressed files.\n"
"The input format must have a SkipObjects function, which most\n"
"multi-molecule formats do./n/n";
  }

  virtual bool WorksWith(OBBase* pOb)const{ return true; } //all OBBase objects
  virtual bool Do(OBBase* pOb, const char* OptionText, OpMap* pmap, OBConversion* pConv);
};

/
OpCount theOpCount("count"); //Global instance

/
bool OpCount::Do(OBBase* pOb, const char* OptionText, OpMap* pmap, OBConversion* pConv)
{
  // Use file name without path
  string name(pConv->GetInFilename());
  string::size_type posn = name.find_last_of("/\\");
  if(posn==string::npos)
posn=0;

  int nOb = pConv->NumInputObjects();
  clog << name.substr(posn+1) << " contains " << nOb << " molecules" << endl;
  pConv->SetOneObjectOnly();
  return false;
}
}//namespace
--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] obgrep - aromaticity / kekule + molecule name bug

2013-08-08 Thread Chris Morley
With the obabel -s option you can specify the number of matches within a 
single molecule, e.g. find molecules with more than 2 benzene rings. Try
   obabel -L ops s
for details.

(Maybe obgrep's c option was originally going to do this?)

Chris

On 08/08/2013 09:43, Noel O'Boyle wrote:
> Or just look at stderr, where it prints "3 molecules converted".
>
> - Noel
>
> On 8 August 2013 09:43, Noel O'Boyle  wrote:
>> I think it would be easy to add as a general option to all filters. Chris?
>>
>> In the meanwhile, "wc -l" will work I guess (needs Cygwin on windows).
>>
>> - Noel
>>
>> On 8 August 2013 09:38, Pascal Muller  wrote:
>>>
>>>
>>>
 If obabel does it, it always does it better:

 (...)
>>>
>>>
>>> Ok... I need to think to the -s option instead of obgrep, then.
>>> I found the -v option (invert the matching), but is there an equivalent to
>>> the obgrep -c option (number of matches)?
>>>
>>>

 I'm in favour of replacing all obgrep, etc. with symlinks to obabel.
>>>
>>>
>>> Maybe a good idea.
>>>
>>> Many thanks,
>>> Pascal
>>>
>>> --
>>> Get 100% visibility into Java/.NET code with AppDynamics Lite!
>>> It's a free troubleshooting tool designed for production.
>>> Get down to code-level detail for bottlenecks, with <2% overhead.
>>> Download for free and get started troubleshooting in minutes.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
>>> ___
>>> OpenBabel-discuss mailing list
>>> OpenBabel-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>
>
> --
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] obabel: Converting sdf with multi-line properties

2013-07-17 Thread Chris Morley
The fix is at Line 183 in obconversion.cpp:
-static string title(_title); //potential problems in calling code 
with multiple molecules!
+static string title; //static because returning a pointer to it
+title =_title; //now assigned; previously initialized which caused 
problems with multiple mols

I haven't committed it yet (my git setup is in a tangle at the moment).

Chris

On 16/07/2013 09:48, Noel O'Boyle wrote:
> $ grep append `/usr/bin/find . | grep .cpp`
> 
> ./src/transform.cpp:itr = pOptions->find("append"); //Appends values of 
> desc
> riptors or properties to title
> ./src/transform.cpp:"--append  Append properties or descriptors in list 
> to
>   title:\n"
>
> We're on github if you want to submit a patch for review. Better be
> quick though before Chris fixes it! :-)
>
> - Noel
>
>
> On 15 July 2013 22:27, Jeff Janes  wrote:
>> I have an sdf file which has a property that is sometimes multiple lines.
>>
>> When I try to output that property in the title, something very
>> strange happens.  The title for the first molecule with a multi-lined
>> property gets memorized, and then that title gets output for all
>> subsequent molecules which also have a multi-lined property.
>>
>> I don't know what should happen with multiple line properties, but
>> surely it is not this. :)
>>
>> The attempted behavior of joining the lines with a space seems like a
>> reasonable behavior, but then it should do that for every molecule,
>> not replace the title of subsequent molecules with the title of the
>> first afflicted molecule.
>>
>>
>> I've constructed a sdf file, attached, to demonstrate this.
>>
>> obabel -isdf obabel_test.sdf -ocan --append '  foo1foo2'
>> C   1   A
>> CC  2   B B
>> CCC 3   C
>> 2   B B
>> C   5   E
>> CC  6   F
>>
>> The title for butane should be "4 D D", not "2 B B"
>>
>> This is version 2.3.2.
>>
>> Any idea what is going on?  If I want to dig into the source code
>> myself, where should I start?
>>
>> Cheers,
>>
>> Jeff
>>
>> --
>> See everything from the browser to the database with AppDynamics
>> Get end-to-end visibility with application monitoring from AppDynamics
>> Isolate bottlenecks and diagnose root cause in seconds.
>> Start your free trial of AppDynamics Pro today!
>> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>
> --
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] SMILES, SMARTS, and PDB

2013-07-06 Thread Chris Morley
On 05/07/2013 17:54, Brett T. Hannigan wrote:
> I have a database of molecules in pdb files.  I'd like to go through
> each molecule and see if it has certain substructures, and if they do
> identify which atoms are part of that substructure.  So it's easy enough
> to read the pdb file in, convert it to SMILES representation, and then
> do a SMARTS query to look for my substructures.  However, if the SMARTS
> query reports that the substructure is present in the molecule, I'm not
> sure how to identify the atoms in the pdb file which make up the match.
>   Any ideas?

If you just want to visualize this and the substructures can represented 
by SMILES, put them in a file, and try

   obabel *.pdb -O out.svg -s substructs.smi green

Only those molecules containing at least one substructure are displayed 
and the matched atoms are displayed colored green. If additional colors 
are specified in the command, each substructure can have its own color.
For more details
   obabel -L ops s

To do more you will need to use OBSmartsPattern in C++, python, etc. 
http://openbabel.org/api/2.3/classOpenBabel_1_1OBSmartsPattern.shtml

Chris


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Segmentation fault in inchi conversion

2013-06-26 Thread Chris Morley
I think this is due to a bug in the stereo perception code which 
appeared in v2.3.2 . It has been mentioned before on this and the 
development list but a fix is not yet committed to the development code. 
Version 2.3.1 works ok for me.

Incidentally, prefer obabel to the older babel. obabel is safer with 
incorrect input and can handle commandline options with parameters much 
better than babel.

Chris

On 26/06/2013 11:57, Fredrik Wallner wrote:
> Hi,
>
> No, I never found a solution to this. I managed a workaround for the
> specific problem (although I cannot remember for sure I believe I
> accepted some help from ChemDraw…) so my needs fainted…
>
> Kind regards,
> Fredrik
>
> 25 jun 2013 kl. 14:33 skrev Jon Fuller  >:
>
>> Hi Fredrik,
>>
>> Did you find a solution to this problem? I found a similar example:
>> I pasted example code for pybel, but running the command below with
>> both inchis in the file inchi.txt:
>> babel -iinchi inchi.txt -osdf inchi.sdf
>> Will result in "Segmentation fault: 11"
>> Remove the second inchi and the command works.
>>
>> mol1 = pybel.readstring("inchi",
>> "InChI=1S/C19H22N2O/c1-4-15-7-6-8-16(5-2)18(15)10-9-14-11-17(13-21-12-14)19(22)20-3/h6-13H,4-5H2,1-3H3,(H,20,22)/b10-9+")
>>
>> print"molecule one works"
>>
>>
>> mol2smiles = pybel.readstring("smiles",
>> "O=C(OC[C@H](\C3=C2/[C@@H](O[C@H]1O[C@@H]([C@@H](O)[C@H](OC(=O)C)[C@H]1O)COC(\C=C)(C)C)[C@H](O)[C@H](C)[C@H]4C(=C/[C@@]2(C)[C@@H](O)C3)\[C@@H](COC)CC4)C)C")
>>
>> print"smiles works for molecule two!"
>>
>> print mol2smiles
>>
>>
>> mol2inchichemspider = pybel.readstring("inchi",
>> "InChI=1S/C36H56O12/c1-10-35(6,7)45-17-26-30(41)33(46-21(5)38)31(42)34(47-26)48-32-28-24(18(2)15-44-20(4)37)13-27(39)36(28,8)14-25-22(16-43-9)11-12-23(25)19(3)29(32)40/h10,14,18-19,22-23,26-27,29-34,39-42H,1,11-13,15-17H2,2-9H3/b25-14-/t18-,19-,22-,23+,26-,27+,29-,30-,31-,32-,33+,34-,36+/m1/s1")
>>
>> print"inchi does not work for molecule two"
>>
>> print mol2inchichemspider
>>
>>
>> Best,
>>
>> Jon
>>
>>
>>
>> On 11 April 2013 16:21, Fredrik Wallner > > wrote:
>>
>> Hi again,
>>
>> Some more information…
>> The InChI
>> "InChI=1S/C8H12/c1-2-4-6-8-7-5-3-1/h1-2,7-8H,3-6H2/b2-1-,8-7-"
>> gives the same problem.
>> I have now updated the ubuntu box to also run ob 2.3.2 and it
>> segfaults now as well, so it seems it has something to do with
>> differences between 2.3.1 and 2.3.2.
>>
>> Kind regards,
>> Fredrik
>>
>> 11 apr 2013 kl. 14:45 skrev Fredrik Wallner > >:
>>
>> > Hi,
>> >
>> > I get a segmentation fault when running the following command:
>> > obabel -iinchi
>> 
>> -:"InChI=1S/2C8H12.Ni/c2*1-2-4-6-8-7-5-3-1;/h2*1-2,7-8H,3-6H2;/b2*2-1-,8-7-;"
>> -osmi
>> >
>> > I'm running Open Babel 2.3.2 on a MacBook Pro, OSX 10.8.3
>> (installed via homerbrew).
>> > I have also tried it on an Ubuntu box (10.04.4) running ob 2.3.1
>> and here it's working without problem. Is there anyone else having
>> problems with this, or is it just me?
>> >
>> > Kind regards,
>> > Fredrik
>> >
>> 
>> --
>> > Precog is a next-generation analytics platform capable of advanced
>> > analytics on semi-structured data. The platform includes APIs
>> for building
>> > apps and a phenomenal toolset for data science. Developers can use
>> > our toolset for easy data analysis & visualization. Get a free
>> account!
>> > http://www2.precog.com/precogplatform/slashdotnewsletter
>> > ___
>> > OpenBabel-discuss mailing list
>> > OpenBabel-discuss@lists.sourceforge.net
>> 
>> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>
>> 
>> --
>> Precog is a next-generation analytics platform capable of advanced
>> analytics on semi-structured data. The platform includes APIs for
>> building
>> apps and a phenomenal toolset for data science. Developers can use
>> our toolset for easy data analysis & visualization. Get a free
>> account!
>> http://www2.precog.com/precogplatform/slashdotnewsletter
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> 
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>
>
>
>
> --
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
>
>
>
> ___
> OpenBabel-discuss mailing li

Re: [Open Babel] vibrational info missing from g03 file

2013-05-25 Thread Chris Morley
On 23/05/2013 17:18, Mathias Laurin wrote:
> Dear all,
>
>
> I have compiled Open Babel rev 5063 with Python bindings and no GUI on
> Windows XP under MSYS/MinGW.
>
>
> It seems that I am missing the vibrational data from Gaussian g03 files
> now, although it was present under Open Babel 2.3.0.
>
> I am using input files from the OrbiMol database
> http://www.lct.jussieu.fr/pagesperso/orbimol/
>
> When I convert the Gaussian 03 file to Molden with `obabel -og03
> -omolden` from SVN rev 5063 (trunk): it only gives me the atomic
> coordinates; with 2.3.0, I also obtain the vibrational data.
>
> Still with SVN rev 5063, from Python, `mol.HasData(ob.VibrationData)`
> returns False on the Gaussian file. It returns True on another Molden
> file I have tried that also contains vibrational data.
>
>
>>From what I have tried, Gaussian 98 files give me a different problem
> (bug #862) and Molden files are parsed very well.
>
>
> I am using Open Babel for my small project
> http://vibeplot.sourceforge.net

I could not find the files in the OrbiMol database and have used files 
from the NIST site referenced below.

On Windows 7 and with versions 2.3.1 and 2.3.2 from the installer and 
also with the compiled trunk code, I could read 18 vibrational 
frequencies from this file
http://cccbdb.nist.gov/iofiles/c74840m25b17.out (renamed below)
which I think is a Gaussian g03 file.
  obabel ethane.g03 -omolden
  obabel ethane.g03 -ocml -xp
I don't know whether the molden output is correct, but the cml output is 
what I expected. I don't know why you are having difficulties. Could you 
point me directly to the files you are using or post one of them.

(I guess you mean obabel -ig03 -omolden in your example above?)

Chris


--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Atom numbers

2013-04-26 Thread Chris Morley
On 25/04/2013 23:39, Dimitri Maziuk wrote:
> On 04/25/2013 05:00 PM, Chris Morley wrote:
>> On 25/04/2013 21:52, Dimitri Maziuk wrote:
>>
>>> is there an option to display atom numbers on 2D drawing (png or svg,
>>> using sdf for input)? E.g. MarvinView has a checkbox under View - Misc.
>>>
>>> Specifically, as a command line switch to [o]babel or pybel api call?
>>
>> There is for svg: use the -xi option.
>> obabel -L svg will list all the options.
>>
>> This option is not currently implemented for png output.
>
> Great, thanks. Svg is a better option anyway. Any chance to change font
> colour for the indexes? -- red on red is suboptimal (where atoms &
> indexes overlap).

It's hardwired in line 247 in src/depict/depict.cpp if you are in a 
position to recompile. I'll change it to "teal" for the future.

Chris


--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Atom numbers

2013-04-25 Thread Chris Morley
On 25/04/2013 21:52, Dimitri Maziuk wrote:

> is there an option to display atom numbers on 2D drawing (png or svg,
> using sdf for input)? E.g. MarvinView has a checkbox under View - Misc.
>
> Specifically, as a command line switch to [o]babel or pybel api call?

There is for svg: use the -xi option.
obabel -L svg will list all the options.

This option is not currently implemented for png output.

Chris



--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Alias data in SD file

2013-04-25 Thread Chris Morley
On 24/04/2013 12:40, Jean-Marc Nuzillard wrote:
> Dear All,
>
> I am presently attempting to read an SD file with Alias data at the end
> of molecule description
> such as
> ...
> A5
> H1A
> A6
> H1B
> A7
> H1C
> ...
> that causes the printing of warning messages such as:
> Alias H1A was not chemically interpreted
>
> I use OpenBabel 2.3.2 on Windows through the python bindings.
>
> Such a behavior was reported about one year ago in the openbabel-discuss
> mailing list.
> Is the alias information ignored for true, or is there a way to retrieve the
> link between atom indexes and the corresponding aliases?

The alias info is still there (in an OBGenericData object attached to 
the OBAtom). Here is some C++ code to retrieve it, taken from mdlformat.cpp.

if(atom->HasData(AliasDataType))
{
   AliasData* ad = static_cast(atom->GetData(AliasDataType));
   string alias = ad->GetAlias();
}

I'm not sufficiently familiar with the python bindings to know if this 
will translate well.

Chris


--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Bug 2.3.1 vs 2.3.2 (mol.OBMol.DeleteAtom?)

2013-04-25 Thread Chris Morley

On 24/04/2013 16:01, Pascal Muller wrote:

Hi,

I have a little pybel script for generating Murcko scaffolds, which
works well with 2.3.1, but fails on a few molecules ("Segmentation
fault") with 2.3.2.

Depending on code modifications, the fault raises at different points,
but I have no clue on why the bug is happening.

Below is my code shortened as much as I could.

Regards,
Pascal



#!/usr/bin/env python
# encoding: utf-8
import sys
import os, pybel
import openbabel as ob

def GetMurckoFramework(mol):
 haveAtomWithOneNeighbor,atomsWithOneNeighborList =
checkIfIsOnlyOneNeighbor(mol)
 while (haveAtomWithOneNeighbor):
 for atomToDel in atomsWithOneNeighborList:
 mol.OBMol.DeleteAtom(atomToDel) # delete atom which are
not part of a cycle or a linker (terminal atoms)
 haveAtomWithOneNeighbor,atomsWithOneNeighborList =
checkIfIsOnlyOneNeighbor(mol)
 return mol

def checkIfIsOnlyOneNeighbor(mol):
 isAnAtomWithOneNeighbor = 0
 atomWithOneNeighborList = []
 for atom in ob.OBMolAtomIter(mol.OBMol):
 if not atom.IsInRing():
 neighborsCount = 0
 for neighbor in ob.OBAtomAtomIter(atom):
 neighborsCount = neighborsCount + 1
 if (neighborsCount <= 1): # It is a terminal atom (only
one neighbor) double bond
 atomWithOneNeighborList.append(atom) # will be deleted
 isAnAtomWithOneNeighbor = 1
 return isAnAtomWithOneNeighbor, atomWithOneNeighborList


def main():
 if len(sys.argv) < 2:
 print "No input file provided: Murcko.py filetosprocess.smi"
 sys.exit(1)

 mol1 = pybel.readstring("smi", "C1(=Cc2cn(nc2)CC(=O)N)C(=O)NC(=O)S1")
 mol2 = pybel.readstring("smi", "C1(=CC2=C(N=C(C2)C(=O)N)C)C(=O)NC(=O)S1")
 li = [mol1, mol2]

 for mol in li:
 mol = GetMurckoFramework(mol)
 print mol

if __name__ == '__main__':
 main()


The problem seems to be in the stereo perception code called during 
smiles output. It possibly arises because the atom deletion somehow 
messes up the molecule and the stereo perception routines don't cope. 
I've tried deleting the stereochemical data in the scaffold to little 
effect, but most effective was to suppress stereo perception in 
smilesformat output. The output option -xi (C++ pConv->AddOption("i");) 
nearly does this but needs line 3608 in smilesformat.cpp to be

bool is_chiral = isomeric && AtomIsChiral(atom);

But this is only a partial solution and the stereo perception needs to 
be more robust. The bigger problem is how to handle OBMol objects 
sometimes as patterns rather than as molecules.


Remember also that atom indices can be invalidated when another atom is 
deleted, although that doesn't seem to be an issue in your code.


Attached is an op based on your method used from obabel (or the gui) for 
debugging.


Chris

/******
murcko.cpp - A OBOp for generation Murcko scaffolds

Copyright (C) 2013 by Chris Morley

This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
***/
#include 
#include 
#include 
#include 
#include 

namespace OpenBabel
{

class OpMurcko : public OBOp
{
public:
  OpMurcko(const char* ID) : OBOp(ID, false){};
  const char* Description()
  { return "Generate Murcko scaffold\n"
   "e.g. obabel mols.xxx -O scaffolds.yyy --murcko"; }

  virtual bool WorksWith(OBBase* pOb)const{ return dynamic_cast(pOb)!=NULL; }
  virtual bool Do(OBBase* pOb, const char* OptionText=NULL, OpMap* pOptions=NULL, OBConversion* pConv=NULL);
};

/
OpMurcko theOpMurcko("murcko"); //Global instance

/
bool OpMurcko::Do(OBBase* pOb, const char* OptionText, OpMap* pOptions, OBConversion* pConv)
{
  OBMol* pmol = dynamic_cast(pOb);
  if(!pmol)
return false;
  pmol->DeleteHydrogens();
  pmol->DeleteData("OBTetrahedralStereo");
  pmol->DeleteData("OBCisTransStereo");
  bool done=false;
  while(!done)
  {
done=true;
for(OBMolAtomIter a(pmol);a;++a)
{
  if(a->GetValence()==1
 && (!a->HasDoubleBond() || OBAtomAtomIter(&*a)->GetValence()<3))
  {
   

Re: [Open Babel] Similarity search / Open Babel Warning in ParseSmiles

2013-04-11 Thread Chris Morley
On 10/04/2013 16:55, Pascal Muller wrote:
> Dear all,
>
> I would like to find similar molecules within library and compute
> Tanimoto coefficient.
>
> I'm right by assuming that, using -at0.0, I should retrieve all molecules?
>
> obabel library.fs -Smol.smi -ofpt -at0.0
> (version 2.3.2)
>
> But I get only 1098 compounds out of a total of 1579, along with 262
> warning messages like:
>
> Open Babel Warning  in ParseSmiles
> Invalid SMILES string: 1 unmatched ring bonds.
>
> or:
> Open Babel Warning  in ParseRingBond
> Number not parsed correctly as a ring bond
>
> If I use the library.smi file instead of .fs, I get only 19 molecules
> (-at0.0), and no error message.
>
> If I convert the library smiles file into sdf, and depending on the
> compound in -Smol.smi, sometimes all molecules are converted, as I
> expect with -at0.0, sometimes only a few are converted, sometimes only
> one with e.g. this output:
>
> ZINC00089110   183 bits set
> 00410030 01248d00 a0084102 40100e04 40050001 00200809
> 1480 102c1402 03484900 821a4081 40350020 40011a80
> 540a8518 202d 0420 0104 24484000 02000b00
> 400920c0 02000101 000a0500 38040694 40808c00 0448829e
> 00200010 20203620 44404010 88040150 008000e2 c11e0003
> ac824010 c3010680
> 1 molecule converted
>
>
> I'm trying to get a sample smi file to send as example, but until now
> I'm not able to reproduce every case I have written above.
>
> Did you already encounter such behavior, or is there a known bug I'm
> not aware of?

Your problem with missing molecules when using fastsearch with -at0.0 
seems to be caused by two bugs: 1) comparing Tanimoto coeffs with > 
rather than >= and 2) for files which do not have a new line at the end, 
the conversion stopped because of an eof when the last molecule was 
read. In fastsearch, unusually, the molecules are read non-sequentially. 
I'll commit the changes soon. Thanks for finding these bugs.

Incidentally, the -S option is deprecated; use -s instead, which can 
take either SMARTS or a file name containing molecule(s), and is more 
versatile.

Chris


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Confusion in similarity search

2013-04-11 Thread Chris Morley
On 11/04/2013 15:45, Pascal Muller wrote:
> Hi,
>
> In a similarity search, obabel consider another molecule than the
> reference I'm giving.
>
> My library being test.smi:
>
> C1(=CC2=C(C(C(C2)(C#N)C#N)(CC(=O)C)C#N)C(=O)N)C(=O)NC(=O)S1   A
> C1(=Cc2c(oc3c(cc(cc3)Br)c2=O)C(=O)N)C(=O)NC(=O)S1B
> C1(=CC2=C(C(C(C2)(C#N)C#N)(C22=O)C#N)C(=O)N)C(=O)NC(=O)S1C
>
> after conversion in fs format:
> obabel test.smi -ofs
>
> The command:
> obabel test.fs -SA.smi -ofpt -at0.0
> is giving:
>
>> C
>> A   Tanimoto from C = 1
> Possible superstructure of C
>> B   Tanimoto from C = 0.278689
> 3 molecules converted
>
> A is _not_ the reference (first line). obabel is considering C instead.
>
>
> B as reference is ok:
> obabel test.fs -SB.smi -ofpt -at0.0
>> B
>> C   Tanimoto from B = 0.278689
>> A   Tanimoto from B = 0.278689
> 3 molecules converted
>
> C as reference is OK, and is producing the same result as if taking A
> as reference.
>
>
> Changing the order in test.smi (e.g. C, A, B), using C as reference
> returns A in the first line. Using A as reference is OK.
>
> I have 43 similar cases out of my 1579 compounds library.
> Any ideas apart from shuffling the smiles file? :)

fs and fpt formats are not really intended to be used together.

If you want to find the 10 most similar molecules to molecule A in a 
*large* dataset use
   obabel test.fs -osmi -s A.smi -at10

OR to show similarities from A to each molecule in a *small* dataset
   obabel A.smi test.smi -ofpt
(The target molecule is the first molecule that is output.)

You shouldn't need to use -at0.0 (even when its bugs are corrected, see 
next post).

Chris



--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] ranking SD files

2013-04-08 Thread Chris Morley
On 08/04/2013 15:14, Kareem Khoury wrote:
> is it possible with Babel to re-order an sdf file based off of a data field
>
> I have an sdf file with a docking score data filed.
>
> i was looking at the --sort command but as far as i can tell it only
> sorts based off of descriptors.

You are right that --sort works only with descriptors. --filter works 
with descriptors and properties (from SD files), but could only select 
the molecules with the property within a specified range. Since at least 
one person would find it useful I maybe could extend --sort to use 
properties - but don't expect anything soon.

Chris


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] (no subject)

2013-04-02 Thread Chris Morley
On 02/04/2013 10:20, Rajeev Roy wrote:
> On 02/04/2013 07:51, Rajeev Roy wrote:
>  > I have a confusion regarding validity of descriptors appended by help of
>  > the plugin provided in openbabel.

> I''m talking about accuracy of each descriptor.
>
> And at the same time I also included rotor (i.e. number of
> rotatable_bond) as a descriptor in plugindefines.txt, as per your last
> suggestion. As it wasn't listed in descriptors list initially.

See a discussion in the thread
http://forums.openbabel.org/Counting-rotors-td957636.html
where it is pointed out that this count does not include all the rotors 
needed for a full statistical mechanics calculation. The simple count 
does include CN bonds in amides which are sometimes excluded, but others 
more expert in cheminformatics will have to comment on the subtleties. 
It would obviously help if you said what you hope to do with the count.

Chris

--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] (no subject)

2013-04-02 Thread Chris Morley
On 02/04/2013 07:51, Rajeev Roy wrote:
> I have a confusion regarding validity of descriptors appended by help of
> the plugin provided in openbabel.
> Please help me in this regard.

You need to be more specific.

Is it the accuracy of a particular descriptor?
Or the design of a new descriptor based on atom properties with 
OBGroupContrib? or based on molecular structure with SmartsDescriptor?

Or making a descriptor by combining existing descriptors?

Or coding a new descriptor in C++? or via the text file plugindefines.txt?

Or something else?

Chris

--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] (no subject)

2013-03-28 Thread Chris Morley
On 28/03/2013 12:17, Pascal Muller wrote:
> Hi,
>
>> Is there a way to append ROTATABLE_BOND as a descriptor in openbabel, If is
>> there any then please help me.
>
> http://forums.openbabel.org/number-of-rotatable-bonds-td959206.html
>
> Should be easy to add the corresponding line in
> openbabel-2.3.1/tools/obprop.cpp, recompile, and run obprop, if that
> is what you want.
>
> Or just run e.g.
>
> #!/usr/bin/python
> import pybel
> for mol in pybel.readfile("smi", "file.smi"):
> print mol.OBMol.NumRotors(), "\t", mol.OBMol.GetTitle()

If you would prefer the number of rotatable bonds as a descriptor and 
without having to recompile, add the following item to 
data/plugindefines.txt

SmartsDescriptor
rotors
[!$(*#*)&!D1]-!@[!$(*#*)&!D1]
Number of rotatable bonds\n
 From 
http://www.daylight.com/dayhtml_tutorials/languages/smarts/smarts_examples.html#ROTATE

Use like:
obabel mols.xxx -O out.yyy --append rotors
obabel mols.xxx -O out.yyy --sort rotors+
obabel mols.xxx -O out.yyy --filter "rotors>2"
obabel mols.xxx -O out.yyy --largest 3 rotors+

Chris



--
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Please can you help me with the following question...

2013-03-27 Thread Chris Morley
It is better to ask questions on the openbabel mailing list - there are 
more people there to answer them.

On 27/03/2013 03:21, EDGAR R wrote:
> I am a chemistry student. I read about your work OpenBabel and I have
> some questions:
>
> 1. What do the numbers OpenBabel Fingerprint Program?
http://openbabel.org/docs/dev/FileFormats/Fingerprint_format.html
and many times on the mailing lists, e.g. in a thread starting on 
15/09/2011.

> 2. What dictionaries are used in the program to calculate the
> fingerprint OpenBabel?
The FP4 fingerprint uses data/SMARTS_InteLigand.txt. The default FP2 
fingerprint does not have a fixed set of structures but is of the 
Daylight type which is described on their website.
>
> I will be very grateful for their help.
>
> Regards,
>
> Edgar
> Colombia.
>
>
>


--
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] obabel and fingerprints

2013-03-13 Thread Chris Morley
On 12/03/2013 11:28, Chris Swain wrote:
>> Message: 4
>> Date: Sun, 10 Mar 2013 21:02:41 +0000
>> From: Chris Morley mailto:c.mor...@gaseq.co.uk>>
>> Subject: Re: [Open Babel] obabel and fingerprints
>> To: openbabel-discuss@lists.sourceforge.net
>> <mailto:openbabel-discuss@lists.sourceforge.net>
>> Message-ID: <513cf4f1.2000...@gaseq.co.uk <http://gaseq.co.uk/>>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> On 10/03/2013 12:45, Chris Swain wrote:
>>> I'm moving to use obabel rather than babel and I'm having a few
>>> problems working out the syntax
>>>
>>>  obabel /Users/swain/obsmiles.smiles -osmi -s "c1c1" -xt
>>>
>>> Gives a list of 907 molecule names
>>>
>>> I've created the fastsearch index
>>>
>>> obabel /Users/swain/obsmiles.smiles -ofs
>>>
>>> this created /Users/swain/obsmiles.fs as expected.
>>>
>>> I then tried
>>>
>>> obabel  /Users/swain/obsmiles.fs  -ifs -s "c1c1" -osmi
>>> 907 candidates from fingerprint search phase
>>> OC1C2NC(C1O)CC(C2)(F)FF)001377cc1c1371O 001376
>>> 1 molecule converted
>>>
>>> Any help appreciated.
>>
>> I don't see anything wrong with the syntax. (The -ifs is actually not
>> needed.) Something similar works ok for me on Windows with both v2.3.2
>> and trunk.
>>
>> You could try
>>   obabel  /Users/swain/obsmiles.fs -osmi
>> which should give info on the .fs index, in case it hasn't been made
>> properly. Otherwise I'm stumped.
>>
>> Chris
>
> Thanks
> obabel  /Users/swain/obsmiles.fs -osmi
> Shows the index to be formed correctly, but I think I've found a
> potential problem. This is a very old smiles file I use for testing, it
> seems to have the old Mac line endings, if I convert to unix it all runs
> fine. Is it possible that everything works fine with the old Mac line
> endings except the fs search?
>
> This is probably not a big issue since I think all files created now
> will have Unix line endings.

I think this is the correct diagnosis. OB's input stream is usually 
filtered to convert the line endings to the unix (LF) form. But this not 
done for binary formats, which includes fastsearch, forgetting that it 
does a ordinary text read in its second stage. A data file with Mac 
endings gave similar errors for me also.

The lack of filtering is not so problematical with Windows line endings 
(CR LF) because the end of the lines are found ok using the LF and the 
CR is just whitespace at the end of the lines, which is usually cleaned 
up anyway. I guess there may be some cases where this not good enough 
and a proper filtering should be applied. I'll think how to do the 
repair, but do not regard it as urgent. The Mac line endings are 
obsolete, and most data sets that fastsearch is applied to are unix anyway.

Chris


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] obabel and fingerprints

2013-03-10 Thread Chris Morley
On 10/03/2013 12:45, Chris Swain wrote:
> I'm moving to use obabel rather than babel and I'm having a few problems 
> working out the syntax
>
>   obabel /Users/swain/obsmiles.smiles -osmi -s "c1c1" -xt
>
> Gives a list of 907 molecule names
>
> I've created the fastsearch index
>
> obabel /Users/swain/obsmiles.smiles -ofs
>
> this created /Users/swain/obsmiles.fs as expected.
>
> I then tried
>
> obabel  /Users/swain/obsmiles.fs  -ifs -s "c1c1" -osmi
> 907 candidates from fingerprint search phase
> OC1C2NC(C1O)CC(C2)(F)FF)001377cc1c1371O 001376
> 1 molecule converted
>
> Any help appreciated.

I don't see anything wrong with the syntax. (The -ifs is actually not 
needed.) Something similar works ok for me on Windows with both v2.3.2 
and trunk.

You could try
   obabel  /Users/swain/obsmiles.fs -osmi
which should give info on the .fs index, in case it hasn't been made 
properly. Otherwise I'm stumped.

Chris


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] obminimize

2013-02-28 Thread Chris Morley
On 28/02/2013 07:48, Оги Боги wrote:
> Thank you guys for your answer. I tried what you said but the output is
> not a sdf file. How to format it in order to obtain normal sdf file?

An alternative way of accessing the same functionality is to use the 
--minimize op with obabel, which provides more flexibility in the input 
and output. So, for instance,

   obabel orig.sdf -O result.sdf --minimize -f1 -l2

will optimize the first two molecules in orig.sdf and output to 
result.sdf. Type obabel -L minimize for more details.

Chris



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Fingerprints

2013-02-14 Thread Chris Morley
On 14/02/2013 08:49, Saulė G. wrote:
> Dear Sir or Madam,
> I am using your products for a fast search of molecule in
> DB//Crystallography Open Database ( http://www.crystallography.net/ ) .
> I am using fingerprints and i really need to know
> what means each bit. Is this information anywhere or could you tell me this?

For the default FP2 fingerprint try

obabel -L fpt
or
obabel -L FP2

Be aware that a bit may map to more than one structure.

For FP4 the structure keys are listed in data/SMARTS_InteLigand.txt

Chris


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] 2.3.2

2013-02-12 Thread Chris Morley
On 12/02/2013 09:38, Chris Swain wrote:
>
> On 12 Feb 2013, at 07:32,
> openbabel-discuss-requ...@lists.sourceforge.net
> <mailto:openbabel-discuss-requ...@lists.sourceforge.net> wrote:
>
>> Message: 3
>> Date: Sun, 10 Feb 2013 19:40:53 +
>> From: Chris Morley mailto:c.mor...@gaseq.co.uk>>
>> Subject: Re: [Open Babel] 2.3.2
>> To:openbabel-discuss@lists.sourceforge.net
>> <mailto:openbabel-discuss@lists.sourceforge.net>
>> Message-ID: <5117f7c5.9000...@gaseq.co.uk <http://gaseq.co.uk/>>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> On 09/02/2013 20:04, Chris Swain wrote:
>>> Hi
>>> My main machine has OpenBabel 2.3.1 installed and this command works
>>> fine.
>>>
>>> ChrisMacbookPro:~ swain$ /usr/local/bin/obgrep -v -c ""
>>> /Users/swain/Desktop/ChemicalStructures/acetophenones.sdf
>>> 665
>>> The number being the number of molecules in the sdf file.
>>>
>>>
>>> I've been playing around with OpenBabel 2.3.2 from SVN and I now get
>>> an error, it seems I now need to explicitly include the input file type.
>>>
>>> ChrisMacbookPro:~ swain$ /usr/local/bin/obgrep -v -c ""
>>> /Users/swain/Desktop/ChemicalStructures/acetophenones.sdf
>>>
>>> Does not work but if I include -isdf it does work.
>>>
>>> SMILES files work with or without the input file defined.
>>>
>>> I'm not sure if this is something I have done or if it is a bug?
>>
>> It does that for me too, apparently as a result of a change made last
>> summer.
>>
>> As an alternative, you could use obabel with the -v option and a nul
>> output format:
>>
>>   obabel 10dataset.sdf -onul -v "C1C1"
>>   8 molecules converted
>>
>> This has the extension in that, instead of a SMARTS pattern, the
>> parameter of -v can be the name of a file containing several structures
>> (in any format) you want to exclude (or, with the -s option, include).
>>
>> There is currently no obabel equivalent of obgrep's -t NUM option which
>> restricts to molecules with exactly NUM matches - but I've just
>> rectified that in the development code.
>>
>> Chris
>
> Am I correct in thinking the output is written to stand error not
> standard output?

The "8 molecules converted" and other informative messages are written 
to clog, which may be mapped to standard error. Error messages are 
written to standard error, and the output of formats may be written to 
standard out.

I prefer using obabel rather than standalone programs because (usually) 
its functionality can also be accessed from the GUI. It has a uniform 
user interface and also additional features, such as adding or removing 
hydrogens, filtering, sorting, that can often be done at the same time.

Chris


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] cannot open aromatic.txt

2013-02-10 Thread Chris Morley
On 09/02/2013 03:14, JimJoyner wrote:
> "...which you may not have intended..."
> This was intended.
>
> "...but should not be catastrophic."
> This was done and worked many times until this problem came up.
>
> "Possibly the environment variable BABEL_DATADIR has become corrupted."
> I reset the environment variable BABEL_DATADIR.
> This did not fix it.
>
> "The latest OpenBabel release is 2.3.2."
> I tried installing with:
> OpenBabel2.3.2a_Windows_Installer
>
> I was interested in running with the SMARTS pattern option with FP3.
> This uses a "pattern.txt" file in a "data" directory.

Be aware that patterns.txt does not have a very full set of SMARTS 
patterns and is there to provide a template for you to add your own.

> There is no pattern file and no directory as there is for version 2.3.1:
> OpenBabel-2.3.1\data

Since Kirk Simmons on this list also seems to be have trouble with 
missing data on Windows XP, I dug out my old XP computer and although 
the keyboard didn't work, I was able to install OpenBabel 2.3.2 and run 
the GUI. Everything seemed to be there. The exe and dll files in 
C:\Program Files/Openbabel-2.3.3 and the data, documentation and 
examples are in (something like) C:\Application Data\Owner\OpenBabel-2.3.2
The data etc. folders are in different places in 2.3.0, 2.3.1 and 2.3.2 
driven by the tightening of the permissions in versions of Windows later 
than XP.

> The instructions in the "Documentation" link on the
> download page refers to instructions for version 2.3.1.

It's struggle keeping documentation up to date, but the user interface 
for the Windows installer and indeed almost all of OpenBabel interface 
does not change much between minor versions.

I'm afraid I still don't know why you are having difficulties.

Chris


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] 2.3.2

2013-02-10 Thread Chris Morley
On 09/02/2013 20:04, Chris Swain wrote:
> Hi
> My main machine has OpenBabel 2.3.1 installed and this command works fine.
>
> ChrisMacbookPro:~ swain$ /usr/local/bin/obgrep -v -c "" 
> /Users/swain/Desktop/ChemicalStructures/acetophenones.sdf
> 665
> The number being the number of molecules in the sdf file.
>
>
> I've been playing around with OpenBabel 2.3.2 from SVN and I now get an 
> error, it seems I now need to explicitly include the input file type.
>
> ChrisMacbookPro:~ swain$ /usr/local/bin/obgrep -v -c "" 
> /Users/swain/Desktop/ChemicalStructures/acetophenones.sdf
>
> Does not work but if I include -isdf it does work.
>
> SMILES files work with or without the input file defined.
>
> I'm not sure if this is something I have done or if it is a bug?

It does that for me too, apparently as a result of a change made last 
summer.

As an alternative, you could use obabel with the -v option and a nul 
output format:

   obabel 10dataset.sdf -onul -v "C1C1"
   8 molecules converted

This has the extension in that, instead of a SMARTS pattern, the 
parameter of -v can be the name of a file containing several structures 
(in any format) you want to exclude (or, with the -s option, include).

There is currently no obabel equivalent of obgrep's -t NUM option which 
restricts to molecules with exactly NUM matches - but I've just 
rectified that in the development code.

Chris

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] cannot open aromatic.txt

2013-02-08 Thread Chris Morley
This is strange behaviour. The command line you showed would write text 
representation of fingerprints to C:\OUTPUTNAME.smi, which you may not 
have intended but should not be catastrophic. Possibly the environment 
variable BABEL_DATADIR has become corrupted. Try re-setting it (via the 
Control Panel) to the directory containing the OpenBabelData data files.
With the 2.3.1 this is probably  something like C:\Program 
Files\OpenBabel-2.3.1\data (I've forgotten exactly where on Windows XP). 
The latest OpenBabel release is 2.3.2.

Chris

On 08/02/2013 02:40, JimJoyner wrote:
> Running openbabel from the command prompt (WIN XP),
> accidentally ran it with no input file:
>
> obabel c:\INPUTname.smi -O c:\OUTPUTname.smi -ofpt -xfFP3
>
> After this, tried with the input file there with a list of SMILES,
> get error message:
>
> "cannot open aromatic.txt"
>
> and it reverts to saved data for the output file.
>
> Tried uninstalling and reinstalling openbabel 2.3.1 with no change.
>
> Previously something similar happened with openbabel 2.3.0
> and using openbabel under a different user name on the computer worked.


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Deleting Residues and Atoms in Molecules

2013-01-15 Thread Chris Morley
On 15/01/2013 11:07, mpillong wrote:
> Hey everyone,
>
> I seem to be stuck again. What I want to do is a sliding window analysis
> over the residues of a peptide. Currently, I implemented a for-loop that
> creates a copy of the original molecule and with every run deletes all
> residues outside of the sliding window. I delete the residues using the
> DeleteResidue() function in OBMol. However, this only deletes the residue
> entries and not the atoms stored in the residues. If I iterate over the
> atoms of the residue prior to deleting it and try to delete them, I get an
> error message saying:
>
> "java(79481,0x100501000) malloc: *** error for object 0x1120e1840: pointer
> being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug"
>
> Here is a code snippet:
>
>
>
> Has anybody ever done something similar or knows how to work this one out?

In Openbabel deleting an atom causes the atom indices that are larger to 
be readjusted. So it is safer to make a list of the atoms you want to 
delete, sort them, and delete in decreasing order of index.
Not very civilized...

Chris

--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] How to Compile on Windows against the OpenBabel Library

2013-01-09 Thread Chris Morley
It is a pity that writing your own C++ programs on Windows isn't easier, 
but until a simplified method is developed the best way is to
download the whole project from SVN. (I use TortoiseSVN 
http://tortoisesvn.net.) You could checkout the 2.3.2 branch 
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/branches/openbabel-2-3-x,
 
or possibly the development code 
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk.

These contain a openbabel.snl file for Visual Studio 2010 (or later) in 
\windows-vc2008\build\ (ignore the name!) that contains a lot of 
projects with all the include and link dependencies in them. You will 
need to build at least the openbabel project. You could use of of the 
simpler one (e.g. obdistgen) as a template for your code, possibly by 
duplicating and renaming the project file.

Linking to an existing DLL (like openbabel-2.dll) requires a .lib file 
that was made in the same build, and such files are not distributed at 
present.

Good luck

Chris

On 09/01/2013 09:43, Ling Chan wrote:
> Good morning.
>
> I have a C++ program which makes calls to the OpenBabel library.
> Just wonder how can I compile it under Windows 7? I've already
> got OpenBabel-2.3.2 installed and have checked that the basic
> commands work. I am basically looking for something like the
> "How to compile against the Open Babel library" section at
> http://open-babel.readthedocs.org/en/latest/UseTheLibrary/CppExamples.html
> but one which refers to the Microsoft Visual C++ studio (MSVC)
> instead of to a unix-like environment.
>
> Actually I've managed to set up a project in MSVC. I think I've
> managed to add to the "include" path by:
>Right clicking on the project name in "Solution Explorer" and
>choose "References ..." to bring up the project's
>"Property Pages", then on the left window choose
>"Configuration Properties" >> "C/C++" >> "General", then
>edit the first entry which is "Additional Include Directories".
> However, I have not figured out how to refer to the dll (I suppose
> it is the openbabel-2.dll ?) on MSVC. How can I refer to the dll
> in MSVC?
>
> Many thanks for your help!
>
> Ling Chan
>
>
>
> --
> View this message in context: 
> http://forums.openbabel.org/How-to-Compile-on-Windows-against-the-OpenBabel-Library-tp4655865.html
> Sent from the General discussion mailing list archive at Nabble.com.
>
> --
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Fw: Re: substructure search problem

2013-01-08 Thread Chris Morley
It would be useful to show the molecules you expect to be matched and 
those which you expect not to be matched. But I suppose that you want to 
distinguish the molecules whose SMILES are c1c1N and c1c1N(C)C .

The SMARTS c1c1N matches both these molecules but c1c1[NH2] or 
c1c1N([H])[H] matches only the first, when used like

   obabel -:"c1c1N" -:"c1c1N(C)C" -osmi -s"c1c1N([H])[H]"

Conversion of any format to SMILES in OpenBabel will produce a string 
with 'explicit' hydrogen if the -xh option ('Output explicit hydrogens 
as such') is used.

   obabel -:C1=CC=CC=C1[NH2] -osmi -xh
   c1c1[NH2]
   1 molecule converted

You can see the Kekule form is also converted to the aromatic form that 
is needed when used as SMARTS.

Fastsearch works ok when an explicit H form of SMILES is used as a query 
SMARTS, because although its is converted to SMILES in the first 
fingerprint phase and loses its explicit H, the original SMARTS form is 
used in the second phase. This does not apply when the query is a 
molecule in a file, although I can see a small modification (not yet 
made) that would make it so.

So it looks as if all you need is an extra OpenBabel conversion step.

Thank you for raising this issue.

(Note that obabel rather than babel is preferred. Note also that 
OpenBabel is unclear about the exact meaning of 'explicit' with respect 
to hydrogen, but the above works ok for the non-religious.)

Chris

On 08/01/2013 06:21, shanghq...@hotmail.com wrote:
> Dear member,
> Could someone please give me some advices about this problem?
> Thanks.
> Shang
> *From:* shanghq...@hotmail.com 
> *Date:* 2013-01-05 09:45
> *To:* Craig James ; openbabel-discuss
> 
> *CC:* yuecaili 
> *Subject:* Re: [Open Babel] substructure search problem
> Hi All,
> Thanks for Craig's quick response.
> I want to build a compound registration system with openbabel and
> Chemdraw (used as molecule edtior) . The problem I encountered was that
> when I draw the following two molecules as substructure query, the
> system returned the same result.
> Although these two molecules are the same actually, I think their
> substructure search result should be different.
> I have tried the following three kinds of command lines:
> 1) babel chem.fs -Squery.mol result.smi
> 2) babel chem.fs -s'[H]N([H])C1=CC=CC=C1' result.smi
> 3) babel chem.fs -s'[H]N([H])c1c1' result.smi
> Command 1 could work but returned the same result.  I have examined this
> command and found that both molecule 1 and 2 are converted to the same
> aromatic form:Nc1c1. I think this is the reason of the same search
> result.
> Command 2 could not work  (The reason should be what you said in the
> last email)
> Command 3 could work and give the right result, but another problem is
> that Chemdraw can only generate the Kekule SMILES like
> "[H]N([H])C1=CC=CC=C1" . If I convert it to aromatic form, the form will
> be "Nc1c1", the "H" will be lost.
> It is strange that when I use molecule 3 as a query, openbabel can
> convert it to aromatic form: c1(c1)[NH]. and give the correct search
> result.
> So It is seems that something wrong happened in the process of
> convertion. I would like to know what the problem is and how I could
> convert the mol format or Kekule SMILES to aromatic form correctly.
> Thanks & Best regards,
> Shang
> 
> shanghq...@hotmail.com
> *From:* Craig James 
> *Date:* 2013-01-04 03:13
> *To:* shanghq...@hotmail.com ;
> OpenBabel-discuss 
> *Subject:* Re: [Open Babel] substructure search problem
>
>
> On Fri, Jan 4, 2013 at 4:25 AM, shanghq...@hotmail.com
>   > wrote:
>
> __
> Dear All,
> I am using Openbabel to search substructure in my database. I found
> that when I converted the following two Kekule SMILES
> (1,2) generated by Chemdraw to aromatic form with Openbabel, I got
> the same result:Nc1c1
> 1) NC1=CC=CC=C1
> 2) [H]N([H])C2=CC=CC=C2
> but I think their aromatic form should be Nc1c1 and
> [H]N([H])c1c1, only then the substructure search result is
> right. Could anyone tell me what the problem is? how can I solve
> this problem. Thanks,
>
>
> You haven't given enough details.  What does "search substructure in my
> database" mean?  Are you using a babel command, or some other commercial
> or open-source database?  If it's a babel command, what is the exact
> command you are using?
>
> I suspect the problem is that you're confusing SMARTS and SMILES.  As
> SMILES, the Kekule and aromatic forms are equivalent.  But as SMARTS
> (which is how substructure searches are interpret

Re: [Open Babel] Directory structure in install directory for OpenBabel

2012-12-17 Thread Chris Morley
On 17/12/2012 20:38, Geoffrey Hutchison wrote:
>
> On Dec 17, 2012, at 2:52 PM, Kirk Simmons  wrote:
>
>> Perhaps I am just confused, but I have recently downloaded and installed 
>> OpenBabel v2.3.2.  I noticed that unlike the OpenBabel 2.3.1 and earlier 
>> installs there are no directories "data", "doc" and "examples".
>
> What platform are you using? Windows?

On Windows the installer puts these directories somewhere like

C:\Users\Christopher\AppData\Roaming\OpenBabel-2.3.2

where they are more easily writeable. Under Program Files this needed 
administrator status.

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] duplicated molecules in an output file

2012-12-10 Thread Chris Morley
On 10/12/2012 21:50, Sarah Rodriguez wrote:
> Many thanks for the openbabel snapshot. I have now installed it.
> Regarding my original question of how I might output the duplicated
> molecules into a file, could you tell me what command i need to use or
> how to modify the --unique command in order to do this?

  obabel dataset1.xxx dataset2.yyy -O dupmols.zzz --unique ~

where xxx yyy zzz are extensions known to OB. There can be one or more 
dataset files.

In general, use something like
   obabel -L unique
to see a description of an op, format, fingerprint type, descriptor etc.

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-10 Thread Chris Morley
On 09/12/2012 21:03, David van der Spoel wrote:
> 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?

Maybe you want a smaller set of patterns, with more informative 
descriptions. You can easily do this by defining your own fingerprint 
type, as Noel mentioned previously, and it requires no recompilation. 
Look in data/plugindefines.txt where the MACCS fingerprint is defined in 
this way.

The function tokenize() in include/openbabel/tokenst.h will convert the 
output to a vector of strings.

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 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] cmake trouble -- building the code in SVN trunk

2012-12-08 Thread Chris Morley
Sarah

I have made an OpenBabel snapshot with a Windows installer, which may be 
an easier option for you. This includes the mod to --unique you want to 
use, but also uncommitted code - it is essentially what is on my machine 
at present. Download and run 
http://gaseq.co.uk/OB/2-4-0/OpenBabel2.4.70_Windows_Installer.exe. You 
do not need to uninstall a previous Openbabel version first.

There are some notes to be read if you want to uninstall the snapshot: 
http://gaseq.co.uk/OB/2-4-0/OBSnapshotNotes.txt

Chris

On 07/12/2012 20:37, Sarah Rodriguez wrote:
> Hello!
> In response to the reply I received below, I attempted to follow the
> instructions on http://openbabel.org/wiki/CMake. I am trying to do
> this on a windows machine.
> On 05/12/2012 00:10, Sarah Rodriguez wrote:
>> Hi,
>>
>> I asked the earlier question:
>>
>> On 11/11/2012 04:01, Sarah Rodriguez wrote:
>>   > Hello,
>>   > I am wondering if I have 2 large databases that I want to compare the
>>   > structures in, would I be able to do this in babel?
>>
>> Thanks for your reply. I was really helpful. As a followup, is there
>> anyway to put those duplicated (non-unique) structures into a separate
>> file?? Thanks!
>
> Not in v2.3.2. But prompted by your original question, I extended
> --unique to provide this capability, but did not committed it until now.
> But if you want to use it you will have to download and compile the code
> in SVN trunk yourself.
>
> 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] database

2012-12-05 Thread Chris Morley
On 05/12/2012 00:10, Sarah Rodriguez wrote:
> Hi,
>
> I asked the earlier question:
>
> On 11/11/2012 04:01, Sarah Rodriguez wrote:
>  > Hello,
>  > I am wondering if I have 2 large databases that I want to compare the
>  > structures in, would I be able to do this in babel?
>
> Thanks for your reply. I was really helpful. As a followup, is there
> anyway to put those duplicated (non-unique) structures into a separate
> file?? Thanks!

Not in v2.3.2. But prompted by your original question, I extended 
--unique to provide this capability, but did not committed it until now. 
But if you want to use it you will have to download and compile the code 
in SVN trunk yourself.

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] Smiles conversion problems with Ion and Zwitterion

2012-12-04 Thread Chris Morley
Your problem is the incorrect conversion of a cif file, but you haven't 
shown one yet. (Not that I know much about cif files, but others may.)
Conversions in OB go through an internal data structure, OBMol. It sound 
like the problem is in the cif to OBMol part, not in the OBMol to SMILES.

Chris

On 04/12/2012 15:34, Scott McKechnie wrote:
> Thanks Chris for the helpful comments. Sorry to keep on but I'm still
> left with the problem on going from cif to smiles where the original
> number of elements is not conserved. What I want is to be able to
> reliably represent the original cif molecule as a smiles string and from
> there recreate the molecule with gen3d. The problem at the moment is
> that the number of H atoms is changing. Any work around for this?
>
> On 4 December 2012 15:05, Chris Morley  <mailto:c.mor...@gaseq.co.uk>> wrote:
>
> Scott
>
> Your "correct smiles" is not right. The sum of the bond orders to the
> charged nitrogen should be 4, and is only 3 (it has no H attached). The
> correct SMILES is in my post below. Even with it, the round trip via
> xyz:
>
> obabel -:"C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1" -oxyz --gen3D
> | obabel -ixyz -osmi --append formula
> 1 molecule converted
> C(=O)(O)C[C@@H](C(=O)[O])N1CNC=C1   C7H8N2O4
> 1 molecule converted
>
> gives a di-radical rather than a zwitterion because xyz does not
> represent charges (or even bonds) and so OpenBabel didn't get any hints.
> xyz format is poor choice of format for general use. The round trip
> works ok with formats like mol or cml.
>
> Chris
>
> On 04/12/2012 10:51, Scott McKechnie wrote:
>  > Hi Chris,
>  >
>  > Thanks for your reply and apologies for the delayed response.
> Converting
>  > the cif to xyz and viewing the molecule shows the correct
> structure but
>  > converting the xyz file to smi and then generating coordinates and
>  > viewing shows the addition of a H atom.
>  >
>  > The correct smiles is: C(=O)(O)C[C@@H](C(=O)[O-])[N]1C=C[N+]=C1
>  > The other smiles is:C(=O)([C@@H](CC(=O)O)N1C=CNC1)O
>  >
>  > One strange feature is that there doesn't appear to be a double bond
>  > between the N atom in the ring and the C atom, leaving the C atom
> with
>  > only three bonds. The smiles conversion seems to want to add a H
> here to
>  > get the correct bonding.
>  >
>  > Similarly for an ion, using smiles conversion results in the
> addition of
>  > H's.
>  >
>  > I've attached the cif file.
>  >
>  > Many thanks,
>  >
>  > Scott
>  >
>  >
>  > On 30 November 2012 14:53, Chris Morley  <mailto:c.mor...@gaseq.co.uk>
>  > <mailto:c.mor...@gaseq.co.uk <mailto:c.mor...@gaseq.co.uk>>> wrote:
>  >
>  > On 30/11/2012 12:03, scott_m wrote:
>  >  > Dear all,
>  >  >
>  >  > The conversion of
> (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate
>  > from a
>  >  > .cif file to .smi and subsequent generation of coordinates
> from
>  > the .smi
>  >  > file results in the addition of an extra H to one of the
> ring C
>  > atoms. The
>  >  > original cif formula is C7H8N2O4 but this changes to C7H9N2O4,
>  > which is no
>  >  > longer a zwitterion.
>  >  >
>  >  > I also noticed that converting an ion to smi and then from
> smi to xyz
>  >  > resulted in the addition of hydrogen atoms. Can this be
> avoided?
>  >  >
>  >  > Is the smi conversion of ions and zwitterions known to cause
>  > problems?
>  >
>  > Getting added hydrogens right is a recurrent issue. However the
>  > conversion from SMILES to xyz (and other formats) seems ok.
> Your problem
>  > may be in the conversion of the cif file, but you will need
> to append it
>  > for somebody (probably not me) to debug.
>  >
>  >obabel -:"C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1
>  > (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate" -oxyz  --gen3D
>  > --title ""
>  >--append formula
>  > 21
>  > C7H8N2O4
>  > C  2.456020.705701.56344
>  > O  3.445

Re: [Open Babel] Smiles conversion problems with Ion and Zwitterion

2012-12-04 Thread Chris Morley
Scott

Your "correct smiles" is not right. The sum of the bond orders to the 
charged nitrogen should be 4, and is only 3 (it has no H attached). The 
correct SMILES is in my post below. Even with it, the round trip via xyz:

obabel -:"C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1" -oxyz --gen3D
| obabel -ixyz -osmi --append formula
1 molecule converted
C(=O)(O)C[C@@H](C(=O)[O])N1CNC=C1   C7H8N2O4
1 molecule converted

gives a di-radical rather than a zwitterion because xyz does not 
represent charges (or even bonds) and so OpenBabel didn't get any hints. 
xyz format is poor choice of format for general use. The round trip 
works ok with formats like mol or cml.

Chris

On 04/12/2012 10:51, Scott McKechnie wrote:
> Hi Chris,
>
> Thanks for your reply and apologies for the delayed response. Converting
> the cif to xyz and viewing the molecule shows the correct structure but
> converting the xyz file to smi and then generating coordinates and
> viewing shows the addition of a H atom.
>
> The correct smiles is: C(=O)(O)C[C@@H](C(=O)[O-])[N]1C=C[N+]=C1
> The other smiles is:C(=O)([C@@H](CC(=O)O)N1C=CNC1)O
>
> One strange feature is that there doesn't appear to be a double bond
> between the N atom in the ring and the C atom, leaving the C atom with
> only three bonds. The smiles conversion seems to want to add a H here to
> get the correct bonding.
>
> Similarly for an ion, using smiles conversion results in the addition of
> H's.
>
> I've attached the cif file.
>
> Many thanks,
>
> Scott
>
>
> On 30 November 2012 14:53, Chris Morley  <mailto:c.mor...@gaseq.co.uk>> wrote:
>
> On 30/11/2012 12:03, scott_m wrote:
>  > Dear all,
>  >
>  > The conversion of (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate
> from a
>  > .cif file to .smi and subsequent generation of coordinates from
> the .smi
>  > file results in the addition of an extra H to one of the ring C
> atoms. The
>  > original cif formula is C7H8N2O4 but this changes to C7H9N2O4,
> which is no
>  > longer a zwitterion.
>  >
>  > I also noticed that converting an ion to smi and then from smi to xyz
>  > resulted in the addition of hydrogen atoms. Can this be avoided?
>  >
>  > Is the smi conversion of ions and zwitterions known to cause
> problems?
>
> Getting added hydrogens right is a recurrent issue. However the
> conversion from SMILES to xyz (and other formats) seems ok. Your problem
> may be in the conversion of the cif file, but you will need to append it
> for somebody (probably not me) to debug.
>
>obabel -:"C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1
> (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate" -oxyz  --gen3D
> --title ""
>--append formula
> 21
> C7H8N2O4
> C  2.456020.705701.56344
> O  3.445920.485862.25208
> O  1.436561.466702.00415
> C  2.263560.114370.19030
> C  3.145460.74947   -0.88078
> H  2.848310.31396   -1.84634
> C  2.830382.27406   -0.99631
> O  1.670902.60592   -0.61087
> O  3.794412.97728   -1.40748
> N  4.601370.42805   -0.71225
> C  5.359000.947620.25841
> N  6.587890.461240.10334
> H  7.339920.616600.75954
> C  6.69161   -0.15933   -1.12882
> C  5.43119   -0.14873   -1.66026
> H  0.845361.765801.27272
> H  1.204390.19509   -0.08254
> H  2.46795   -0.957670.27113
> H  5.047741.616431.05753
> H  7.65241   -0.48371   -1.46628
> H  5.01646   -0.45579   -2.60586
> 1 molecule converted
>
> Chris
>
> 
> --
> Keep yourself connected to Go Parallel:
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> <mailto:OpenBabel-discuss@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>


--
LogMeIn Rescue: Anywhere, Any

Re: [Open Babel] Smiles conversion problems with Ion and Zwitterion

2012-11-30 Thread Chris Morley
On 30/11/2012 12:03, scott_m wrote:
> Dear all,
>
> The conversion of (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate from a
> .cif file to .smi and subsequent generation of coordinates from the .smi
> file results in the addition of an extra H to one of the ring C atoms. The
> original cif formula is C7H8N2O4 but this changes to C7H9N2O4, which is no
> longer a zwitterion.
>
> I also noticed that converting an ion to smi and then from smi to xyz
> resulted in the addition of hydrogen atoms. Can this be avoided?
>
> Is the smi conversion of ions and zwitterions known to cause problems?

Getting added hydrogens right is a recurrent issue. However the 
conversion from SMILES to xyz (and other formats) seems ok. Your problem 
may be in the conversion of the cif file, but you will need to append it 
for somebody (probably not me) to debug.

  obabel -:"C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 
(S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate" -oxyz  --gen3D --title ""
  --append formula
21
C7H8N2O4
C  2.456020.705701.56344
O  3.445920.485862.25208
O  1.436561.466702.00415
C  2.263560.114370.19030
C  3.145460.74947   -0.88078
H  2.848310.31396   -1.84634
C  2.830382.27406   -0.99631
O  1.670902.60592   -0.61087
O  3.794412.97728   -1.40748
N  4.601370.42805   -0.71225
C  5.359000.947620.25841
N  6.587890.461240.10334
H  7.339920.616600.75954
C  6.69161   -0.15933   -1.12882
C  5.43119   -0.14873   -1.66026
H  0.845361.765801.27272
H  1.204390.19509   -0.08254
H  2.46795   -0.957670.27113
H  5.047741.616431.05753
H  7.65241   -0.48371   -1.46628
H  5.01646   -0.45579   -2.60586
1 molecule converted

Chris

--
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Tidying up files

2012-11-26 Thread Chris Morley

Chris

My apologies also for the slow response.

OB will already read MDL files with abbreviations in the A (alias) line, 
like in the attached file. (But not in the S or R structures.) So


  obabel alias2.mol -O expanded2.mol -r

will expand the abbreviations and also remove all disconnected molecules 
apart from the largest. Is this close to what you wanted?


The data (SMILES) to do the expansions in in /data/superatoms.txt. Only 
univalent abbreviated groups are possible at the moment. There are 
currently about a hundred entries but the your list would expand this 
considerably. Is there anybody who would like to add the additional entries?


Chris

On 25/11/2012 09:57, Chris Swain wrote:

Hi,

Here is a list of abbreviations I have compiled over the years.

Ac, Ace, Acetate, Acetyl, Acyl
AcAc acetoacetyl
ACN = acetonitrile
Ad = 1-adamantyl
Alloc, AOC = allyoxycarbonyl
All, Allyl

Bam = benzamidomethyl
BDMS = biphenyldimethylsilyl
BOC, Boc, t-boc = t-butoxycarbonyl
BOM = benzyloxymethyl
Bn, Benzyl
Bz, Benzoyl
Bromo
Bu, Butyl
Bs = Brosylate

Carboxy
Cbz, Z = benzyloxycarbonyl
CE, Cne = cyanoethyl
Cp = cyclopentadienyl
cinnamyl

Chloro

Dan, dansyl
DEM = diethoxyethyl
DEIPS = diethylisopropylsilyl
Dip = 2,6-diisopropylphenyl
Dmb = 2,4-dimethoxybenzyl
DNP = 2,4-dinitrophenyl
DPA = diphenylacetyl
DPhAc = diphenylacetyl
DTBMS = di-t-butylmethylsilyl


Ethyl
EE = ethoxyethyl
EOM = ethoxymethyl

Formyl, formate
FMOC, Fmoc = 9-fluorenylmethoxycarbonyl

HBn = 2-hydroxybenzyl
heptyl
hexyl

Iodo
IPDMS = Isopropyldimethylsilyl

Me, Methyl
MEM = 2-methoxyethoxymethyl
Mes, Mesityl = 2,4,6-trimethylphenyl
MOM = methoxymethyl
Ms, mesyl = methanesulphonyl

NBOM = nitrobenzyloxymethyl
Ns = p-nitrophenylsulphonyl
Nitro


PAB = p-aminobenzyl
Pentyl
Ph, Phe, Phenyl
PMB = p-methoxybenzyl
PMP = p-methoxyphenyl
Pv, pivaloyl

Proparyl
Propyl
Py = Pyridyl

SEM = 2-(trimethylsilyl)ethoxymethyl

THP = Tetrahydropyranyl
THF = tetrahydrofuranyl
TMS = Trimethylsilyl
TBDMS, TBS = t-butyldimethlysilyl
TBDPS = t-butyldiphenylsilyl
TES = Triethylsilyl
TF, triflyl = trifluoromethylsulphonyl
TFA = trifluoroacetyl
TIBS = trisopropylsilyl
Tol, p-Tolyl
Tos, Tosyl = Toluenesuphonyl
Tr, trityl = triphenylmethyl
Troc = 2,2,2 -trichloroethoxycarbonyl

vinyl
Voc = vinyloxycarbonyl

nEt, Pr, But, pent, hex, hept, oct, non
nEthyl, Propyl, Butyl, pentyl, hexyl, heptyl, octyl, nonyl
n-Et, Pr, But, pent, hex, hept, oct, non
n-Ethyl, Propyl, Butyl, pentyl, hexyl, heptyl, heptyl, octyl, nonyl

cPr, But, pent, hex, hept, oct, non
cPropyl, Butyl, pentyl, hexyl, heptyl,  octyl, nonyl
c-Pr, But, pent, hex, hept, oct, non
c-Propyl, Butyl, pentyl, hexyl, heptyl,  octyl, nonyl

iPro, Propyl
i-Pro, Propyl
iso-Pro, Propyl
s-But, Butyl
sec-But, Butyl

tBut, Butyl
t-But, Butyl


o, m,p ortho, meta, para

Cheers,

Chris



On 24 Nov 2012, at 20:55, Geoff Hutchison  wrote:


I often end up editing files using a text editor because they contain features 
that are not compatible with other programs. In particular removing salts 
and/or solvents and expanding fragment labels e.g TMS, t-butyl etc.


Sorry Chris -- a pile of things stopped me from getting back to this. I think 
it's a good idea.

Want to draft a list of what you'd like "tidy'ed?"

-Geoff



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss




  ACD/Labs11261212372D

 14 13  0  0  0  0  0  0  0  0  8 V2000
   14.1653  -10.28750. C   0  0  0  0  0  0  0  0  0  0  0  0
   12.1463  -12.67510. C   0  0  0  0  0  0  0  0  0  0  0  0
   12.9955  -11.50530. N   0  3  0  0  0  0  0  0  0  0  0  0
7.8839   -8.04410. C   0  0  0  0  0  0  0  0  0  0  0  0
   10.6560  -13.21990. C   0  0  0  0  0  0  0  0  0  0  0  0
   11.8720   -9.15780. C   0  0  0  0  0  0  0  0  0  0  0  0
   11.8720  -10.48780. C   0  0  0  0  0  0  0  0  0  0  0  0
   10.7201   -8.49280. C   0  0  0  0  0  0  0  0  0  0  0  0
   10.7201  -11.15280. C   0  0  0  0  0  0  0  0  0  0  0  0
9.5683   -9.15780. C   0  0  0  0  0  0  0  0  0  0  0  0
9.5683  -10.48780. C   0  0  0  0  0  0  0  0  0  0  0  0
   13.7967   -8.15630. C   0  0  0  0  0  0  0  0  0  0  0  0
   14.1653  -12.41870. C   0  0  0  0  0  0  0  0  0  0  0  0
   16.6170  -11.55340. Cl  0  5  0  0  0  0  0  0  0  0  0  0
  7  6  1  0  0  0  0
  8  6  2  0  0  0  0
  9  7  2  0  0  0  0
 10  8  1  0  0  0  0
 11  9  1  0  0  0  0
 11 10  2  0  0  0  0
  6 12

Re: [Open Babel] dbase filtering, then substructure search (in that order)

2012-11-20 Thread Chris Morley
On 20/11/2012 08:03, Visvaldas K. wrote:
> Dear all,
>
> I am trying to look for certain molecules in the sdf/fs database
> containing certain fragments as substructure. The problem is my
> fragments can be small (I am running a script to do multiple searches),
> so I can get "too many candidates in the fingerprint search phase". The
> simple solution is to filter out the big molecules before doing
> substructure search, but openbabel does the substructure search first, i.e.
>
> obabel dbase.sdf -d --filter "atoms < 20" -O results.sdf -s trial.smi
> -al 9000 -ifs
>
> gives the identical "too many candidates" message. Of course, I can keep
> increasing "-al 9000" but that's a workaround and not the real solution.
>
It is possible to do filtering while making the .fs file, so only a 
subset of the molecules in the dataset are indexed.

   obabel dbase.sdf -O filtered.fs -d --filter "atoms<20"

This will help to reduce the number of hits in the fingerprint search.

> For some reason, piping
>
> obabel dbase.fs -d --filter "atoms < 20" -ocopy | obabel -ifs -O
> results.sdf -s trial.smi -al 9000
>
> stalls even at the first step --- it seems that one cannot filter "fs"
> database, but I am not sure if I am using the correct syntax.

The .fs file is a list of fingerprints and the position of the 
corresponding molecule in the datafile. So a fastsearch needs to be on a 
data file which has been indexed. This piping attempt does not work 
because the molecules you are hoping to search are in a stream not a 
file and they have not been indexed.

Incidentally, the FastsearchFormat in the development code now allows 
substructure searching with multiple molecules in the target file (your 
trial.smi), which may save some scripting.

Chris


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] comparing databases

2012-11-11 Thread Chris Morley
On 11/11/2012 04:01, Sarah Rodriguez wrote:
> Hello,
> I am wondering if I have 2 large databases that I want to compare the
> structures in, would I be able to do this in babel?

It depends what you mean by databases and compare.

OpenBabel can find duplicate molecules (i.e. with the same structure) in 
its input files, which can be of different formats.

See 
http://openbabel.org/docs/current/Command-line_tools/babel.html#remove-duplicate-molecules

So:
obabel dataset1.xxx dataset2.yyy -O uniquemols.zzz --unique

would report duplicate structures and put the non-duplicated ones in 
uniquemols.zzz (.xxx, .yyy and .zzz are any multi-molecule fileformats).

Or what other type of comparison do you need?

Chris

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] set bondlength

2012-10-28 Thread Chris Morley
On 28/10/2012 00:06, rik1654 wrote:
> Hi all
>
> I would like to have the svg image resized but the p option does not seem to
> be working. The output always has the same size
>
> example
>
> obabel -:"C1=CC=CC(=C1C(=O)[H])N([H])[H]" -xu -p 10 -O /tmp/out.svg
>
> or
>
> obabel -:"C1=CC=CC(=C1C(=O)[H])N([H])[H]" -xu -p10 -O /tmp/out.svg
>
> or
>
> obabel -:"C1=CC=CC(=C1C(=O)[H])N([H])[H]" -xu -P10 -O /tmp/out.svg
>
> what am I missing here?

An "x". Should be:

obabel -:"C1=CC=CC(=C1C(=O)[H])N([H])[H]" -xu -xp 10 -O /tmp/out.svg

All options for output formats have an x prefix. All options for input 
formats have an a prefix.

Chris


--
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] babel segvs on certain gaussian log files

2012-10-17 Thread Chris Morley
On 17/10/2012 14:46, David van der Spoel wrote:
> On 2012-10-17 15:15, David van der Spoel wrote:
>> Hi,
>>
>> I've done some G2 calculations on small molecules using Gaussian, and
>> each of these files contains 7 calculations. Babel crashes when trying
>> to read this:
>>
>> % curl http://folding.bmc.uu.se/222-trichloroethanol-g2.log >
>> 222-trichloroethanol-g2.log
>>
>> % babel -ig09 222-trichloroethanol-g2.log -osdf koko.sdf
>> Segmentation fault

> The problem is due to a call to strchr at line 326 of gaussformat.cpp
> the result of which is not checked but assumed to be correct.
>
> comment += strchr(buffer,'=')+2;

I have committed what I hope will be a more robust version to trunk. It 
is not thrown by the error messages at the beginning of the file and 
seems to extract (at least) a single value of the geometry, energy, and 
the rotational and vibrational constants.

Chris


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Y-help

2012-10-17 Thread Chris Morley
On 17/10/2012 02:32, 蓝鱼在嘴里 wrote:
> Hi,all,
> I know openbabel can generate four kinds of fingerprints,each has an
> original
> fragement library.If I just want to code a molecule's fingerprint use 0
> or 1 bit to
> represent a fragament exist in the molecule or not,how can I do this? Is
> there
> algorithms for this job?

To specify a particular fragment of a molecule you need to use SMARTS 
http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html . Edit the 
file patterns.txt, which is really just a list of SMARTS patterns, to 
define each bit in the fingerprint (you don't have to define all the 
bits). This will produce a customized FP3 fingerprint.

It is also possible to specify the number of occurrences of a chemical 
feature in a molecule. The data file format is a little more 
complicated, see MACCS.txt for an example.

Chris


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Data directory missing from Open Babel 2.3.1 Installation?

2012-09-03 Thread Chris Morley
On 03/09/2012 13:30, Noel O'Boyle wrote:
> H...not good. It sounds like OB 2.3.1 doesn't install on Win 7
> without admin priviledges. I need to check this somehow. If true, we'd
> better sort it out for 2.3.2.
> .
> In the meanwhile, you can workaround this. I will send you off-list
> the data directory for 2.3.1, which you can unzip anywhere you want.
> Then just set BABEL_DATADIR at the command-line before starting OB at
> the command-line. You could do this also in a batch file, or set the
> environment variable in the Windows settings somehow.
>
> - Noel
>
> On 30 August 2012 13:14, Richard Marchese Robinson
>  wrote:
>> Hi Noel
>>
>> Thanks for your e-mail.
>>
>> Unfortunately, not only was BABEL_DATADIR not created (I did check via
>> starting a fresh command prompt and typing echo "%BABEL_DATADIR%"), but it
>> appeared to be the case that the \data\ subdirectory containing mr.txt was
>> not physically created either. A search of my machine did not locate mr.txt
>> in any other location, either.
>>
>> If you cannot reproduce this, I would note that my build of Windows 7 is
>> non-standard. Does it sound plausible to you that this could cause this kind
>> of problem? I cannot supply further details about my build, however, as this
>> was set up by IT support at work. It is also the case that I need permission
>> before permenantly changing any environment variables or installing Python
>> modules - so I apologise for any delay in responding to any solutions you
>> might suggest.
>>
>> However, I believe that the problem is version specific: I have since been
>> able to successfully install Open Babel version 2.3.0 using
>> OpenBabel2.3.0a_Windows_Installer.exe. (I should note that this installer
>> did not automatically set BABEL_DATADIR either, but - as the \data\
>> subdirectory *was* created by *this* installer, it was possible to just set
>> this manually.)
>>
>> Many thanks in advance for any clarification you can provide.

2.3.0, 2.3.1 and 2.3.2 all use different locations for the /data folder.

In 2.3.0 it was subfolder of Program Files. This was usually fine under 
XP, but in Vista and later it required Administrator access.

In 2.3.1 it was put in Program Data. This was not the right place 
because it is intended (I think) for All-Users data, when a single user 
place was really required.

In 2.3.2 to achieve this, the data folder in under %APPDATA%. On my 
computer at C:\Users\Christopher\AppData\Roaming\OpenBabel-2.3.2\data

The Environment Variable BABEL_DATADIR which points to this folder has 
always been a User variable and it would be surprising (and difficult to 
work round) if your system did not allow the installer to set it.

At http://gaseq.co.uk/OB/2-3-2/OpenBabel2.3.2_Windows_Installer.exe 
there is a snapshot of an OB version from July, which uses the installer 
internals expected to be used for 2.3.2. It would be helpful if you were 
able to try it out on your restricted system and report whether it 
works. (Or indeed anybody on any system!)

Chris

>>
>> Best regards
>>
>> Richard
>>
>>
>> On Fri, Aug 24, 2012 at 2:11 PM, Noel O'Boyle  wrote:
>>>
>>> Hello Richard,
>>>
>>> Please note first of all that openbabel-scripting is officially dead.
>>> I'm sending this openbabel-discuss instead.
>>>
>>> You were looking at the docs for 2.3.0. See the current ones:
>>> http://openbabel.org/docs/current/UseTheLibrary/PythonInstall.html
>>>
>>> The new location of the DATA folder is listed.
>>>
>>> You say that BABEL_DATADIR was not created. Are you sure? Close the
>>> command-prompt window, and start a new one. Does echo
>>> "%BABEL_DATADIR%" still not work? If so, we need to sort it out.
>>>
>>> - Noel
>>>
>>> On 24 August 2012 14:00, Richard Marchese Robinson
>>>  wrote:
 Hi

 I was trying to install Open Babel version 2.3.1 on a machine running
 Windows 7.

 I ran OpenBabel2.3.1_Windows_Installer.exe and was informed the
 installation
 had finished successfully, allowing me to start the GUI.

 Since BABEL_DATADIR had not been created, I went to manually set this to
 the
 location of the directory containing mr.txt (based upon the instructions
 for
 testing the installation presented here:
 http://openbabel.org/docs/2.3.0/UseTheLibrary/PythonInstall.html).

 However, the \data\ subdirectory had not been created under C:\Program
 Files
 (x86)\OpenBabel 2.3.1\
 Indeed, I could not locate mr.txt anywhere.

 A quick Google search does not seem to suggest that this has been
 removed
 from version 2.3.1 so I assume there was a problem with running the
 installer.

 Any clarification / suggestions as to why this might have occured /
 possible
 ways to fix this would be greatly appreciated.

 Thanks in advance.

 Regards

 Richard Marchese Robinson
>>
>>
>>
>> --
>> 

Re: [Open Babel] FP2 reference and description for fingerprints

2012-08-29 Thread Chris Morley
On 28/08/2012 16:58, Jaehong Shin wrote:
> hello All,
>
> I am using openbael and have a quick question about the reference of
> fingerprint implemented in openbabel.
> I am just wondering if I can get the reference for the fingerprints FP2
> and FP3. Actually, I would like to have the description for each
> fingerprint e.g. atom type or path or fragment for SAR analysis.

There is OpenBabel documentation at http://openbabel.org/docs/2.3.1 
which might help.

FP4 uses the set of SMARTS in data/SMARTS_InteLigand.txt. Similarly FP3 
uses the SMARTS patterns in data/patterns.txt, but I would not recommend 
using it because it is too incomplete.

The structural feature producing each bit can be seen using fingerprint 
format (obtain the documentation by  obabel -L ftp ).
There is a blog post showing how to visualize the FP2 fragments at
http://baoilleach.blogspot.co.uk/2012/01/visualising-fragments-in-path-based.html.

Chris
>
> Thank you in advance
> --
> JaeHong Shin
>
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
>
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] OBConversion OUTOPTIONS characters

2012-08-09 Thread Chris Morley
On 08/08/2012 20:15, Rob Smith wrote:
> Is there a way (like obabel -L svg) to get the GENOPTIONS? I am
> struggling to get the -s " " section to transfer
> programmatically.

The -s option is not part of SVGFormat and works on the internal OBMol 
object, so you can also see the color when it is output to PNG or even 
CML format. It would have an option type OBConversion::GENOPTIONS. 
Obtaining its documentation is complicated by there also being a SMARTS 
descriptor called s, but
   obabel -L ops s
will work.

I'm not familiar with ruby syntax, but the following C++ code (without 
error checking) illustrates doing a conversion with options at two 
different levels.

The first is close to the command line method.

int main(int argc,char **argv)
{
   std::ofstream ofs("out.svg");
   std::stringstream ss("CCCO");
   OBConversion conv(&ss, &ofs);
   conv.SetInAndOutFormats("smi", "svg");
   conv.AddOption("s", OBConversion::GENOPTIONS, "CO purple");
   conv.Convert();
   return 0;
}

The second is at a lower level, and it is necessary to explicitly call 
DoTransformations() to apply the GENOPTIONS.

int main(int argc,char **argv)
{
   OBConversion conv(&std::cin, &std::cout);
   conv.SetInAndOutFormats("smi", "svg");
   conv.AddOption("s", OBConversion::GENOPTIONS, "CO purple");
   OBMol mol;
   conv.ReadString(&mol,"CCCO");
   mol.DoTransformations(conv.GetOptions(OBConversion::GENOPTIONS), &conv);
   std::cout << conv.WriteString(&mol) << std::endl;
   return 0;
}

I hope this helps.

Chris

>
> I've tried a lot of variants, the current one being:
>   self.obconv.add_option("s #{substructure}
> red",OpenBabel::OBConversion::INOPTIONS)
>
> The goal for this option is to color the substructure red.
>
> On Tue, Aug 7, 2012 at 8:12 PM, Geoff Hutchison
>  wrote:
>>> characters to complete the translation of the command line argument
>>> for what I am trying to do:
>>>
>>> obabel benzodiazepine.sdf.gz -O out.svg --filter "title=3016" -s
>>> "c1ccc2c(c1)C(=NCCN2)c3c3 red" -xu -d
>>
>> Keep in mind that if you're doing it programmatically, you don't use the 'x' 
>> part of the flag. So that '-xu' is just "u" for your OUTOPTIONS ruby script.
>>
>> Hope that helps,
>> -Geoff
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] OBConversion OUTOPTIONS characters

2012-08-08 Thread Chris Morley
On 07/08/2012 23:02, Rob Smith wrote:
> Does anyone know of a comprehensive list of the OBConversion
> OUTOPTIONS characters? I am trying to extend a ruby wrapper we are
> developing for openbabel, and I'm having trouble locating the correct
> characters to complete the translation of the command line argument
> for what I am trying to do:
>
> obabel benzodiazepine.sdf.gz -O out.svg --filter "title=3016" -s
> "c1ccc2c(c1)C(=NCCN2)c3c3 red" -xu -d
>
> to manipulating and outputting the molecule programmatically for lack
> of a list of the OUTOPTIONS characters.

The possible output options depend on the output format. For the svg 
format in your example they are described in the text from the command
   obabel -L svg
or returned from SVGFormat::Description(). (The GUI parses this text to 
make checkboxes, etc.) On the command line the single letter output 
options are precededed by -x, as in -xu in the example. There are also 
INOPTIONS(with a -a prefix) and GENOPTIONS(--filter, -s and -d above, no 
prefix) . They all can have parameters separated by spaces which can 
contain letters, digits and punctuation.

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] SDF tag

2012-08-02 Thread Chris Morley
On 02/08/2012 10:17, Altyr wrote:
> Hi all,
> I'm a beginner with openbabel and I want to know how to have tag in a SDF
> file.
> I read the doc but I have not found what I was looking for.
> Do I have to add it myself or there is a way to have them automatically
> (especially the unique ID)?

The file produced using the command line
   obabel -:"CO methanol" -O out.sdf --property MyID 1234
would add have a title "methanol" and a property MyID with a value 1234.

If you would like OpenBabel to provide the unique ID:
   obabel infile.xxx -O out.sdf --add inchi inchikey cansmi
would add properties containing InChI, InChIKey and canonical SMILES. 
(You would need only one.)

You could also do this from the GUI or from scripting or Pybel.

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] (no subject)

2012-07-15 Thread Chris Morley
On 14/07/2012 12:41, Geoffrey Hutchison wrote:
>
>> I think I'm using the latter and other hydrogens are added, but not the one 
>> I mentioned.  Using version 2.3.
>
> Ah. I just looked through the gen3d code to see why this is happening:
>
>>pmol->AddHydrogens(false, true); // Add some hydrogens before running MMFF
>
> So if you're using code, you want to run gen3d and *then* add hydrogens again 
> to re-protonate the OH with existing versions of libopenbabel. I'm not sure 
> if this is the appropriate default for gen3d, since it might violate the 
> principle of least surprise. (Certainly it surprised you.)
>
> Thoughts? Should the default gen3d use the pH model corrections for adding 
> hydrogens?

I also was surprised to see that the hydrogen added in gen3D was pH 
dependent. Not every body using gen3D works in solution. I think there 
should be no adjustment for pH, especially as the pH code may not be 
entirely reliable.

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] (no subject)

2012-07-13 Thread Chris Morley
On 11/07/2012 18:51, James Jack wrote:
>
> When I convert this to a 3D molfile with "add explicit H" checked in the
> OpenBabel GUI or I try the same in code the OH seems to become O- (O
> with a negative charge).
>
In the GUI you need to check "Add hydrogens (make explicit)" but have 
the editbox labelled "Add hydrogens appropriate for this pH" on the next 
line empty.

In code something like
  pMol->AddHydrogens(false, false);

But this may not be necessary.

If you use "Generate 3D coordinates" in the GUI or something like
  OBOp* pOp = OBOp::FindType("gen3D");
  if(pOp)
   pOp->Do(pMol);
in code, explicit hydrogens are added automatically.

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Weighted-rotor search

2012-07-13 Thread Chris Morley
On 13/07/2012 14:46, scott_m wrote:
> Thanks for the reply but that doesn't seem to be working for me (code below).
> If I just want to get a rough set of coordinates, what should I do? I see
> that gen3d (see link below) does a weighted rotor search as part of the
> process of making 3d coords but I wanted to just get the 3d coords and
> specify my own weighted rotor search conditions.

But you have to start with something. gen3D is quite quick. See my reply 
to James Jack on how it is used in C++. The python would be similar.

Chris
>
> mol = openbabel.OBMol()
> cv = openbabel.OBConversion()
> cv.SetInAndOutFormats('smi', outfile_type)
> cv.ReadString(mol, smiles_string)
> mol.AddHydrogens()
> ff = openbabel.OBForceField.FindForceField("MMFF94")
> ff.GetCoordinates(mol)
>
> gen3d source code:
> http://openbabel.svn.sf.net/viewvc/openbabel/openbabel/trunk/src/ops/gen3d.cpp?revision=4307&view=markup



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Structure is not tanimoto similar to itself

2012-07-12 Thread Chris Morley
On 09/07/2012 20:59, Jeff Janes wrote:
> If I make a file foo.smi with just this in it:
>
> [N-]=[N+]=c1c(=O)ccc2=c1c(=O)c1c1c2=O
>
> And then make and use an index file:
>
> ~/openbabel/bin/obabel foo.smi -ofs
> ~/openbabel/bin/obabel foo.fs  -ocan  -sfoo.smi -at5 -aa --title ""
>
> I find that the structure is only 0.7 similar to itself.

The problem is the [N-]=[N+]= structure, which could also be written 
[N]#[N]= . When indexing, dative bonds like these are converted into the 
second form. So when searching the target should also be in this form.

   obabel foo.smi -O foo1.smi -b
   1 molecule converted

   obabel foo.fs  -ocan  -sfoo1.smi -at5 -aa --title ""
   [N-]=[N+]=c1c(=O)ccc2=c1c(=O)c1c1c2=O   1
   1 molecule converted

It has proved difficult to find a suitable user interface for this that 
does not interfere with other features, especially as the charged form 
is the more common one. Originally the target molecule was also 
automatically converted; this may be a better way. In the meantime I 
will add a note to the documentation.

Chris



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] File format

2012-07-11 Thread Chris Morley
On 11/07/2012 22:33, andi wrote:
>> Nope, it's not already in OB. Sorry. Seems like it should be easy to code.
> Indeed it is. I'm not very familiar with OB protocols as to reading/writing
> molecules. Can you point out somewhere I can to look before I start coding
> things from scratch (Perhaps I can make use some of OB already build in
> functionality).

Or you could use src/formats/exampleformat.cpp, whichich is heavily 
commented code that could be the basis of your new format. The 
documentation on the main API is at 
http://openbabel.org/docs/2.3.1/UseTheLibrary/CppAPI.html

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] help

2012-07-07 Thread Chris Morley
On 06/07/2012 16:18, Craig James wrote:
>
>
> On Thu, Jul 5, 2012 at 3:06 AM, 蓝鱼在嘴里 <807409...@qq.com
> > wrote:
>
> Hello,
> I want to understand the fingerprint type of FP2 in Openbabel,where
> can I find the information?For example,"0616<670>",I know which
> fragment it represents,but for "0 6 5 6 5 6 1 6 <936>",I do not
> know.So where can I find the instruction.
> If there is someone know,please tell me.Thanks!
>
>
> The bits in a fingerprint don't represent anything specifically.
> Certain features in a molecule will cause a particular bit to be set
> (you can go from features to bits), but you can't go the reverse
> direction (bits to features).  Any particular bit can theoretically
> represent thousands of different features.

This hasn't stopped other people asking for more information on what the 
bits in FP2 mean. A blog post on what is available is at
http://baoilleach.blogspot.co.uk/2012/01/visualising-fragments-in-path-based.html

The <670> is the bit number and the remaining digits describe the 
fragment (possibly one of many) that maps to this bit number. The first 
digit is the bond order of the closure bond that makes a ring, and is 0 
for linear fragments. The remaining digits indicate the atomic number
and bond order alternatively for the atoms that make up the rest of the 
fragment. A bond order of 5 is used for aromatic bonds. <936> above 
would be a linear fragment with a SMILES representation of [c][c][c][C] 
(Hydrogen is ignored.)

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] computation of L5 not working via command line

2012-06-06 Thread Chris Morley
On 06/06/2012 13:39, Martin Guetlein wrote:
> Hi All,
>
> this is how I use openbabel to compute descriptors, L5 is not working,
> though (openbabel version is 2.3.1).
>
> $obabel -:CCC -otxt --append MW -osmi
> CCC 44.0956
> 1 molecule converted
> $obabel -:CCC -otxt --append L5 -osmi
> CCC nan
> 1 molecule converted

The descriptor L5 returns a boolean
  HBD<5 && HBA1<10 && MW<500 && logP<5

and so should be used like:

obabel 40mols.smi -osmi --filter L5
Nc1nc2[nH]nnc2c(=O)[nH]11
...
Nc1ccc(cc1)S(=O)(=O)c1ccc(N)cc1 38
CCc1nc(N)nc(N)c1c1ccc(Cl)cc140
34 molecules converted

I'll add a usage note to the description of L5. But using it in the way 
you are attempting is clearly a good idea. I'll look into it. Thanks.

Chris

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Atom charge lost in 2.3.x SDF-to-SMILES conversion

2012-05-17 Thread Chris Morley
Craig's failing example works fine for me under Windows with both 2.3.1 
and the development code. As he suggested, this inconsistency suggests 
that there is something not being initialized properly. The logic around 
the flag OB_TCHARGE_MOL is a bit tricky and so is a candidate, but I 
cannot see anything wrong. Paolo's patch is in the same area in the 
OBMol assignment operator (which is used in SMILES output) but as far as 
I can see it just duplicates the copying of atom formal charges which is 
already done in the OBAtom::Duplicate(). I think it would be better to 
identify the fault before applying the patch. But it is tricky finding a 
bug if you cannot reproduce it. Can anyone help?

Chris

On 17/05/2012 16:28, Craig James wrote:
> Hi Paolo,
>
> Thanks very much for the patch.  Unfortunately, the OBForceField
> functions that you patched are never called at all during the
> SDF-to-SMILES conversion process, so the patch doesn't resolve my
> issue.  OBForceField only seems to be called if I use the --gen3D option.
>
> Best regards,
> Craig
>
> On Thu, May 17, 2012 at 3:03 AM, Paolo Tosco  > wrote:
>
> Dear Craig,
>
> I have faced the identical problem with MMFF94, and I have
> previously submitted a similar patch which has already been applied
> to SVN OpenBabel. However, now I realize that my fix had only solved
> my own problem, but not a more general problem connected with formal
> charges.
> So I have attached a much better patch, which reverts my previous
> one, and instead applies it on the OBMol copy constructor, so that
> it becomes of general use.
>
> To make a long story short, if you patch the current OpenBabel SVN
> version with the attached patch your issue will be solved.
>
>  From the OpenBabel root folder:
>
> patch -p0 < patch_17-05-2012.patch
>
> Dear Geoff, would you please apply it also to the SVN trunk so that
> also other OpenBabel users may benefit from that? It also includes a
> small patch on "A T O M   T Y P E S" logging that I had left behind
> previously.
>
> Best regards,
> Paolo
>
>
> On 05/17/2012 01:44 AM, Craig James wrote:
>> Here's another problem in 2.3.x that's not in 2.2.x.  I realize
>> these are bogus molecules, but it illustrates a serious problem.
>>
>>   $ echo "[Fe+2][Fe-2].[Fe+2].[Fe-2]" | babel -i smi -o can
>>   [Fe-2][Fe+2].[Fe-2].[Fe+2]
>>
>> Everything looks good -- charges are maintained.  Now  go through
>> the SDF format:
>>
>>   $ echo "[Fe+2][Fe-2].[Fe+2].[Fe-2]" | babel -i smi -o sdf |
>> babel -i sdf -o can
>>   [Fe+2][Fe].[Fe].[Fe]
>>
>> Not so good -- charges are dropped. Where is the problem?  It
>> turns out the SDF is correct:
>>
>>  $ echo "[Fe+2][Fe-2].[Fe+2].[Fe-2]" | babel -i smi -o sdf
>>
>>  OpenBabel05161216052D
>>
>>   4  1  0  0  0  0  0  0  0  0999 V2000
>> 0.0.0. Fe  0  2  0  0  0  0  0  0  0  0  0  0
>> 0.0.0. Fe  0  6  0  0  0  0  0  0  0  0  0  0
>> 0.0.0. Fe  0  2  0  0  0 15  0  0  0  0  0  0
>> 0.0.0. Fe  0  6  0  0  0 15  0  0  0  0  0  0
>>   1  2  1  0  0  0  0
>> M  CHG  4   1   2   2  -2   3   2   4  -2
>> M  END
>> 
>>
>> The charges are all properly marked in the atom block and in the M
>> CHG line.  And the "15" in atoms 3 and 4 means "zero valence"
>> which is right.  Yet the SMILES is wrong.
>>
>> It turns out this same thing happens if you use
>> atom->SetFormalCharge().  It sometimes works and sometimes doesn't.
>>
>> Note that it works correctly in OpenBabel 2.2.x:
>>
>>   $ echo "[Fe+2][Fe-2].[Fe+2].[Fe-2]" | babel -i smi -o sdf |
>> babel -i sdf -o can
>>   [Fe-2].[Fe-2][Fe+2].[Fe+2]
>>
>> Anyone have any idea what changed, either in the OpenBabel
>> internals or the SMILES generator, that would affect the way
>> charges are interpreted?
>>
>> Craig

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] obabel crash while removing salt (removing counter-ions)

2012-04-16 Thread Chris Morley
The example files did not make it through to the mailing list. With 
SMILES it is probably safe to just copy them in to the text. (Don't do 
this for SDF files!)

The -e  option enables obabel to continue with the next molecule after 
an error, so if the crash is not too severe you may be able to get some 
useful results even with this bug.

Chris

On 16/04/2012 11:12, green69 wrote:
> Hi all,
>
> I'm using Open Babel 2.3.1 running on a GNU/Linux OS.
>
> I used to work with molecules DB in SMILES format. Normally with obabel you
> can remove counter-ions (with the flag '-r', which remove all but the
> largest contiguous fragment) with the following command:
>
> /obabel -ismi file.smi -r -osmi -O file_out.smi/
>
> Unfortunately I found that obabel crashes when try to remove counter-ions
> from certain molecules. I attached 2 files each containing 2 molecules
> /smilesPROBLEM.smi/&  /smilesOK.smi/. The first molecule of
> /smilesPROBLEM.smi/ is that which cause the problem.
>
> I don't know why that molecule is problematic to obabel, while the first
> molecule of  /smilesOK.smi/ (which is similar), is not problematic. Anyway
> here *the real problem is that the program crashes* on that molecule. This
> means that a part from the problematic molecule itself, *in the output file
> you will miss all those compounds which follow a certain problematic
> molecule.* So if you're processing a DB of 1,000 molecules of which the
> third is problematic, you will obtain just 2 molecules, missing the rest
> 997!
>
> Please, does anybody know a way to circumvent this problem without write an
> ad-hoc external script? Bypassing the problematic molecules and making
> obabel converting the rest of compounds, will be fine.

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Discuss about Fingerprints and Results

2012-04-13 Thread Chris Morley
On 13/04/2012 13:02, Jochen Schreiber wrote:
> Hello everybody,
>
> i have a dataset where i know (form a clustering) which compounds are in 
> which cluster.
>
> For example Cluster 55: With 16 Compounds.
>
> Now i want to start a similarity search on each compound in this cluster with 
> babel. I will do this with tanimoto 0.7, 0.8 and 0.85 to look for which 
> tanimoto i get the best results.
>
> The best result would be that i find with one compound all other 15 compound 
> from this cluster.
>
> After i have done this i see that my results are very bad.

The command

   obabel Cluster55.sdf -oftp

will show the Tanimotos from the first molecule in Cluster55.sdf to all 
the others using FP2 fingerprints

So i want to change the fingerprint. In my first round i use the 
standard FP2 fingerprint.
>
> The results for FP3, FP4 oder MACCS are the same. Why is this so? Need i to 
> specify something in the txt-files?
>
> My cooperation partner in this projekt uses pipeline pilot with ECFP4. Is 
> there a way to use this fingerprint with babel?

OpenBabel does not support this fingerprint.

A paper which compares the effectiveness of 37 different descriptors in 
molecular similarity is Bender et al J. Chem. Inf. Model., 2009, 49 (1), 
pp 108–119 DOI: 10.1021/ci800249s. But since it is published by ACS I am 
not able to read the full text.

Chris

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Smirks and tautomers (mesomers)

2012-03-29 Thread Chris Morley
On 27/03/2012 00:53, Samuele Sommariva wrote:

The OpenBabel class OBChemTsfm that does the work here is rather old and 
is known to have bugs, as you have found. Wrapping it as an op was 
intended to make it easier to debug, but unfortunately this didn't 
happen and OBChemTsfm is still not very useful. Openbabel could really 
do with a facility like this, so anybody interested in sorting out this 
code would be doing the community a service.

Incidentally, it's good for people to be reminded that Openbabel finds a 
use outside pharma (or would do without the bugs).

Chris

> I work with high temperature kinetic scheme, hence I have radicals going
> around.
> I am using one of the latest developer version (updated at the beginning
> of the month) on win7 home 64 bit.
>
> I need to assign a unique name to resonant radicals. In this example a
> primary radical with a carbonyl group in alpha position should be
> transformed into a vinoxy radical
>
>
>  From what I have understood I can force the transformation of a
> tautomer into another following these steps:
> 1 – Update the plugindefines.txt
>
> #Add to plugindefines.txt
> OpTransform
>
> mesomers # ID. Commandline option
>
> SmmMesomers.txt # DataFile
>
> First blush: trying to replace resonant radicals
>
> 2 – Define the SMIRK reaction(s) in SmmMesomers.txt
> #radical alpha-carbonyl >> vinoxy
>
> TRANSFORM [CH2X3:1]-[C:2]=[OH0:3] >> [CH2X3:1]=[C:2]-[OH0:3]
>
> 3 – test with obabel -:myFile.txt -ismi -ocan --mesomers
>
> myFile.txt contains
>
> [CH2]C=O
>
> [CH2]C(=O)C
>
> CCC=O
>
> The results I expected are the same as the one founded on
> http://www.daylight.com/daycgi_tutorials/react.cgi
>
> [CH2]C=O [O]C=C
>
> [CH2]C(=O)C CC(=C)[O]
>
> CCC=O (doesn’t match)
>
> The results I obtained are NO transformation at all. What am I missing???
> Thank you for your help.


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Trouble converting .sdf files downloaded from PDB website

2012-03-15 Thread Chris Morley
On 15/03/2012 00:01, Tony Cook wrote:

> The Alias feature is for display. That is if you draw the structure from the 
> information in the SDF file (or any of the MDL formats)
>you are supposed to use the alias name instead of the atomic symbol in the 
> drawing only. However for all other purposes you should use the real atomic 
> number/symbol
>
> For example this feature allows you to annotate the structure drawing with 
> labelled atoms "C1", "C2", "C3" etc
>
> Open Babel would do better to ignore the A records and just keep mum! unless 
> the intent is to convert to a graphical format (PNG etc), then the default 
> should be to use the Alias symbol unless explicity told not to
>
> This is all old hat standard stuff with MDL molecule/reaction formats. Sounds 
> like from the comments that this knowledge has been lost/confused in the 
> mists of time!

The specification document "CTFile Formats" gives no guidance on the use 
of the alias feature. It may have been intended only for display, but 
does seem to be used sometimes to convey essential chemical information, 
for instance in the sample sdf files provided with the InChI software 
(up to v1.03) by NIST.

OpenBabel currently tries to interpret the alias information, so that 
the internal representation is a proper molecule (not a drawing), while 
retaining the alias information to be used (optionally) when output for 
SVG and PNG display, etc.

There are differing views on whether OpenBabel should completely reject 
files with misused or malformed features. I prefer to be helpful if 
possible, but mistakes when interpreting other peoples mistakes are 
inevitable.

Chris

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Trouble converting .sdf files downloaded from PDB website

2012-03-13 Thread Chris Morley
On 12/03/2012 23:18, baratron wrote:
> Hi all,
>
> I'm trying to find the quickest way to get ligands from the PDB website into
> .mol2 format for use in another program.
>
  If I run the OpenBabel program from command line, I get lots of
> warning messages:
> ==
> *** Open Babel Warning  in Expand
>Alias CL1 was not chemically interpreted
>

> And then the output .mol2 file is missing all of the information about
> chemical elements. They are all replaced with dummy atoms:
>1 XX  6.3250   11.0900   22.6650 Du  1  LIG10.
>2 XX  4.6490   11.0350   23.3060 Du  1  LIG10.
>3 XX  4.02009.8040   23.4780 Du  1  LIG10.
> etc.
>
> I searched on Google and the Nabble site&  couldn't find anyone else having
> problems converting from .sdf to .mol2. I'm assuming there's something
> "special" or "different" about the ligand .sdf files from the PDB website,
> but I don't know what that is.

The entries in the SDF file like

A   14
C5'

are being interpreted as an alternative representation (alias) rather 
than additional information (atom types?), which OpenBabel does not 
understand. It sets the original atom to 0 atomic number, which is 
perhaps unnecessary. The is now altered in the development code, so that 
the basic structure is converted properly, although the warnings are 
still there. Is there a need for an option to capture the additional 
information?

Chris

--
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-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Chembl fs file

2012-03-07 Thread Chris Morley
a) The parameter of the -s option has to be a SMILES string (or a 
filename) The ${...} syntax is not recognised.

b) It is better to use obabel rather than babel because it is safer and 
more versatile. The syntax difference is very small ( -O before output 
filename).

So this works for me:

obabel chembl_02.sdf -ofs
obabel chembl_02.fs -O result.sdf -s"c1(C#N)c1C#N" -at0.85

Instead of the SMILES you may prefer to have the pattern molecule in a 
file (with any format).

Chris

On 07/03/2012 09:31, Jochen Schreiber wrote:
> Hi,
>
> and this is not what i want.
> I must do an evaluation. This is my task. And i need to use open babel and 
> other tools for the similarity search.
>
> So now the question again:
> How could i perform the similarity search with babel on chembl?
>
> babel /bioinf/MuDiSAR/db/chembl/chembl_13.sdf search/babelchemblresult.sdf 
> -s"${smi}" -at0.85
>
> This command works (especially very fast) but the result does not contain any 
> entries.
>
> Is it because the chembl_13.sdf contains no SMILES strings?
>
> Or is there a other way to search with babel in chembl (convert the sdf to an 
> specific format)?
>
> Jochen
>
> Am 07.03.2012 um 10:09 schrieb Björn Grüning:
>
>> Hi,
>>
>> you can't. FPS is a new format from the chemfp project. You have to use
>> chemfp. There is a nice script called simsearch, that assist you with
>> the searching.
>>
>> Kind regards,
>> Bjoern
>>
>>> Hello,
>>>
>>> ok i think this works:
>>>
>>> ob2fps /bioinf/MuDiSAR/db/chembl/chembl_13.sdf -o chembl_13.fps
>>> ==
>>> *** Open Babel Warning  in Expand
>>>   Alias -N was not chemically interpreted
>>>
>>> ==
>>> *** Open Babel Warning  in Expand
>>>   Alias -N was not chemically interpreted
>>>
>>>
>>> cat chembl_13.fps
>>> #FPS1
>>> #num_bits=1021
>>> #software=OpenBabel/2.3.1
>>> #type=OpenBabel-FP2/1
>>> #source=/bioinf/MuDiSAR/db/chembl/chembl_13.sdf
>>> #date=2012-03-07T07:24:20
>>> 0026004008a00b000600100c0010004000800108180050838303300e25380001010208208002001008001c00188001201a90001600b003403008c2080800800a2c2000201000800e01040001107200010100
>>>  Record1
>>> 200600c2043806c04b04860a0e42430e515004906808812320c0022404001c0470830950883b588f2438280fd0c10102605000a0690604f28896710206100c210d0ae8101aa000a2610022c9009d00d885400490300df08808708009509e08101820004840c8ba5c0400100605d40a43100101ba80410a64
>>>  Record2
>>>
>>> But i have one question: How can i start the sim search with babel. In my 
>>> case i do:
>>>
>>> babel /bioinf/MuDiSAR/db/chembl/chembl_13.sdf search/babelchemblresult.sdf 
>>> -s"${smi}" -at0.85
>>>
>>> where smi is the smiles string / query
>>>
>>> with best
>>>
>>> jochen schreiber
>>> --
>>> 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-discuss mailing list
>>> OpenBabel-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>> --
>> Björn Grüning
>> Albert-Ludwigs-Universität Freiburg
>> Institute of Pharmaceutical Sciences
>> Pharmaceutical Bioinformatics
>> Hermann-Herder-Strasse 9
>> D-79104 Freiburg i. Br.
>>
>> Tel.:  +49 761 203-4872
>> Fax.:  +49 761 203-97769
>> E-Mail: bjoern.gruen...@pharmazie.uni-freiburg.de
>> Web: http://www.pharmaceutical-bioinformatics.org/
>>
>
>
> --
> 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-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
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-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Generating fs from sdf

2012-03-02 Thread Chris Morley
On 02/03/2012 17:47, Björn Grüning wrote:
> Hi Jochen,
>
> maybe you can explain what you want to do with it. We are running such
> Setup in our lab using postgresql and pgchem and it works very well.
>
> The fs file from openbabel is smaller than the sdf file and as far as i
> know the fs file should be smaller than 2GB.

The datafile must also be less than 2GB (or maybe 4GB) because currently 
the fs file contains a 32bit offset to each molecule in the datafile. 
Splitting the fs file is a cumbersome way of getting round this and 
would require external scripting to combine the results. If the data set 
were converted to SMILES it would be much smaller, which would mitigate 
the problem. But I agree that using a database for similarity searches 
with very large datasets would be better.

Chris
>
> Cioa,
> Bjoern
>
>> Must it be smaller then 2 GB?
>>
>> If i do a concat on all i gain a file which is about 187 GB.
>>
>> Any idea?



--
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-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Generating fs from sdf

2012-03-02 Thread Chris Morley
On 02/03/2012 15:23, Jochen Schreiber wrote:
> Hello everybody,
>
> i have the completed pubchem compound sdf file on my file system an want to 
> to a smiliarity search on them.
>
> Can i execute babel with more then one input fs file or how is the way to do 
> the search?

Put all the molecules in one file. sdf files can just be concatenated. 
Alternatively, (much slower):

   obabel *.sdf -O allmols.sdf

This file must be smaller than 2 GBytes.

Make a fs index (allmols.fs) to this file:

   obabel allmols.sdf -ofs

Do a similarity search, for instance finding the 10 molecules most 
similar to 1,2,3-tricyanobenzene:

   obabel allmols.fs -O result.sdf -s "c1ccc(C#N)c(C#N)c1C#N" -at10

Chris


--
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-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] SDF first line content

2012-02-13 Thread Chris Morley
On 13/02/2012 15:22, Nina Jeliazkova wrote:
> I've received recently several SDF files, containing various identifiers
> and calculated descriptors in the first line of SDF records, as in the
> example below.
> Is it something OpenBabel generates (I would normally expect these values
> as SDF tags) ?

Although Openbabel does not generate many descriptors, those it does can 
be added to the molecules title with --append, or added as a property 
with --add. There also a few other commands that add to the title, like 
Tanimoto coefficients in fastsearching and descriptors in --largest and 
--sort. Data cannot be extracted from the title. Your text can be added 
to the title with --addtotitle and --title and as a property with 
--property.

Chris

> ID 2 CAS 00051-28-5 NAME 2,4-Dinitrophenol WA 3.077 Mv 0.66 H-046 0 nCb- 3
> MAXDP 3.22 nN 2 Log1/LC50 Exp 4.228 Y-Pred. 3.73 Hat 0.031
>   OpenBabel11300911503D
>
>   17 17  0  0  0  0  0  0  0  0999 V2000
>  1.0036   -0.07710.0767 N   0  0  0  0  0
>  0.4459   -1.18310.0842 O   0  0  0  0  0
>  0.41921.01000.1683 O   0  0  0  0  0
>  2.4674   -0.0559   -0.0477 C   0  0  0  0  0
>  3.14721.1740   -0.0397 C   0  0  0  0  0
>  4.54221.2049   -0.1607 C   0  0  0  0  0
>  5.25560.0127   -0.2851 C   0  0  0  0  0
>  6.60980.0437   -0.4331 O   0  0  0  0  0
>  4.5644   -1.2017   -0.2820 C   0  0  0  0  0
>  5.2892   -2.4504   -0.3952 N   0  0  0  0  0
>  5.0450   -3.1457   -1.3907 O   0  0  0  0  0
>  6.0320   -2.76360.5443 O   0  0  0  0  0
>  3.1704   -1.2589   -0.1706 C   0  0  0  0  0
>  2.60552.11470.0555 H   0  0  0  0  0
>  5.04952.1668   -0.1621 H   0  0  0  0  0
>  6.94040.9553   -0.3539 H   0  0  0  0  0
>  2.6586   -2.2196   -0.1789 H   0  0  0  0  0
>1  4  1  0  0  0
>1  3  2  0  0  0
>1  2  2  0  0  0
>4  5  2  0  0  0
>4 13  1  0  0  0
>5  6  1  0  0  0
>5 14  1  0  0  0
>6  7  2  0  0  0
>6 15  1  0  0  0
>7  9  1  0  0  0
>7  8  1  0  0  0
>8 16  1  0  0  0
>9 13  2  0  0  0
>9 10  1  0  0  0
>   10 12  2  0  0  0
>   10 11  2  0  0  0
>   13 17  1  0  0  0
> M  END
> 
>
> Best regards,
> Nina


--
Try before you buy = See our experts in action!
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-dev2
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] MOL to PNG?

2012-02-06 Thread Chris Morley
On 03/02/2012 16:56, KC soh wrote:

> I read that openbabel can read png to mol but would it be possible to then
> export the mol as png/svg/jpg formats? Is there somewhere i can find out
> how to do it with the C++ implementation?

Could you clarify what you are looking for?

OpenBabel can read (and write) molecule files, like MDL mol, that are 
*embedded* in PNG files. Once the molecule has been read, OpenBabel 
display it as SVG, PNG and in many chemical formats.

To deduce a chemical structure from the *image*, another program, like 
OSRA http://cactus.nci.nih.gov/osra/, is required.



--
Try before you buy = See our experts in action!
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-dev2
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Substructure search with .fs generated with FP3, FP4 and MACCS fingerprints

2012-02-02 Thread Chris Morley
On 02/02/2012 19:15, David García Aristegui wrote:
> Here are examples with .fs generated with the default fingerprint, FP2
> http://openbabel.org/docs/dev/Fingerprints/fingerprints.html
>
> Is  different the way to do a substructure search in a .fs generated with
> FP3, FP4 or MACCS fingerprints? could you tell me if are examples
> available?

You can use any OpenBabel fingerprint when making a .fs index, e.g.

   obabel datafile.sdf -ofs -xf FP4

The use of the index is the same whatever has been used to make the index.

But the default FP2 is the one that is most suitable for substructure 
searching. The others are structure keys and will record the structure 
in a coarser way. FP3 is also too incomplete to be much use at all.

Chris

--
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-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] .sdf and .fs files (substructure search)

2012-02-01 Thread Chris Morley
In making the .fs index you meant to write

   obabel 1.7_24.sdf -ofs

In using it to look for three connected aliphatic carbons you can use

   obabel 1.7_24.fs -sCCC -Oresults.smi
or
   obabel 1.7_24.sdf -ifs -sCCC -Oresults.smi

and it is necessary for the data .sdf and the index files to be in the 
same directory (I think). The .fs file contains, for every molecule that 
is indexed, only a fingerprint and the byte position of the 
corresponding molecule in the data file. So both are needed to do a 
substructure search, although you need to specify only one. The fs file 
can have a different name and can be made smaller by not indexing every 
molecule, e.g. by adding -f, -l, -s, -v, or --filter options to the 
first command above.

Chris

On 01/02/2012 15:45, Noel O'Boyle wrote:
> The .fs file is just an index - it doesn't contain any chemical
> structure. So you need the sdf file.
>
> Can they be in different directories? I don't know...Chris?
>
> - Noe
>
> On 1 February 2012 15:40, David García Aristegui  wrote:
>> Hello, i'm testing the substructure search with .fs files...
>>
>> obabel 1.7_24.fs -ofs
>>
>> i move the .fs file to a new directory, and i execute:
>>
>> obabel 1.7_24.fs -ifs -sCCC -Oresults.smi
>> ==
>> *** Open Babel Error  in ReadChemObject
>>   Difficulty opening 1.7_24.sdf
>>
>> 0 molecules converted
>>
>> "The datafile plus the -ifs  option can be used instead of the index file"
>> http://openbabel.org/docs/dev/FileFormats/Fastsearch_format.html
>>
>> Is mandatory to have the .sdf and the .fs files in the same directory? is
>> not possible to do the search only with the .fs files?
>>
>> Best regards.
>>
>>
>> --
>> 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-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
> --
> 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-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
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-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Substructure searching (large datasets) .sdf format doubt

2012-01-11 Thread Chris Morley
On 11/01/2012 14:23, David García Aristegui wrote:
> "First of all, you need to create a fastsearch index (see above). The
> index is created with the following command:
>
> babel mymols.sdf -ofs"
>
> http://openbabel.org/docs/dev/Fingerprints/fingerprints.html
>
> Could you please tell me the differences between the use of a 2D or a 3D
> sdf file regarding the .fs generation?

The 2D or 3D coordinates will affect only the stereochemistry but should 
give the same result, if they have been constructed correctly. A 0D sdf 
file might not have any stereochemical information.

Fastsearching has two phases. The first uses fingerprints (which are in 
the .fs file made by the command above). The default FP2 fingerprint is 
not sensitive to the stereochemistry, and so neither are .fs files. The 
results from the first phase are further filtered by SMARTS, which is 
sensitive to the stereochemistry.

Chris




--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] one input file - multiple output files

2012-01-05 Thread Chris Morley
On 03/01/2012 16:29, Cyberbroker1 wrote:
>
> the -m option works good, but is there anypossibility to make the filename
> the molecule name?

There have been several requests for this, so I have added this 
capability. It is currently only in the development code, and is 
described a little more on the Openbabel-Devel mailing list.

Chris


--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Problem with PUBCHEM properties

2011-12-20 Thread Chris Morley
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)3)ccc1  5050001
O=C1N(CC(C)C)c2c(/C/1=N/c1cccnc1)2  5050002
O=C1C(=Cc2c(OC)c(OC)c(OC)cc2)CCc2c125050003
FC(F)(COCc1oc(cc1)C(=O)[O-])C(F)F   5050004
O1CCN(CC1)c1ccc(C=C2CCc3c(C2=O)3)cc15050005
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)3)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)3)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)...
 >  
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

 >  
EXTERNAL

 >  
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


Re: [Open Babel] Need complementary information on FP2

2011-12-16 Thread Chris Morley
On 16/12/2011 11:01, Marianne wrote:
> Dear all,
>
> In order to have fingerprint of reactions, is it possible to make
> fingerprint (FP2) difference between 2 (or more) compounds, ? (as daylight
> finger print do in section 6.2.2 here
> http://www.daylight.com/dayhtml/doc/theory/theory.finger.html )
>
> More specifically, I can not find if in the description of FP2, same kind of
> fragment, even finding a number of time in a molecule, is store 1 time or
> each time meet as I suppose?

FP2 is designed for molecules only, not for reactions. It records, as a 
set bit, whether a linear fragment (up to seven atoms long) is present, 
however many times it occurs.

It is possible to define a structural key type fingerprint to include a 
count for each structural feature - the MACCS fingerprint uses this. 
There are some comments in the code 
http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/src/fingerprints/finger3.cpp?revision=4398&view=markup
 
but no support for difference-type reaction fingerprints.

Chris


--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Similarity Searching in fs-File

2011-12-16 Thread Chris Morley
On 16/12/2011 08:00, Jochen Schreiber wrote:
> Hello guys,
>
> i think i have a problem with my syntax.
>
> I have an sdf-File then i make an mol-File with: babel input.sdf -omol 
> query.mol
>
> and then i want to search with the query-File against one fs-File:
>
> babel Compound_1_25000.fs babelresult.sdf -sbabelsearch.mol 
> -at0.85
>

The following worked for me (v2.3.1):

babel chembl_02.fs result.sdf -squery.mol -at0.75
22 molecules converted
402 audit log messages

The query.mol was taken (luckily) from the one you pasted.

It would be safer to use obabel, rather than babel, to reduce the 
possibility of misinterpretion of a mistyped command line. So the above
would be better as:
obabel chembl_02.fs -O result.sdf -s query.mol -at 0.75

The error you received is because openbabel thinks the parameter on the 
-s option is a SMILES string. The possibility of it being a file was 
introduced in 2.3.0. Try
   obabel -L ops s
to check that the version you are using is sufficiently new and that the 
plugin code which provides the functionality has got loaded.

Chris

> But i became he following error:
>
> ==
> *** Open Babel Warning  in ParseSimple
>Illegal aromatic element b
> ==
> *** Open Babel Error  in ObtainTarget
>Could not make a molecule from babelsearch.mol
> This needs to be valid SMILES when using fastsearch.You can use the more 
> versatile SMARTS in a normal substructure search.
> 0 molecules converted
> 1 errors 1 warnings 5 audit log messages
>
> What is my Problem?
>
> The query.mol looks like this:
>
> 1
>   OpenBabel12161108573D
>
>   31 30  0  0  0  0  0  0  0  0999 V2000
>  0.33870.92620.4600 O   0  0  0  0  0
>  3.4786   -1.7069   -0.3119 O   0  0  0  0  0
>  1.8428   -1.40731.2523 O   0  0  0  0  0
>  0.41662.5213   -1.2091 O   0  0  0  0  0
> -2.2359   -0.72510.0270 N   0  0  0  0  0
> -0.7783   -1.15790.0914 C   0  0  0  0  0
>  0.1368   -0.0961   -0.5161 C   0  0  0  0  0
> -3.1119   -1.79720.6590 C   0  0  0  0  0
> -2.41030.58370.7840 C   0  0  0  0  0
> -2.6433   -0.5289   -1.4260 C   0  0  0  0  0
>  1.4879   -0.6438   -0.9795 C   0  0  0  0  0
>  2.3478   -1.31630.1002 C   0  0  0  0  0
>  0.46272.1935   -0.0312 C   0  0  0  0  0
>  0.66783.15491.1001 C   0  0  0  0  0
> -0.7073   -2.1051   -0.4563 H   0  0  0  0  0
> -0.5669   -1.33921.1503 H   0  0  0  0  0
> -0.30890.3239   -1.4193 H   0  0  0  0  0
> -2.9705   -2.72950.1044 H   0  0  0  0  0
> -2.8083   -1.92101.7028 H   0  0  0  0  0
> -4.1563   -1.47620.6031 H   0  0  0  0  0
> -2.03981.41700.1863 H   0  0  0  0  0
> -3.48370.73780.9384 H   0  0  0  0  0
> -1.91290.50711.7551 H   0  0  0  0  0
> -2.24500.4089   -1.8190 H   0  0  0  0  0
> -2.3000   -1.3879   -2.0100 H   0  0  0  0  0
> -3.7365   -0.4723   -1.4630 H   0  0  0  0  0
>  1.3299   -1.3744   -1.7823 H   0  0  0  0  0
>  2.09000.1756   -1.3923 H   0  0  0  0  0
> -0.19533.12801.7699 H   0  0  0  0  0
>  0.76814.16840.7012 H   0  0  0  0  0
>  1.58322.90101.6404 H   0  0  0  0  0
>1  7  1  0  0  0
>1 13  1  0  0  0
>2 12  1  0  0  0
>3 12  2  0  0  0
>4 13  2  0  0  0
>5  6  1  0  0  0
>5  8  1  0  0  0
>5  9  1  0  0  0
>5 10  1  0  0  0
>6  7  1  0  0  0
>6 15  1  0  0  0
>6 16  1  0  0  0
>7 11  1  0  0  0
>7 17  1  0  0  0
>8 18  1  0  0  0
>8 19  1  0  0  0
>8 20  1  0  0  0
>9 21  1  0  0  0
>9 22  1  0  0  0
>9 23  1  0  0  0
>   10 24  1  0  0  0
>   10 25  1  0  0  0
>   10 26  1  0  0  0
>   11 12  1  0  0  0
>   11 27  1  0  0  0
>   11 28  1  0  0  0
>   13 14  1  0  0  0
>   14 29  1  0  0  0
>   14 30  1  0  0  0
>   14 31  1  0  0  0
> M  CHG  2   2  -1   5   1
> M  END
>
>
>
> Regards,
> Jochen
>
>
> --
> Learn Windows Azure Live!  Tuesday, Dec 13, 2011
> Microsoft is holding a special Learn Windows Azure training event for
> developers. It will provide a great way to learn Windows Azure and what it
> provides. You can attend the event by watching it streamed LIVE online.
> Learn more at http://p.sf.net/sfu/ms-windowsazure
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at ht

Re: [Open Babel] small molecule finger printing

2011-12-12 Thread Chris Morley
On 10/12/2011 15:55, AKHILA wrote:
> Am new to the concept of fingerprints..I would like to know wich finger
> prints of the 3 types present in openbabel should be used if i want the
> fingerprints of small molecules like methane,ethane etc.

You haven't said what you wanted the fingerprints for. They are a way of 
recording the constituent parts of a molecule, and are
less relevant for small molecules like those you mentioned. If you are 
looking for a unique identifier for the molecule InChI, InChiKey or 
canonical SMILES might be more useful. They can all be generated by 
OpenBabel.

Chris

--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Babel Multiple Input Files

2011-12-12 Thread Chris Morley
You haven't included the whole  molecule - the bonds are missing. Try 
again. It would be better to attach files rather than pasting ttext into 
emails to avoid corruption.

Chris

On 12/12/2011 10:01, Jochen Schreiber wrote:
> Hello,
>
> sry i havnt seen the posts.
>
> Here is the head output from the join.txt:
>
> 1
>   OpenBabel1208222D
>
>   31 30  0  0  0  0  0  0  0  0999 V2000
>  2.86600.75000. O   0  0  0  0  0
>  2.8660   -2.25000. O   0  0  0  0  0
>  2.   -0.75000. O   0  0  0  0  0
>  3.73202.25000. O   0  0  0  0  0
>  5.46410.25000. N   0  0  0  0  0
>  4.59810.75000. C   0  0  0  0  0
>
> And here is a head output from an specific Compund.sdf file:
>
> 1
>-OEChem-11171106132D
>
>   31 30  0 1  0  0  0  0  0999 V2000
>  2.86600.75000. O   0  0  0  0  0  0  0  0  0  0  0  0
>  2.8660   -2.25000. O   0  5  0  0  0  0  0  0  0  0  0  0
>  2.   -0.75000. O   0  0  0  0  0  0  0  0  0  0  0  0
>  3.73202.25000. O   0  0  0  0  0  0  0  0  0  0  0  0
>  5.46410.25000. N   0  3  0  0  0  0  0  0  0  0  0  0
>  4.59810.75000. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> Does this help? Is there an error cause if the "-"- symbol?
>
> Greetz
>
> --
> Learn Windows Azure Live!  Tuesday, Dec 13, 2011
> Microsoft is holding a special Learn Windows Azure training event for
> developers. It will provide a great way to learn Windows Azure and what it
> provides. You can attend the event by watching it streamed LIVE online.
> Learn more at http://p.sf.net/sfu/ms-windowsazure
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Using openbabel.py to generate InChIKey with reconnect metal option

2011-12-10 Thread Chris Morley
On 09/12/2011 19:44, Noel O'Boyle wrote:
> Or more succintly, with obabel 2.3.1 I have:
>
> C:\Users\Noel>obabel -:[Al]C#N -oinchi -xK -xX Recmet
> ==
> *** Open Babel Warning  in InChI code
>#1 :Metal was disconnected
> ♥
> 1 molecule converted
>
> ...which is rather sweet, but probably not the desired outcome. :-)
>
> Do you have time to take a look Chris?

This gives an apparently ok result with the trunk code, while failing as 
above with 2.3.1. Perhaps the changes to inchiformat.cpp made in the 
last couple of months have been beneficial.

Incidentally, "-xM" is a synonym for "-xX RecMet".

Chris

--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Babel Multiple Input Files

2011-12-08 Thread Chris Morley
On 08/12/2011 10:30, Jochen Schreiber wrote:
> Hello,
>
> i have joined all sdf in one (join.sdf).
>
> Now i want to search: babel join.sdf resultadawd.sdf 
> -s"B(C1=CC(=CC=C1)N2C(=O)C3CC=C4C(C3C2=O)CC5=C(C4C6=C(C(=CC=C6)F)O)C(=O)C=C(C5=O)Br)(O)O"
>
> But i became the following output:
>
> ==
> *** Open Babel Warning  in ReadMolecule
>WARNING: Problems reading a MDL file
> Cannot read atom and bond count
> Expected standard 6 character atom and bond count
>
> 0 molecules converted
> 1 warnings 9 audit log messages

It seems that the first entry in the sdf file is corrupt. This format 
cannot tolerate misplaced spaces and blank lines. You could post with an 
attached copy of the file for us to see (don't paste).

Incidentally, it would be better to use obabel rather than babel.
http://openbabel.org/docs/current/Command-line_tools/babel.html

Chris

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


[Open Babel] Converting from compound names in OpenBabel

2011-12-07 Thread Chris Morley
Reminded by a question on Blue Obelisk Exchange 
(http://blueobelisk.shapado.com/questions/converting-from-compound-name-to-chemical-structure), 
I have tweaked up some code to access the NIH Chemical Identifier 
Resolver from an input format in OpenBabel. There must be doubts as to 
whether this sort of thing should be in OpenBabel at all, so I'll use 
opportunity to demonstrate (on Windows) that OpenBabel can be extended 
by plugins without having to rebuild the code.


Download http://gaseq.co.uk/OB/formats_web.obf and paste it into the 
OpenBabel folder - probably C:\Program Files (x86)\OpenBabel-2.3.1. (You 
will probably be prompted to do this as an Administrator.)


On opening the GUI you should find the nam input format. You can enter 
your names, etc. directly when the input box is yellow or you can use 
the attached file with some examples close to my heart. The NIH resolver 
uses OPSIN for systematic names, its own or ChemSpider's database for 
trivial names, and will also accept InChIKeys. On the command line it 
would be something like:

  obabel ResolverExamples.nam -osmi

Other ways of accessing this web service are the web site 
http://cactus.nci.nih.gov/chemical/structure and via Cinfony/Webel. This 
OpenBabel format doesn't add much value over these except possibly for 
multiple names.


The code should be cross-platform and incorporates the lightweight 
HappyHTML rather than loading some big library. I don't know whether 
this is the right way to go, so I have held off putting the source code 
into OpenBabel, and await advice.


Chris
#Names in NIH
Nicorandil
Clopidogrel
Atorvastatin
Candesartan
#Systematic name
acetylsalicylic acidAspirin
#InChIKey
VHYCDWMUTMEGQY-UHFFFAOYSA-N Bisoprolol
#Name in Chem-Spider
rapamycin--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Openbabel Memory Usage

2011-12-05 Thread Chris Morley
On 29/11/2011 09:35, icdi wrote:
> Dear all,
>
> I know there is some memory restrict in the Openbabel when doing the
> conversion. My question is can I enlarge the memory restrict to get my large
> sdf file (contains 25000 molecules) converted? Now I can only convert 4057
> of them.

On my Windows 7 machine with 4GB RAM, I have no difficulty working with 
an sdf file with 500,000 molecules and 1.5GB, and I think it worked when 
I had only 1GB RAM. The command line obabel and the GUI work for most 
file formats by converting as they go, rather than having to have the 
whole file in the memory at the same time.

I suspect your difficulty may be a corruption in the sdf file. Using the 
-e option will continue the conversion after a failed molecule. If this 
does not work, you could post more details of what you are trying to do.

Chris

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] InChI v 1.04 and CML to InChI conversion

2011-12-05 Thread Chris Morley
On 04/12/2011 23:59, Ken Smith wrote:
> I noticed that version 1.04 of the InChI software has removed the
> capability to generate InChIs directly from CML.  Does Openbabel
> defer this functionality to the v 1.03 InChI code at the moment?

Openbabel has never used the InChI software in the conversion from CML 
or SDF. It uses its own conversions to the internal format, OBMol, and 
then the InChI API to convert from this to InChI. This process was not 
much affected by the change from 1.03 to 1.04. Doing it this way fits 
with the structure of OpenBabel, but, as you have found, can lead to to 
some discrepancies in unusual cases, but we try to minimize these.

Chris


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Babel Multiple Input Files

2011-12-05 Thread Chris Morley
On 05/12/2011 14:30, Noel O'Boyle wrote:
> I don't know if Open Babel supports joining fs files, so joining the
> sdf may be your only choice. Chris?
>
> On 5 December 2011 15:20, Jochen Schreiber  wrote:
>> One question: Sholud i join the fs Files or the sdf Files and create the fs 
>> File on the joined sdf Files?
>>
>> What is better?

fs files cannot be joined. So concatenating the sdf files is the way to 
go. However, the combined file cannot be larger than 4GB (a 32 bit 
position is used). This format needs some work to overcome this 
limitation. I think this would be better than accepting multiple fs 
files, as you originally wanted to do, although that would be a possible 
future alternative.

Chris
>>
>> Am 05.12.2011 um 14:50 schrieb Noel O'Boyle:
>>
>>> If I would you, I would join the sdf files, and then convert that to a
>>> single fs file.
>>>
>>> To join:
>>> cat *.sdf tmp.txt
>>> mv tmp.txt joined.sdf
>>>
>>> - Noel
>>>
>>> On 3 December 2011 11:53, Jochen Schreiber  wrote:
 Hello to everybody,

 first i want to say hello. My first post in this mailinglist.

 I have a question. I have downloaded the full pubchem compound database 
 and convert all the sdf files to fs Files.

 Now i have 2138 fs-Files and i have a query.mol and i want to search the 
 top 5 similarity molecules in all fs-Files. My usage:

 sh: babel  Compound_25001_5.fs results2.sdf -query.mol

 Now i want to put in all fs-Files in this command. How does it work?

 I found solutions for that problem in java but i need to do this over the 
 commandline.

 So i hope you could help me.

 With best,

 Jochen Schreiber





 --
 All the data continuously generated in your IT infrastructure
 contains a definitive record of customers, application performance,
 security threats, fraudulent activity, and more. Splunk takes this
 data and makes sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-novd2d
 ___
 OpenBabel-discuss mailing list
 OpenBabel-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>
> --
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Babel strange behaviour (.fs empty)

2011-11-21 Thread Chris Morley
On 21/11/2011 14:43, David García Aristegui wrote:
> http://openbabel.org/docs/dev/Fingerprints/fingerprints.html
>
> The following command works like a charm with Open Babel 2.3.0 (linux)
> babel mymols.fs -ifs -sN#Cc1c1C#N results.smi
>
> But, if you forgot to define the smiles output file
> babel mymols.fs -ifs -sN#Cc1c1C#N
> after the execution mymols.fs is empty.
>
> Is this fixed in the 2.3.1 release?

This sort of problem is why babel is now deprecated and obabel is 
recommended. Thanks for illustrating the need for this change.
http://openbabel.org/docs/2.3.1/Command-line_tools/babel.html#differences-between-babel-and-obabel
The documentation has unfortunately not all been updated yet.

So:

obabel mymols.fs -ifs -sN#Cc1c1C#N -O results.smi

works ok.

obabel mymols.fs -ifs -sN#Cc1c1C#N

gives an error.

Chris

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Feature request - transparent background when converting to svg

2011-11-21 Thread Chris Morley
On 21/11/2011 09:12, JP wrote:
> Brilliant, many thanks for this Chris.
>
> - How do you make your molecules in a grid like in your attached example?

If more than one molecule is being output, they are automatically put in 
a square grid. You can also specify the number of rows or columns. This 
is playing to the strengths of SVG. The output is readable (using the 
built-in zoom) whatever then number of molecules. (It gets slow for more 
than about 100.) The current version 2.3.1 has this.

 > - Will this change be released with the next version of open babel?

I expect the color changes will be in the next version 2.3.2, possibly 
out in January.

Chris

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] OpenBabel v 2.2.3 installer

2011-11-20 Thread Chris Morley
On 20/11/2011 18:43, Kirk Simmons wrote:
> Is the Win32 installer for OpenBabel v.2.2.3 still available?

I think so:
http://sourceforge.net/projects/openbabel/files/openbabel/2.2.3/

Chris

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Pybel's 'FP4' fingerprint bug report

2011-10-31 Thread Chris Morley
I have added this to bug #3431239 to which it seem be related.

With its stereochemistry mol1 fails when making an FP4 fingerprint (lots 
of SMARTS matching). But without the stereochemistry it is ok.

Chris

On 31/10/2011 16:37, Mingyue Zheng wrote:
> Hi all,
>   I found my python script unexpectedly quit when calculating the 
> similarity between the following two molecules":
> ~~ test_fp4.py ~~~
>   import pybel
>   
> mol1=pybel.readstring('smi','CCCN1C[C@H](O)[C@H]([C@@H]([C@H]1CO)O)O 
> mol1')
>   mol2=pybel.readstring('smi','COc1ccc(cc1)Nc1c(C#N)cncc1c1ccc(c(c1)OC)OC 
>  mol2')
>   print mol1.calcfp('FP2')|mol2.calcfp('FP2')
>   print 'ok'
>   print mol1.calcfp('FP4')|mol2.calcfp('FP4')
>   print 'ok'
>
>>> test_fp4.py
> 0.0699300699301
> ok
>  the end of the script and it's output~~~
>I'm using openbabel 2.3.1 and pybel1.7 for python 2.7, on a win7 system.
>
> Best,
> Mingyue
>
>
>
>
>   
> 2011-11-01
> 
> Mingyue Zheng, Ph.D.
> Drug Discovery and Design Center (DDDC)
> Box 1201, Shanghai Institute of Materia Medica.
> No. 555 Rd. Zuchongzhi, Shanghai, China
> Tel:   86-021-50806600-1308
> Email: myzh...@mail.shcnc.ac.cn
>

--
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World™ now supports Android™ Apps 
for the BlackBerry® PlayBook™. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] smiles from SDF

2011-10-19 Thread Chris Morley
See http://openbabel.org/wiki/--append , which says that  the first 
character in the parameter of append is used as a delimiter between the 
entries. However getting this to work with a tab seems a bit 
problematical although this is platform dependent. Excel will also work 
with delimiters other than tab. 

Chris

On 19/10/2011 10:18, Fredrik Wallner wrote:
> Hi,
>
> The closest I can find is the following:
>
> obabel file.sdf -O out.smi --title "" --append name MW
>
> That is under the presumption that the SDF fields are named name and MW, and 
> that the title of the compound doesn't contain the name (in which case the 
> options only would be --append MW).
> The problem is that the result is not tab delimited, but instead has the 
> format SMILES[tab]name[SPACE]MW, but if your names doesn't contain spaces it 
> can easily be fixed upon import. To create a truly tab-delimited file I think 
> you need to resort to using pybel.
>
> Kind regards,
> Fredrik
>
> 18 okt 2011 kl. 16:35 skrev Paul Jones:
>
>> Hi,
>>
>> I have an SDF file that has the chemical structure (in MOL), MW and
>> name. Is it possible to use Openbabel to generate a tabe delimited txt
>> file with the Smiles string followed by the Name and MW? The ultimate
>> goal is to put the data in to Excel.
>>
>> Thanks
>>
>> paul
>>
>> --
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense.
>> http://p.sf.net/sfu/splunk-d2d-oct
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
> --
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] OBDotNet : OpenBabel.openbabel_csharpPINVOKE exception

2011-10-05 Thread Chris Morley
On 05/10/2011 09:25, Brüngger Adrian wrote:

> The value of the BABEL_DATADIR is as you suggest (and points to the correct 
> directory). I do see the warning messages only when I run the application 
> from within VS 2010 (debug mode). When I go to the bin/Debug/ dir (where the 
> executable and all the dlls and obfs are), and start the *.exe from a command 
> line, I do not see any warnings.

You probably need to restart Visual Studio so that its copy of the 
environment variables, which is used during debug execution, includes 
the changes you made.

Chris

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] smarts matching using the command line

2011-09-27 Thread Chris Morley
On 26/09/2011 11:50, Martin Guetlein wrote:
> On Mon, Sep 19, 2011 at 11:23 AM, Martin Guetlein<
> martin.guetl...@googlemail.com>  wrote:
>
>> On Mon, Sep 19, 2011 at 11:04 AM, Chris Morley
>> wrote:
>>> On 19/09/2011 09:32, Martin Guetlein wrote:
>>>> Hi,
>>>>
>>>> I would like to do smarts matching with OpenBabel, and for some
>>>> reasons I am restricted to use the command line interface.
>>>> Is there an efficient way to match a range of smarts strings against a
>> dataset?
>>>>
>>>> What I found out is that I could use the "-s" option, but I would have
>>>> to call babel once for each smarts, right?
>>> If the SMARTS patterns are sufficiently simple to be SMILES, then they
>>> can all be put in a file whose name is used with the -s option. The
>>> matching is OR - any single match will do. The file could be any any
>>> molecular format, but must have the appropriate extension.
>>
>
> I would have to run this once for each smarts, right? (This would produce
> quite a file parsing overhead.)

We are not quite understanding each other. Here is what I was meaning, I 
hope it is what you want. There is a dataset (in any format) and you to 
extract from it the molecules that match at least one of a set of 
structures in a file patterns.yyy (any format). The output goes to 
results.zzz You do a single command:
   obabel dataset.xxx -O results.zzz -s patterns.yyy
The isomorphism filters are constructed once and applied for each input 
molecule, but you don't have to worry about this.

>>>> A second option I found would be to edit the patterns.txt file and use
>>>> the FP3 fingerprint ("-ofpt -xfFP3 -xs"). I dont like the idea of
>>>> editing a file in advance, though (The smarts matching is part of some
>>>> software I am working on). Is there a way to provide an own patterns
>>>> file?
>>>
>>> You can make your own fingerprint by making a data file with SMARTS
>>> patterns, like patterns.txt (or with a couple of other slightly
>>> different formats) and specifying the details by making an entry in a
>>> plugindefines.txt. The MACCS fingerprint is defined there in this way.
>>
>> This looks good, I will give it a try, thanks,
>> Martin
>>
>
>
> Hmm, it worked fine in Linux, not for Windows, though. The plugindefines.txt
> is in a folder that requires admin rights to be edited (C:\Program
> Files\OpenBabel-2.3.0\data).
> Is there a way around that?

1) Copy the folder to somewhere accessible and set the environment 
variable BABEL_DATADIR to the new position. Do this via Control 
Panel/System and Security/System/Advanced system setting (in left 
panel)/Environment Variables (button). You should see BABEL_DATADIR in 
the top box.
or 2) Re-install OpenBabel to a different folder. (In the next version 
the Windows Installer will use a different default location.)
>>
>>
>>>
>>> For extra flexibility you could define a compound filter to be used with
>>> the --filter option, where SMARTS tests can be combined with conditions
>>> based on other molecular (or SDF type) properties.
>>
>
> Same as for the -s option here, I have to run it once for each smarts,
> right?

You can run several SMARTS filters in the same command. Suppose you want 
to only convert molecules that have a pyridine ring or have a bromine atom:
   obabel dataset.xxx -O results.zzz --filter "s=n1c1 || s=[Br]"

There seems to be a glitch with the compound filter, which would combine 
these. I'll try to sort it out.

Chris

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] smarts matching using the command line

2011-09-19 Thread Chris Morley
On 19/09/2011 09:32, Martin Guetlein wrote:
> Hi,
>
> I would like to do smarts matching with OpenBabel, and for some
> reasons I am restricted to use the command line interface.
> Is there an efficient way to match a range of smarts strings against a 
> dataset?
>
> What I found out is that I could use the "-s" option, but I would have
> to call babel once for each smarts, right?
If the SMARTS patterns are sufficiently simple to be SMILES, then they 
can all be put in a file whose name is used with the -s option. The 
matching is OR - any single match will do. The file could be any any 
molecular format, but must have the appropriate extension.
>
> A second option I found would be to edit the patterns.txt file and use
> the FP3 fingerprint ("-ofpt -xfFP3 -xs"). I dont like the idea of
> editing a file in advance, though (The smarts matching is part of some
> software I am working on). Is there a way to provide an own patterns
> file?

You can make your own fingerprint by making a data file with SMARTS 
patterns, like patterns.txt (or with a couple of other slightly 
different formats) and specifying the details by making an entry in a 
plugindefines.txt. The MACCS fingerprint is defined there in this way.

For extra flexibility you could define a compound filter to be used with 
the --filter option, where SMARTS tests can be combined with conditions 
based on other molecular (or SDF type) properties.

Chris

--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Python, openbabel, generation of InChIs and InChIKeys for proton and protonated molecular hydrogen from SMILES

2011-09-15 Thread Chris Morley
On 05/09/2011 19:27, Ken Smith wrote:

In response to this, I have made a few changes to the way OpenBabel 
calculates InChI.

> E.g. for a proton [H+], I get:
>
> InChI=1S/H/q+1
> (ASSFXGJQJOXDAB-UHFFFAOYSA-N)
>
> But I *think* I should be getting:
>
> InChI=1S/p+1
> (GPRLSGONYQIRFK-UHFFFAOYSA-N)

OB now gives InChI=1S/p+1 which Dmitrii Tchekhovskoi on the 
InChI-discuss mailing list recommends as correct.

> Likewise for protonated molecular hydrogen (whose SMILES notation I
> assume is [H][H][H+]).  I'm getting an InChI of:
>
> InChI=1S/H3/h1H2/q+1
>
> whereas I'm fairly sure it should be something like:
>
> InChI=1S/H2/h1H/p+1

OB still gives InChI=1S/H3/h1H2/q+1, which is apparently correct for a 
linear structure.

On the other list Dmitrii Tchekhovskoi and Geoff Hutchinson discussed 
calculating InChIKey directly from an input InChi, rather than going 
through an OBMol. This is now done by default on the commandline or in 
the GUI whenever InChI is the input format. There is an option to force 
a recalculation. (The inchi descriptor behaves as if it always reuses an 
input InChI.)

Chris

--
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Reading CML bug

2011-09-14 Thread Chris Morley
On 14/09/2011 14:18, Weerapong Phadungsukanan wrote:
> Dear all,
>
> I found that if the white space characters are found before and not after
> the root ending tag, babel will not be able to read the CML file properly
> (even if they all represent the same molecule). Here is the command I used
> to comvert the file
>
> babel -icml molecule.cml -osmi molecule.smi
>
> I have attached the test files, only the first one failed the conversion

I have fixed this bug in r4574 in the development code.

There is another bug though. The molecule is a radical, but is not being 
recognized as such. (MarvinView also fails.) Because atoms in CML can 
have implicit hydrogen it is necessary to give extra assistance for 
alkoxy radicals (i.e. SMILES *[O]) by giving the O atom a 
radical="monovalent", spinMultiplicity="2" or hydrogenCount="0" 
attribute. The spinMultiplicity on the whole molecule is not enough and 
I suspect would require a lot of programming to make it sufficient in 
the general case and so would encourage the use of one of the attributes 
above on radical centers.

Chris


--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] SDF conversion test results

2011-08-23 Thread Chris Morley
On 23/08/2011 11:29, Noel O'Boyle wrote:
> I note that Chris has fixed some problems with metals, and we're down
> to 146 failures.

Some notes on this are below. (I was waiting to make sure the changes 
didn't cause mass test failure.)

On 09/08/2011 13:39, Róbert Kiss wrote:
 > We recently did some testing with different cheminformatic tools
 > including OpenBabel to see how accurately they can read and write SD
 > files.

Noel has addressed the stereochemical discrepancies previously. Some of 
the other ones, mainly valence-related, are now fixed with the changes 
discussed in more detail below.

 > 3. For atoms with unusual valence state it seems that OpenBabel
 > automatically sets the typical valence, while InChI accepts the
 > valence as described in the SDF (e.g. 44420892). This difference in
 > the valence state results in a difference in the number of implicit
 > hydrogens (connected to Si in this example), and thus in different
 > InChIs:
 >
 > input InChI: 
InChI=1S/C27H35NO8Si/c1-27(2,3)37-36-21-14-18(28-29)24(17-12-22(32-6)26(34-8)23(13-17)33-7)25(21)16-9-10-19(31-5)20(11-16)35-15-30-4/h9-13,21,29H,14-15H2,1-8H3/b28-18-
 > (InChI warning: value="Accepted unusual valence(s): Si(2)")
 > output InChI: 
InChI=1S/C27H37NO8Si/c1-27(2,3)37-36-21-14-18(28-29)24(17-12-22(32-6)26(34-8)23(13-17)33-7)25(21)16-9-10-19(31-5)20(11-16)35-15-30-4/h9-13,21,29H,14-15,37H2,1-8H3/b28-18-
 >
 > input SDF: 5.27913.07170. Si  0  0  0  0  0  2  0  0  0  0
 >   0  0 (valence is 2)
 > output SDF: 5.27913.07170. Si  0  0  0  0  0  0  0  0  0
 > 0  0  0 (valence is set to default; in case of Si this means 4)

OpenBabel currently interprets only the value 15 (= 0 valence) (because 
of a technical difficulty) and I have now made it so that any value 
causes no implicit hydrogens. I expect that this is nearly always why 
this feature is used, but there could be cases within the spec (such as 
it is) which would not necessarily be correctly interpreted. However, 
the sd file in this example is now read correctly. But when output it 
uses the M  RAD line, rather than the valence value, which IMO gives a 
better chemical description of the molecule.

 > 4. For atoms with unusual valence state sometimes the valence state in
 > the atom block disappears and an extra "M  RAD" line appears  in the
 > output SDF (e.g.: 19350442). AFAIK the valence count in the atom block
 > and the "M  RAD" line are two different things (not totally
 > independent though) so the valence information cannot be converted to
 > a radical state information directly. Also the last number in the "M
 > RAD" line can only be 0,1,2 or 3 according to the MOL file
 > specification, while we found numbers 4 and 5 in some cases.
 > input InChI: 
InChI=1S/C9H13.C8H11.2CH3.2ClH.Si.Zr/c1-6-5-7(2)9(4)8(6)3;1-2-4-6-8-7-5-3-1;;/h6H,1-4H3;1-3H,4,6-8H2;2*1H3;2*1H;;/q4*-1+4/p-2/b;2-1-;;
 > output InChI: 
InChI=1S/C9H13.C8H11.2CH3.2ClH.H4Si.Zr/c1-6-5-7(2)9(4)8(6)3;1-2-4-6-8-7-5-3-1;;/h6H,1-4H3;1-3H,4,6-8H2;2*1H3;2*1H;1H4;/q4*-1+4/p-2/b;2-1-;;
 >
 > input SDF atom block: 9.97745.02460. Si  0  0  0  0  0 15
 > 0  0  0  0  0  0 (15 means valence: 0)
 > output SDF atom block: 9.97745.02460. Si  0  0  0  0  0  0
 >   0  0  0  0  0  0 (0 means valence is default: 4)
 >
 > input SDF: no "M  RAD" line
 > output SDF: M  RAD  1   4   5

OpenBabel uses the equivalent of the RAD value to represent hydrogen 
deficiency in the organic subset of elements and silicon, so it is 
necessary to use the values 4 and 5 internally. Isolated C or Si atoms 
would have a value of 5, even if their spinmultiplicity was smaller. The 
molecule 19350442 has such an unbonded Si atom (which does not seem very 
realistic to me, and illustrates the inadequacy of SDF for 
organometallic molecules). But in the writing of MDL files the RAD 
values 4 and 5 are now replaced by a valence value as are any values on 
metal atoms.

 > 5. This is a quite extreme molecule (23569471). It contains a carbon
 > atom connected to another carbon and two hydrogens. It has a positive
 > charge according to the input SDF. OpenBabel preserves the charge
 > information, but adds an additional "M  RAD" line, which is (together
 > with the positive charge) not correct, I think. This difference in the
 > SDF results in different InChIs because InChI can only remove the
 > positive charge from the PubChem input SDF.
 >
 > input InChI: 
InChI=1S/C29H42O2/c1-20(2)12-9-13-21(3)14-10-15-22(4)16-11-18-29(8)19-17-26-25(7)27(30)23(5)24(6)28(26)31-29/h12,14,16H,1,9-11,13,15,17-19H2,2-8H3/p+1/b20-12-,21-14+,22-16+
 > output InChI: 
InChI=1S/C29H43O2/c1-20(2)12-9-13-21(3)14-10-15-22(4)16-11-18-29(8)19-17-26-25(7)27(30)23(5)24(6)28(26)31-29/h12,14,16,30H,1,9-11,13,15,17-19H2,2-8H3/q+1/b21-14+,22-16+
 >
 > input SDF: no "M  RAD" line
 > output SDF: M  RAD  1  31   2

There was a missing valence value in a data file for such carbanions, 
which is now corrected.

---

  1   2   >