Hi all!!

I'm testing OpenBabel 2.2.3 with Perl Bindings, and found a very very
strange behaviour related to  OBConversion.

By now, I created a simple perl script 'smiles2anything.pl'

==== smiles2anything.pl ========

#!/usr/bin/perl

use Chemistry::OpenBabel;

 $smiles = shift;
 $service = shift;

  my $obMolIn = new Chemistry::OpenBabel::OBMol;
  my $obConv = new Chemistry::OpenBabel::OBConversion;
 
  $obConv->ReadString($obMolIn, $smiles); 
  $obConv->SetInAndOutFormats("SMI", $service);  
  my $obOut=$obConv->WriteString($obMolIn);
    
  print ("$obOut");  

==== Shell ====

I've used it as follows:

$ ./openbabel-bridge.pl '[H]C([H])=C([H])O[B-]([H])([H])OC([H])[H]' 'INCHI'

But the result is:

*** Open Babel Error  in InChI code
  InChI generation failed

??????

==== After that ====

after that, and many many many tests ... I found that if I apply the
following "ununderstandable" variation, everything changes!! :-?

#!/usr/bin/perl

use Chemistry::OpenBabel;

 $smiles = shift;
 $service = shift;

  my $obMolIn = new Chemistry::OpenBabel::OBMol;
  my $obConv = new Chemistry::OpenBabel::OBConversion;
 
  $obConv->ReadString($obMolIn, $smiles);
  $obConv->SetInAndOutFormats("SMI", "MOL"); 
  my $obOut=$obConv->WriteString($obMolIn);  
  
  $obMolIn->Clear();
  $obConv->ReadString($obMolIn, $smiles); 
  $obConv->SetInAndOutFormats("SMI", $service);  
  my $obOut=$obConv->WriteString($obMolIn);
    
  print ("$obOut");  
 
==== SHELL 2nd attempt ======

And now.... :-O

$./openbabel-bridge.pl '[H]C([H])=C([H])O[B-]([H])([H])OC([H])[H]' 'INCHI'

InChI=1S/C3H8BO2/c1-3-6-4-5-2/h3H,1,4H2,2H3/q-1

=======================

Is this behaviour normal??? does anyone with similar problems??

Best Regards,



-- 
View this message in context: 
http://forums.openbabel.org/Very-Strange-behaviour-OBConversion-Perl-Bindings-tp3233147p3233147.html
Sent from the openbabel-scripting mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
OpenBabel-scripting mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting

Reply via email to