From: A. S. <oli...@ya...> - 2006-08-18 18:04:34
|
Chris Morley wrote: > > A. Sebastian wrote: >> I use OpenBabel Perl Module to parse mol files to a database and by the >> way I >> use the following code to obtain smiles format: >> my $obMol=new Chemistry::OpenBabel::OBMol; >> my $obConversion=new Chemistry::OpenBabel::OBConversion; >> $obConversion->SetInAndOutFormats("mol","smi"); >> $obConversion->ReadString($obMol,$mol_file); >> my $outSmiles=$obConversion->WriteString($obMol); >> >> All works OK, but I obtain sometimes warning messages on screen that make >> slower the process, I'd like to avoid this messages but I don't know how >> to >> do that. >> >> An example of the warning messages: >> *** Open Babel Warning in WriteMolecule >> 1-[(4-Acetyl-phenylcarbamoyl)-methyl]-pyridinium Proton(s) >> added/removed >> >> With the InChi format I have success avoiding this messages with this >> code: >> my $obMol=new Chemistry::OpenBabel::OBMol; >> my $obConversion=new Chemistry::OpenBabel::OBConversion; >> $obConversion->SetInAndOutFormats("mol","inchi"); >> $obConversion->ReadString($obMol,$mol_file); >> $obConversion->SetOptions("w",1); >> my $outInchi=$obConversion->WriteString($obMol); >> >> I want to know if exists a similar solution for smiles, because the >> former >> doen't work ($obConversion->SetOptions("w",1);) >> > > You can control the severity of OpenBabel error messages that are > displayed in C++ code using: > > obErrorLog.SetOutputLevel(0); > > 0 supresses all the messages; 5 allows everything. > > OpenBabel::obErrorLog is a global variable; the number is an enum of > type obMessageLevel. I don't know how well this works in the Perl > version, but if it doesn't we should do something about it. > > obErrorLog.StopLogging(); > is an alternative to supress everything. > > (In the command-line version use the option ---errorlevel n ) > > Chris > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > Finally I tried adding the following perl lines: my $obMessageHandler=new Chemistry::OpenBabel::OBMessageHandler; $obMessageHandler->StopLogging(); And I obtained the following error: Can't locate Chemistry/OpenBabel/OBMessageHandler.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) Perhaps there is something wrong in the former two lines of my code, or could be the problem that the class OBMessageHandler is not implemented in Perl? Alvaro -- View this message in context: http://www.nabble.com/Open-Babel-Warnings-tf2080646.html#a5874719 Sent from the openbabel-scripting forum at Nabble.com. |