Tested!

I did not noticed this detail ... too many hours typing and the simple
becomes invisible!!

Very much thanks, Noel,

2011/1/24 Noel O'Boyle [via Open Babel] <
[email protected]<ml-node%[email protected]>
>

> You need to set the input format before calling ReadString. Also
> ReadString returns False if it fails. See the API at
>
> http://openbabel.org/api/2.3/classOpenBabel_1_1OBConversion.shtml#a93558e9c89cda2e1a4f9fb2cadc5c8d1
>
> Regards,
>    Noel
>
> On 23 January 2011 22:57, kohai.raul <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=3233628&i=0>>
> wrote:
>
> >
> > 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<http://forums.openbabel.org/Very-Strange-behaviour-OBConversion-Perl-Bindings-tp3233147p3233147.html?by-user=t>
> > 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
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3233628&i=1>
> > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
> >
>
> ------------------------------------------------------------------------------
>
> 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
> [hidden email] <http://user/SendEmail.jtp?type=node&node=3233628&i=2>
> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://forums.openbabel.org/Very-Strange-behaviour-OBConversion-Perl-Bindings-tp3233147p3233628.html
>  To unsubscribe from Very Strange behaviour OBConversion. Perl Bindings, click
> here<http://forums.openbabel.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3233147&code=a29oYWkucmF1bEBnbWFpbC5jb218MzIzMzE0N3wtMTg3MTk2NzAx>.
>
>



-- 
--
Raúl Cruz
foro.fuentedepermacultura.org
"pro-curando..."

-- 
View this message in context: 
http://forums.openbabel.org/Very-Strange-behaviour-OBConversion-Perl-Bindings-tp3233147p3234161.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